GNOME Bugzilla – Bug 636387
gdb autoload files for glib and gobject both shadow the "dir" builtin
Last modified: 2010-12-03 19:41:38 UTC
http://git.gnome.org/browse/glib/tree/glib/libglib-gdb.py.in has: dir = '@datadir@/glib-2.0/gdb' if not dir in sys.path: sys.path.insert(0, dir) This assignment to "dir" shadows the "dir" builtin, making it more difficult to use python interactively within gdb. Easy fix: use "dir_" instead of "dir" c.f: attempting to debug my gdbheap module [1] when the inferior process is linked against glib: (gdb) python import gdbheap (gdb) python dir(gdbheap) Traceback (most recent call last):
+ Trace 224958
Error while executing Python code. (gdb) python print repr(dir) '/usr/share/glib-2.0/gdb' (see downstream report https://bugzilla.redhat.com/show_bug.cgi?id=621719 ) [1] https://fedorahosted.org/gdb-heap/
There's a similar problem here: http://git.gnome.org/browse/glib/tree/gobject/libgobject-gdb.py.in
Feel free to commit a fix
I don't think I have push rights; I haven't touched upstream gnome sources since CVS iirc.
Ok, pushed
Thanks - though it looks like you only fixed one of the two sites with the problem. http://git.gnome.org/browse/glib/commit/? id=807101272893f27469bb5c507c7967334a5a0b8e shows the fix for comment #1 (glib:gobject/libgobject-gdb.py.in) Please can you also do the analogous fix for comment #0 (glib:glib/libglib-gdb.py.in)?