DebugClients/Python/DebugBase.py

changeset 6687
352a7abb5582
parent 6645
ad476851d7e0
child 6891
93f82da09f22
diff -r f7f19fe6a02f -r 352a7abb5582 DebugClients/Python/DebugBase.py
--- a/DebugClients/Python/DebugBase.py	Wed Jan 30 18:59:31 2019 +0100
+++ b/DebugClients/Python/DebugBase.py	Wed Jan 30 22:37:32 2019 +0100
@@ -708,10 +708,11 @@
         @return list of lists with file name (string), line number (integer)
             and function name (string)
         """
+        tb_lineno = None
         if frame is None:
             fr = self.getCurrentFrame()
         elif type(frame) == list:
-            fr = frame.pop(0)
+            fr, tb_lineno = frame.pop(0)
         else:
             fr = frame
         
@@ -732,7 +733,7 @@
                      "ThreadExtension.py", "threading.py")):
                 break
             
-            fline = fr.f_lineno
+            fline = tb_lineno or fr.f_lineno
             ffunc = fr.f_code.co_name
             
             if ffunc == '?':
@@ -754,7 +755,7 @@
             # is it a stack frame or exception list?
             if type(frame) == list:
                 if frame != []:
-                    fr = frame.pop(0)
+                    fr, tb_lineno = frame.pop(0)
                 else:
                     fr = None
             else:
@@ -886,7 +887,7 @@
             frlist = self.__extract_stack(exctb)
             frlist.reverse()
             
-            self.currentFrame = frlist[0]
+            self.currentFrame = frlist[0][0]
             stack = self.getStack(frlist[self.skipFrames:])
         
         self._dbgClient.lockClient()
@@ -936,7 +937,7 @@
         tb = exctb
         stack = []
         while tb is not None:
-            stack.append(tb.tb_frame)
+            stack.append((tb.tb_frame, tb.tb_lineno))
             tb = tb.tb_next
         tb = None
         return stack

eric ide

mercurial