~ubuntu-branches/ubuntu/utopic/mysql-workbench/utopic

« back to all changes in this revision

Viewing changes to frontend/common/grt_python_debugger.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2014-05-31 12:03:58 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20140531120358-cjik5ofkmj0fxsn8
Tags: 6.1.6+dfsg-1
* New upstream release [May 2014].
* Dropped "prtcl.patch".
* "debian/clean": better clean-up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* 
2
 
 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
 
2
 * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or
5
5
 * modify it under the terms of the GNU General Public License as
275
275
 
276
276
void PythonDebugger::init_pdb()
277
277
{
278
 
  grt::WillEnterPython lock;
 
278
  WillEnterPython lock;
279
279
  
280
280
  grt::PythonContext *pyc = grt::PythonContext::get();
281
281
  
347
347
{  
348
348
  if (margin == 1 || margin == 0) // click line numbers or on the markers
349
349
  {
350
 
    grt::WillEnterPython lock;
 
350
    WillEnterPython lock;
351
351
 
352
352
    if (toggle_breakpoint(editor->get_path().c_str(), line+1)) // line numbers from editor are 0 based
353
353
      editor->get_editor()->show_markup(LineMarkupBreakpoint, line);
361
361
{
362
362
  if (linesAdded != 0)
363
363
  {
364
 
    grt::WillEnterPython lock;
 
364
    WillEnterPython lock;
365
365
    
366
366
    std::string path = editor->get_path();
367
367
    
382
382
  int row = _breakpoint_list->row_for_node(node);
383
383
  if (column == 2 && row >= 0) // edit bp condition
384
384
  {
385
 
    grt::WillEnterPython lock;
 
385
    WillEnterPython lock;
386
386
    grt::AutoPyObject r(PyObject_CallMethod(_pdb, (char*)"wdb_set_bp_condition", (char*)"(is)", row, value.c_str()), 
387
387
                        false);
388
388
    if (!r)
404
404
 
405
405
void PythonDebugger::refresh_file(const std::string &file)
406
406
{
407
 
  grt::WillEnterPython lock;
 
407
  WillEnterPython lock;
408
408
  grt::AutoPyObject r(PyObject_CallMethod(_pdb, (char*)"wdb_reload_module_for_file", (char*)"(s)", file.c_str()), 
409
409
                      false);
410
410
}
415
415
  if (editor->is_dirty() && !ensure_code_saved())
416
416
    return;
417
417
 
418
 
  grt::WillEnterPython lock;
 
418
  WillEnterPython lock;
419
419
 
420
420
//  debug_print(base::strfmt("Running script %s...\n", _shell->get_path().c_str()));
421
421
 
738
738
    show_frame = -1*(_stack_list->row_for_node(node)+1);
739
739
  }
740
740
  
741
 
  grt::WillEnterPython lock;
 
741
  WillEnterPython lock;
742
742
  
743
743
  grt::AutoPyObject r(PyObject_CallMethod(_pdb, (char*)"wdb_refresh_variables", (char*)"(i)", 
744
744
                                          show_frame),
753
753
 
754
754
bool PythonDebugger::toggle_breakpoint(const char *file, int line)
755
755
{
756
 
  grt::WillEnterPython lock;
 
756
  WillEnterPython lock;
757
757
  
758
758
  grt::AutoPyObject r(PyObject_CallMethod(_pdb, (char*)"wdb_toggle_breakpoint", (char*)"(si)", 
759
759
                                          file, line),