Workaround for GDB bug described in #632 (#633)

GDB's `up` and `down` commands trigger internal notification about
changed frame. It does not happen for `gdb.Frame.select()` which we use
in our own overrides for `up` and `down` commands.

Because of that, the `list` GDB command does not show proper source code
lines.

This can be worked around by firing `frame` command and this is what
this workaround/PR adds.

This bug has also been reported to GDB bugzilla at
https://sourceware.org/bugzilla/show_bug.cgi?id=24534
pull/637/head
Disconnect3d 7 years ago committed by Stuart Nevans Locke
parent 814b47881a
commit a729a82fe4

@ -54,6 +54,9 @@ def up(n=1):
f = f.older()
f.select()
# workaround for #632
gdb.execute('frame', to_string=True)
bt = pwndbg.commands.context.context_backtrace(with_banner=False)
print('\n'.join(bt))
@ -79,6 +82,9 @@ def down(n=1):
f = f.newer()
f.select()
# workaround for #632
gdb.execute('frame', to_string=True)
bt = pwndbg.commands.context.context_backtrace(with_banner=False)
print('\n'.join(bt))

Loading…
Cancel
Save