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

Skip to content
Prev Previous commit
Next Next commit
Update gdbinit
  • Loading branch information
sobolevn authored Feb 22, 2023
commit 67a1c98e8d5ceb6e3cb8d2c9994955e224119ebf
20 changes: 1 addition & 19 deletions Misc/gdbinit
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,7 @@ end
# A rewrite of the Python interpreter's line number calculator in GDB's
# command language
define lineno
set $__continue = 1
set $__co = f->f_code
set $__lasti = f->f_lasti
set $__sz = ((PyVarObject *)$__co->co_lnotab)->ob_size/2
set $__p = (unsigned char *)((PyBytesObject *)$__co->co_lnotab)->ob_sval
set $__li = $__co->co_firstlineno
set $__ad = 0
while ($__sz-1 >= 0 && $__continue)
set $__sz = $__sz - 1
set $__ad = $__ad + *$__p
set $__p = $__p + 1
if ($__ad > $__lasti)
set $__continue = 0
else
set $__li = $__li + *$__p
set $__p = $__p + 1
end
end
printf "%d", $__li
printf "%d", f->f_lineno
Comment thread
sobolevn marked this conversation as resolved.
Outdated
end

define pyframev
Expand Down