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 595619 - Include gdb pretty printers
Include gdb pretty printers
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2009-09-18 19:06 UTC by Alexander Larsson
Modified: 2009-09-21 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initial support for gdb python macros (14.21 KB, patch)
2009-09-18 19:07 UTC, Alexander Larsson
none Details | Review

Description Alexander Larsson 2009-09-18 19:06:45 UTC
Recent gdb versions allow you to write auto-loading python macros that do things like pretty printing and backtrace filtering. Having a basic set of such macros shipping with glib would be nice.

I started this, adding runtime type info to gobject pointers and signal emission backtrace cleanup. For example:

(gdb) new-backtrace 
  • #0 gtk_widget_size_allocate
    at gtkwidget.c line 3821
  • #6 gtk_widget_size_allocate
    at gtkwidget.c line 3887
  • #12 gtk_widget_size_allocate
    at gtkwidget.c line 3887
  • #13 gtk_window_move_resize
    at gtkwindow.c line 6186
  • #19 gtk_container_idle_sizer
    at gtkcontainer.c line 1350
  • #20 gdk_threads_dispatch
    at gdk.c line 506
  • #21 g_main_dispatch
    at gmain.c line 1960
  • #22 g_main_context_dispatch
    at gmain.c line 2513
  • #23 g_main_context_iterate
    at gmain.c line 2591
  • #24 g_main_loop_run
    at gmain.c line 2799
  • #25 gtk_main
    at gtkmain.c line 1205
  • #26 main
    at gedit.c line 698

This is using the gdb shipping with Fedora 11. This gets even better if the gcc from Fedora 12 is used as the VTA stuff in that makes debug info more reliable.
Comment 1 Alexander Larsson 2009-09-18 19:07:45 UTC
Created attachment 143466 [details] [review]
Initial support for gdb python macros

This includes support for gobject pointer pretty printing and
signal frame compression in backtraces.
Comment 2 Matthias Clasen 2009-09-18 19:40:54 UTC
Looks like a very useful thing, and doesn't affect the rest of glib at all, so I'm all for it. One thing I would ask for is that you add a paragraph or two to docs/reference/glib/running.sgml explaining what this is, how one uses it, and what gdb version is required to use it.
Comment 3 Alexander Larsson 2009-09-21 13:39:39 UTC
commited with additions and some docs, will blog about this to tell people about it.