-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python-gdb.py fails with TypeError("'FakeRepr' object is not subscriptable") is gdb fails to read debug symbols #79170
Comments
On Fedora 28, gdb fails to read (some?) debug symbols: In this case, the "py-bt" command of python-gdb.py fails with a TypeError: (gdb) py-bt
Traceback (most recent call first):
<unknown at remote 0x7ffff7e5f7e0>
Python Exception <class 'TypeError'> 'FakeRepr' object is not subscriptable:
Error occurred in Python command: 'FakeRepr' object is not subscriptable python-gdb.py shouldn't fail on such case, but handle the error. Attached PR fix this issue. |
The bug can be reproduced using this change: diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index bf4047419e..f973d4d4bd 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -402,6 +402,7 @@ class PyObjectPtr(object):
the pointer accordingly.
'''
try:
+ raise RuntimeError
p = PyObjectPtr(gdbval)
cls = cls.subclass_from_type(p.type())
return cls(gdbval, cast_to=cls.get_gdb_type()) (Don't forget to run "make" again to copy Tools/gdb/libpython.py to python-gdb.py.) |
Thanks Łukasz Langa for the review! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: