From a729a82fe44be9d0f9bb1ad1e732ee8c4fd6b7f5 Mon Sep 17 00:00:00 2001 From: Disconnect3d Date: Wed, 8 May 2019 07:00:45 +0200 Subject: [PATCH] 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 --- pwndbg/commands/ida.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pwndbg/commands/ida.py b/pwndbg/commands/ida.py index 26a28259c..e718b5fee 100644 --- a/pwndbg/commands/ida.py +++ b/pwndbg/commands/ida.py @@ -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))