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

Skip to content

Commit 29848f0

Browse files
committed
#9919: fix off-by-one error in lineno command in Misc/gdbinit; also add newline to its output.
1 parent a9afb68 commit 29848f0

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Misc/gdbinit

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ define lineno
6161
set $__p = $__p + 1
6262
if ($__ad > $__lasti)
6363
set $__continue = 0
64+
else
65+
set $__li = $__li + *$__p
66+
set $__p = $__p + 1
6467
end
65-
set $__li = $__li + *$__p
66-
set $__p = $__p + 1
6768
end
68-
printf "%d", $__li
69+
printf "%d\n", $__li
6970
end
7071

7172
# print the current frame - verbose

0 commit comments

Comments
 (0)