[3.9] bpo-45838: Fix incorrect line numbers in Tools/gdb/libpython.py (GH-29628)

The line number calculation in libpython.py did not properly handle
negative (signed) line table deltas.
This commit is contained in:
Sam Gross 2021-11-19 13:53:46 -05:00 committed by GitHub
parent 4296396db0
commit 2a32dbf110
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 1 deletions

View file

@ -659,7 +659,10 @@ def addr2line(self, addrq):
addr += ord(addr_incr)
if addr > addrq:
return lineno
lineno += ord(line_incr)
line_delta = ord(line_incr)
if line_delta >= 128:
line_delta -= 256
lineno += line_delta
return lineno