Debugger/DebuggerInterfacePython.py

changeset 1171
1ffefa5ca226
parent 1166
a94b0a2fafd7
child 1179
7661ab683f7b
diff -r a3731e520b28 -r 1ffefa5ca226 Debugger/DebuggerInterfacePython.py
--- a/Debugger/DebuggerInterfacePython.py	Sun Jul 10 19:01:08 2011 +0200
+++ b/Debugger/DebuggerInterfacePython.py	Tue Jul 12 09:08:45 2011 +0200
@@ -88,6 +88,9 @@
                 self.translate = self.__remoteTranslation
             else:
                 self.translate = self.__identityTranslation
+        
+        # attribute to remember the name of the executed script
+        self.__scriptName = ""
 
     def __identityTranslation(self, fn, remote2local=True):
         """
@@ -434,6 +437,7 @@
         @keyparam forkChild flag indicating to debug the child after forking (boolean)
         """
         self.__autoContinue = autoContinue
+        self.__scriptName = os.path.abspath(fn)
         
         wd = self.translate(wd, False)
         fn = self.translate(os.path.abspath(fn), False)
@@ -453,6 +457,8 @@
         @keyparam autoFork flag indicating the automatic fork mode (boolean)
         @keyparam forkChild flag indicating to debug the child after forking (boolean)
         """
+        self.__scriptName = os.path.abspath(fn)
+        
         wd = self.translate(wd, False)
         fn = self.translate(os.path.abspath(fn), False)
         self.__sendCommand('{0}{1}\n'.format(
@@ -470,6 +476,8 @@
         @keyparam erase flag indicating that coverage info should be
             cleared first (boolean)
         """
+        self.__scriptName = os.path.abspath(fn)
+        
         wd = self.translate(wd, False)
         fn = self.translate(os.path.abspath(fn), False)
         self.__sendCommand('{0}{1}@@{2}@@{3}@@{4:d}\n'.format(
@@ -485,6 +493,8 @@
         @param wd the working directory for the program (string)
         @keyparam erase flag indicating that timing info should be cleared first (boolean)
         """
+        self.__scriptName = os.path.abspath(fn)
+        
         wd = self.translate(wd, False)
         fn = self.translate(os.path.abspath(fn), False)
         self.__sendCommand('{0}{1}|{2}|{3}|{4:d}\n'.format(
@@ -709,6 +719,8 @@
                 filename
         @param coverase flag indicating erasure of coverage data is requested
         """
+        self.__scriptName = os.path.abspath(fn)
+        
         fn = self.translate(os.path.abspath(fn), False)
         self.__sendCommand('{0}{1}|{2}|{3}|{4:d}|{5}|{6:d}\n'.format(
             DebugProtocol.RequestUTPrepare, fn, tn, tfn, cov, covname, coverase))
@@ -835,7 +847,11 @@
                         excmessage = exclist[1]
                         stack = exclist[2:]
                         if stack and stack[0] and stack[0][0] == "<string>":
-                            stack = []
+                            for stackEntry in stack:
+                                if stackEntry[0] == "<string>":
+                                    stackEntry[0] = self.__scriptName
+                                else:
+                                    break
                     except (IndexError, ValueError, SyntaxError):
                         exctype = None
                         excmessage = ''
@@ -860,6 +876,7 @@
                     continue
                 
                 if resp == DebugProtocol.ResponseExit:
+                    self.__scriptName = ""
                     self.debugServer.signalClientExit(evalArg)
                     continue
                 

eric ide

mercurial