summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/Debugger.py
diff options
context:
space:
mode:
authorChui Tey <chui.tey@advdata.com.au>2002-12-12 20:53:19 (GMT)
committerChui Tey <chui.tey@advdata.com.au>2002-12-12 20:53:19 (GMT)
commit067d734f9e54fa7685ab9bd44e2221c04a52f292 (patch)
tree99d4cc03ddace2dbfac0ba95417585668cd51efa /Lib/idlelib/Debugger.py
parentde3337913f08266b16842f21a67427d10725ed8f (diff)
downloadcpython-067d734f9e54fa7685ab9bd44e2221c04a52f292.zip
cpython-067d734f9e54fa7685ab9bd44e2221c04a52f292.tar.gz
cpython-067d734f9e54fa7685ab9bd44e2221c04a52f292.tar.bz2
Prevent debugger from stepping into Idle rpc code
Diffstat (limited to 'Lib/idlelib/Debugger.py')
-rw-r--r--Lib/idlelib/Debugger.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/Lib/idlelib/Debugger.py b/Lib/idlelib/Debugger.py
index 0270f0c..a82fdbb 100644
--- a/Lib/idlelib/Debugger.py
+++ b/Lib/idlelib/Debugger.py
@@ -13,13 +13,23 @@ class Idb(bdb.Bdb):
bdb.Bdb.__init__(self)
def user_line(self, frame):
- # get the currently executing function
- ##print>>sys.__stderr__, "*function: ", frame.f_code.co_name
- ##print>>sys.__stderr__, "*file: ", frame.f_code.co_filename
- ##print>>sys.__stderr__, "*line number: ", frame.f_code.co_firstlineno
+
co_filename = frame.f_code.co_filename
co_name = 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__, "*line number: ", frame.f_code.co_firstlineno
+ ## print>>sys.__stderr__, "*name: ", co_name
+ ## print>>sys.__stderr__, "*function: ", frame.f_locals.get(co_name,None)
+
try:
+ # XXX 12 Dec 2002 CGT TO DO: Find way to get a reference to the
+ # XXX currently running function. If the function has an
+ # attribute called "DebuggerStepThrough", prevent the debugger
+ # from stepping through Idle code. The following doesn't work
+ # in instance methods. Hard coded some workarounds.
+
func = frame.f_locals[co_name]
if getattr(func, "DebuggerStepThrough", 0):
print "XXXX DEBUGGER STEPPING THROUGH"
@@ -27,7 +37,9 @@ class Idb(bdb.Bdb):
return
except:
pass
- if co_filename in ('rpc.py', '<string>'):
+
+ # workaround for the problem above
+ if co_filename in (r'.\rpc.py', 'rpc.py','<string>'):
self.set_step()
return
if co_filename.endswith('threading.py'):