gdb pretty printer throws python error: There is no member named keys.:
Submitted by Peter Wu
Link to original bug (#728980)
Description
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.
Version: 2.40.x