Message263690
Trying to use any kind of python gdb integration results in the following error:
(gdb) py-bt
Traceback (most recent call first):
Python Exception <class 'gdb.error'> Invalid cast.:
Error occurred in Python command: Invalid cast.
I have tracked it down to the _type_... globals, and I am able to fix it with the following commands:
(gdb) pi
>>> # Look up the gdb.Type for some standard types:
... _type_char_ptr = gdb.lookup_type('char').pointer() # char*
>>> _type_unsigned_char_ptr = gdb.lookup_type('unsigned char').pointer() # unsigned char*
>>> _type_void_ptr = gdb.lookup_type('void').pointer() # void*
>>> _type_unsigned_short_ptr = gdb.lookup_type('unsigned short').pointer()
>>> _type_unsigned_int_ptr = gdb.lookup_type('unsigned int').pointer()
After this, it works correctly. I was able to workaround it by making a fix_globals that resets the globals on each gdb.Command. I do not understand why the originally initialized types are not working properly. It feels like gdb-inception trying to debug python within a gdb that debugs cpython while executing python code.
I have tried this using hg/default cpython (--with-pydebug --without-pymalloc --with-valgrind --enable-shared)
1) System install of gdb 7.11, linked against system libpython 3.5.1.
2) Custom install of gdb 7.11.50.20160411-git, the debug cpython I am trying to debug |
|
Date |
User |
Action |
Args |
2016-04-18 21:10:40 | tilsche | set | recipients:
+ tilsche |
2016-04-18 21:10:40 | tilsche | set | messageid: <1461013840.26.0.744881925452.issue26799@psf.upfronthosting.co.za> |
2016-04-18 21:10:40 | tilsche | link | issue26799 messages |
2016-04-18 21:10:40 | tilsche | create | |
|