Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4655e44

Browse files
committed
break sets a breakpoint rather than stopping the loop.
It *appears* a flag is necessary instead. This was tested in gdb 6.0. Backport candidate
1 parent 7da4eda commit 4655e44

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Misc/gdbinit

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@ end
4646
# A rewrite of the Python interpreter's line number calculator in GDB's
4747
# command language
4848
define lineno
49+
set $__continue = 1
4950
set $__co = f->f_code
5051
set $__lasti = f->f_lasti
5152
set $__sz = ((PyStringObject *)$__co->co_lnotab)->ob_size/2
5253
set $__p = (unsigned char *)((PyStringObject *)$__co->co_lnotab)->ob_sval
5354
set $__li = $__co->co_firstlineno
5455
set $__ad = 0
55-
while ($__sz-1 >= 0)
56+
while ($__sz-1 >= 0 && $__continue)
5657
set $__sz = $__sz - 1
5758
set $__ad = $__ad + *$__p
5859
set $__p = $__p + 1
5960
if ($__ad > $__lasti)
60-
break
61+
set $__continue = 0
6162
end
6263
set $__li = $__li + *$__p
6364
set $__p = $__p + 1

0 commit comments

Comments
 (0)