[Idle-dev] CVS: idle Debugger.py,1.19,1.20

Kurt B. Kaiser kbk@users.sourceforge.net
Tue, 31 Dec 2002 16:26:44 -0800


Update of /cvsroot/idlefork/idle
In directory sc8-pr-cvs1:/tmp/cvs-serv25932

Modified Files:
	Debugger.py 
Log Message:
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.


Index: Debugger.py
===================================================================
RCS file: /cvsroot/idlefork/idle/Debugger.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** Debugger.py	31 Dec 2002 15:59:14 -0000	1.19
--- Debugger.py	1 Jan 2003 00:26:41 -0000	1.20
***************
*** 16,20 ****
  
          co_filename = frame.f_code.co_filename
!         co_name = frame.f_code.co_name
  
          ## print>>sys.__stderr__, "*function: ", frame.f_code.co_name
--- 16,20 ----
  
          co_filename = frame.f_code.co_filename
! ##        co_name = frame.f_code.co_name
  
          ## print>>sys.__stderr__, "*function: ", frame.f_code.co_name
***************
*** 24,49 ****
          ## 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"
                  self.set_step()
                  return
-         except:
-             pass
- 
-         # 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'):
-             self.set_step()
-             return
          message = self.__frame2message(frame)
          self.gui.interaction(message, frame)
--- 24,47 ----
          ## 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"
! ##                 self.set_step()
! ##                 return
! ##         except:
! ##             pass
  
!         # workaround for the problem above
!         exclude = ('rpc.py', 'threading.py', '<string>')
!         for rpcfile in exclude:
!             if co_filename.count(rpcfile):
                  self.set_step()
                  return
          message = self.__frame2message(frame)
          self.gui.interaction(message, frame)