Commit 38f11101 authored by Kurt B. Kaiser's avatar Kurt B. Kaiser

Debugger was tracing through rpc.py when IDLEfork was not started

from its source directory.  Generalize the "workaround" (though
the latter seems a reasonable solution?) to handle this.
parent 7cca3d8e
...@@ -15,7 +15,7 @@ class Idb(bdb.Bdb): ...@@ -15,7 +15,7 @@ class Idb(bdb.Bdb):
def user_line(self, frame): def user_line(self, frame):
co_filename = frame.f_code.co_filename co_filename = frame.f_code.co_filename
co_name = frame.f_code.co_name ## co_name = frame.f_code.co_name
## print>>sys.__stderr__, "*function: ", frame.f_code.co_name ## print>>sys.__stderr__, "*function: ", frame.f_code.co_name
## print>>sys.__stderr__, "*file: ", frame.f_code.co_filename ## print>>sys.__stderr__, "*file: ", frame.f_code.co_filename
...@@ -23,28 +23,26 @@ class Idb(bdb.Bdb): ...@@ -23,28 +23,26 @@ class Idb(bdb.Bdb):
## print>>sys.__stderr__, "*name: ", co_name ## print>>sys.__stderr__, "*name: ", co_name
## print>>sys.__stderr__, "*function: ", frame.f_locals.get(co_name,None) ## print>>sys.__stderr__, "*function: ", frame.f_locals.get(co_name,None)
try: ## try:
# XXX 12 Dec 2002 CGT TO DO: Find way to get a reference to the ## # XXX 12 Dec 2002 CGT TO DO: Find way to get a reference to the
# XXX currently running function. If the function has an ## # XXX currently running function. If the function has an
# attribute called "DebuggerStepThrough", prevent the debugger ## # attribute called "DebuggerStepThrough", prevent the debugger
# from stepping through Idle code. The following doesn't work ## # from stepping through Idle code. The following doesn't work
# in instance methods. Hard coded some workarounds. ## # in instance methods. Hard coded some workarounds.
## func = frame.f_locals[co_name]
func = frame.f_locals[co_name] ## if getattr(func, "DebuggerStepThrough", 0):
if getattr(func, "DebuggerStepThrough", 0): ## print "XXXX DEBUGGER STEPPING THROUGH"
print "XXXX DEBUGGER STEPPING THROUGH" ## self.set_step()
self.set_step() ## return
return ## except:
except: ## pass
pass
# workaround for the problem above # workaround for the problem above
if co_filename in (r'.\rpc.py', 'rpc.py','<string>'): exclude = ('rpc.py', 'threading.py', '<string>')
self.set_step() for rpcfile in exclude:
return if co_filename.count(rpcfile):
if co_filename.endswith('threading.py'): self.set_step()
self.set_step() return
return
message = self.__frame2message(frame) message = self.__frame2message(frame)
self.gui.interaction(message, frame) self.gui.interaction(message, frame)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment