GNOME Bugzilla – Bug 728980
gdb pretty printer throws python error: There is no member named keys.:
Last modified: 2018-05-24 16:28:28 UTC
At least the GHashTable is an incomplete type. This breaks the GDB pretty printer which does not know the fields of the struct. Result: the pretty printer throws a GDB error and is pretty much useless. Tested with GDB 7.7 on Arch Linux $ cat > n.c <<EOF #include <glib.h> int main() { GHashTable *ht; ht = g_hash_table_new(g_str_hash, g_str_equal); g_hash_table_insert(ht, "foo", "bar"); g_hash_table_insert(ht, "ffs", "omg"); return 0; } EOF $ gcc $(pkg-config --cflags glib-2.0) n.c -g $(pkg-config --libs glib-2.0) $ gdb -q -ex 'break 9' -ex r -ex 'p ht' -ex c -ex q ./a.out ... Breakpoint 1, main () at n.c:9 9 return 0; Python Exception <class 'gdb.error'> There is no member named keys.: $1 = 0x602000 Continuing.
Rebuilding glib2 with debugging symbols makes the pretty printer work again. The python code should probably consider that.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/863.