GNOME Bugzilla – Bug 797283
gst: add some gdb python macros
Last modified: 2018-11-03 12:48:55 UTC
Just some basic gdb pretty printer for GStreamer types.
Created attachment 373925 [details] [review] gst: add some gdb python macros This adds gdb pretty printer for some GStreamer types. For GstObject pointers the type and name is added, e.g. "0x5555557e4110 [GstDecodeBin|decodebin0]". For GstMiniObject pointers the object type is added, e.g. "0x7fffe001fc50 [GstBuffer]". For GstClockTime and GstClockTimeDiff the time is also printed in human readable form, e.g. "150116219955 [+0:02:30.116219955]". Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Review of attachment 373925 [details] [review]: Looks good overall but I could not get it working without hacks, also it would be great to have it working in a `gst-build` uninstalled env (just need to slitgly adapt PYTHONPATH there, I can do it). ::: gst/gst_gdb.py @@ +5,3 @@ +try: + GLIB_FOUND = True + from gobject_gdb import g_type_to_name, g_type_name_from_instance Here `gobject_gdb` is not in PYTHONPATH ever, any idea why? @@ +7,3 @@ + from gobject_gdb import g_type_to_name, g_type_name_from_instance + +except: Be explicit about the catched exception type.
Ooc, does this have to live in gst/ or can be put it somewhere else? (a subdir or elsewhere in the tree)?
(In reply to Thibault Saunier from comment #2) > Review of attachment 373925 [details] [review] [review]: > > Looks good overall but I could not get it working without hacks, also it > would be great to have it working in a `gst-build` uninstalled env (just > need to slitgly adapt PYTHONPATH there, I can do it). > > ::: gst/gst_gdb.py > @@ +5,3 @@ > +try: > + GLIB_FOUND = True > + from gobject_gdb import g_type_to_name, g_type_name_from_instance > > Here `gobject_gdb` is not in PYTHONPATH ever, any idea why? Right, this only works if gst_gdb.py is in the same directory as gobject_gst.py from glib. I'm not really happy with this solution. I'd like to reuse the helper functions but they are not really public. Maybe I should just copy them for now. > @@ +7,3 @@ > + from gobject_gdb import g_type_to_name, g_type_name_from_instance > + > +except: > > Be explicit about the catched exception type. ok.
(In reply to Tim-Philipp Müller from comment #3) > Ooc, does this have to live in gst/ or can be put it somewhere else? (a > subdir or elsewhere in the tree)? Anywhere is fine. Using gst/ was pretty arbitrary and easier than a new subdir. Any preference?
We have bash completion things somewhere, that seems like a good location
(In reply to Sebastian Dröge (slomo) from comment #6) > We have bash completion things somewhere, that seems like a good location libs/gst/helpers
(In reply to Mathieu Duponchelle from comment #7) > (In reply to Sebastian Dröge (slomo) from comment #6) > > We have bash completion things somewhere, that seems like a good location > > libs/gst/helpers I can move it there. Any preferences concerning the dependency on the glib stuff?
(In reply to Michael Olbrich from comment #8) > (In reply to Mathieu Duponchelle from comment #7) > > (In reply to Sebastian Dröge (slomo) from comment #6) > > > We have bash completion things somewhere, that seems like a good location > > > > libs/gst/helpers > > I can move it there. > > Any preferences concerning the dependency on the glib stuff? I would open a bug in GLib to see if they can make it public and meanwhile keep our own copy, what do you think?
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org'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.freedesktop.org/gstreamer/gstreamer/issues/320.