[issue35132] python-gdb error: Python Exception <class 'RuntimeError'> Type does not have a target

Lisa Roach report at bugs.python.org
Mon Jan 21 19:40:36 EST 2019


Lisa Roach <lisaroach14 at gmail.com> added the comment:

I experienced this bug as well and have tried to dig into it a little. 

I experimented with a service I have that uses shared libraries. If I compile with high level of optimizations for the C++ code (-O3) I don't experience the issue, but compiling without any optimizations I do. 

I also tried with a script that does not use any shared libraries and I do not see the issue.


Digging into it a little, when running with the optimized version I found:

gdb.lookup_type('PyUnicodeObject')

returns a gdb.TYPE_CODE_TYPEDEF, which is the correct type. Running with the non-optimized version instead returns a gdb.TYPE_CODE_STRUCT.


The struct type errors because it has no target(), but I actually think target() might be superfluous here. 

Both versions if I only call `fields = gdb.lookup_type('PyUnicodeObject').fields()` returns a list of fields, one of which is named `data` for the purposes of the pep check, so target() doesn't seem vital.

----------
nosy: +lisroach

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35132>
_______________________________________


More information about the Python-bugs-list mailing list