Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Python exception under gdb-8.2-2 #523
I just recently updated gdb to 8.2-2 on Arch. Now pwndbg commands will trigger the warnings below:
pwndbg> pwndbg Python Exception <class 'ValueError'> invalid literal for int() with base 10: 'warning:': Error occurred in Python command: invalid literal for int() with base 10: 'warning:'
And gdb changelog mentioned various Python API enhancements.
Steps to reproduce
Hey, thanks for the issue. I will try to dive into that in a free time.
If you are willing to help, I would be happy to help/answer questions here or in #pwndbg freenode irc channel.
PS: from gdb changelog
def check_repeated(self, argument, from_tty): """Keep a record of all commands which come from the TTY. Returns: True if this command was executed by the user just hitting "enter". """ # Don't care unless it's interactive use if not from_tty: return False lines = gdb.execute('show commands', from_tty=False, to_string=True) lines = lines.splitlines() # No history if not lines: return False last_line = lines[-1]
But regular 'show commands' is ok???
This is stupid. Regression from gdb's side? Probably due to this changelog item:
This is gdb bug https://sourceware.org/bugzilla/show_bug.cgi?id=23669. It was caused by commit 56bcdbea2bed ("Let gdb.execute handle multi-line commands") in GDB.
Note that this commit broke other things in pwndbg as well. For example, all commands executed though
There's a really ugly hack to work around the
The other bug that is relevant for pwndbg is this one: https://sourceware.org/bugzilla/show_bug.cgi?id=23714. If you build from git, include the patch there and pwndbg should work with new gdb.
I still experience this issue on arch with up to date
lines = gdb.execute('show commands', from_tty=False, to_string=True) lines = lines.splitlines() # No history if not lines: return False last_line = lines[-1] number, command = last_line.split(None, 1) try: number = int(number) except ValueError: # Fixes gdb bug when show command fails return False
referenced this issue
Dec 9, 2018
gdb 8.2.1 has been released: http://lists.gnu.org/archive/html/info-gnu/2018-12/msg00013.html