Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs
[issue13183] pdb skips frames after hitting a breakpoint and running step
 

Index | Next | Previous | View Flat


report at bugs

Apr 30, 2012, 1:00 PM


Views: 225
Permalink
[issue13183] pdb skips frames after hitting a breakpoint and running step [In reply to]

Xavier de Gaye <xdegaye [at] gmail> added the comment:

Hi Senthil,

Thanks for your help with this issue.

self.frame_returning is both a flag to indicate that we are returning
from the current frame and a value (the current frame). We need both
as set_step() (the method invoked when the user runs the step command)
does not know the current frame and wether we are returning from the
current frame.

Here is a raw sketch of the call chain in the case where the user
types the step command on returning from the current frame (Pdb
subclasses both bdb.Bdb and cmd.Cmd):

Bdb::dispatch_return
Pdb::user_return (Bdb overriden method)
Pdb::interaction
Cmd::cmdloop
Cmd::onecmd
Pdb::do_step
Bdb::set_step

So self.frame_returning must be set to None after the call to
self.user_return() so that its value is not used in another later step
command, where we are not returning from this frame. Actually it is
more explicit and more robust to use a try-finally clause, such as:

def dispatch_return(self, frame, arg):
if self.stop_here(frame) or frame == self.returnframe:
try:
self.frame_returning = frame
self.user_return(frame, arg)
finally:
self.frame_returning = None
if self.quitting: raise BdbQuit
return self.trace_dispatch


Xavier

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13183>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Subject User Time
[issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs Apr 30, 2012, 9:53 AM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs Apr 30, 2012, 1:00 PM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs Apr 30, 2012, 7:37 PM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs Apr 30, 2012, 7:49 PM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 1, 2012, 11:02 AM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 1, 2012, 11:47 AM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 1, 2012, 12:06 PM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 1, 2012, 5:01 PM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 1, 2012, 7:03 PM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 1, 2012, 10:39 PM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 1, 2012, 10:41 PM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 2, 2012, 11:42 AM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 2, 2012, 1:05 PM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 6, 2012, 2:32 AM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 6, 2012, 2:50 AM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 6, 2012, 2:54 AM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 6, 2012, 2:54 AM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 7, 2012, 12:53 PM
    [issue13183] pdb skips frames after hitting a breakpoint and running step report at bugs May 9, 2012, 8:44 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.