[issue9919] gdbinit lineno result is one line in excess

Amaury Forgeot d'Arc report at bugs.python.org
Thu Sep 23 00:11:05 CEST 2010


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

OK, I reproduce the issue. It is now clear to me as well that r39492 was slightly wrong: the replacement of "break" should avoid to execute the end of the loop.

The following patch fixes the issue for me, can someone with better gdb knowledge check it?

Index: Misc/gdbinit
===================================================================
--- Misc/gdbinit        (revision 84966)
+++ Misc/gdbinit        (working copy)
@@ -59,9 +59,10 @@
       set $__p = $__p + 1
       if ($__ad > $__lasti)
        set $__continue = 0
+      else
+        set $__li = $__li + *$__p
+        set $__p = $__p + 1
       end
-      set $__li = $__li + *$__p
-      set $__p = $__p + 1
     end
     printf "%d", $__li
 end

----------
stage:  -> patch review

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9919>
_______________________________________


More information about the Python-bugs-list mailing list