fix: update_length() raise exception in some cases

This is the case:
```
pwndbg> show print elements
Limit on string chars or array elements to print is 200.
warning: (Internal error: pc 0x7ffff49ef495 in read in CU, but not in symtab.)
warning: (Internal error: pc 0x7ffff49ef495 in read in CU, but not in symtab.)
warning: (Internal error: pc 0x7ffff49ef495 in read in CU, but not in symtab.)
warning: (Internal error: pc 0x7ffff49ef495 in read in CU, but not in symtab.)
Exception occurred: Error: invalid literal for int() with base 10: 'symtab.)' (<class 'ValueError'>)
For more info invoke `set exception-verbose on` and rerun the command
or debug it by yourself with `set exception-debugger on`
Python Exception <class 'ValueError'> invalid literal for int() with base 10: 'symtab.)':
```

If we call `message = message.split()[-1]`, we get `symtab.)`.
Then `length = int(message)` raise an Exception.
pull/928/head
veritas501 5 years ago committed by Disconnect3d
parent 30d6745796
commit 8db8f4d25a

@ -25,7 +25,7 @@ def update_length():
"""
global length
message = gdb.execute('show print elements', from_tty=False, to_string=True)
message = message.split()[-1]
message = message.split('\n')[0].split()[-1]
message = message.strip('.')
if message == 'unlimited':
length = 0

Loading…
Cancel
Save