After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728980 - gdb pretty printer throws python error: There is no member named keys.:
gdb pretty printer throws python error: There is no member named keys.:
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: general
2.40.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-04-25 20:56 UTC by Peter Wu
Modified: 2018-05-24 16:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Peter Wu 2014-04-25 20:56:07 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.
Comment 1 Peter Wu 2014-04-25 21:16:40 UTC
Rebuilding glib2 with debugging symbols makes the pretty printer work again. The python code should probably consider that.
Comment 2 GNOME Infrastructure Team 2018-05-24 16:28:28 UTC
-- 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.