DebugClients/Python/DebugBase.py

branch
maintenance
changeset 6693
3629d88ae235
parent 6687
352a7abb5582
child 6891
93f82da09f22
--- a/DebugClients/Python/DebugBase.py	Thu Jan 10 14:23:49 2019 +0100
+++ b/DebugClients/Python/DebugBase.py	Sat Feb 02 11:12:54 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