Fix history crash (#2429)

* Fixed bug where history() crashes due to an history line with no command

* Added extra space in history()
pull/2433/head
Charles Fol 1 year ago committed by GitHub
parent 0a5e510fb6
commit 11c911eaf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1050,7 +1050,13 @@ class GDB(pwndbg.dbg_mod.Debugger):
parsed_lines = []
for line in lines:
number_str, command = line.split(maxsplit=1)
try:
number_str, command = line.split(maxsplit=1)
except ValueError:
# In rare cases GDB stores a number with no command, and the split()
# then only returns one element. We can safely ignore these.
continue
try:
number = int(number_str)
except ValueError:

Loading…
Cancel
Save