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 797283 - gst: add some gdb python macros
gst: add some gdb python macros
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-10-14 14:40 UTC by Michael Olbrich
Modified: 2018-11-03 12:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gst: add some gdb python macros (7.51 KB, patch)
2018-10-14 14:40 UTC, Michael Olbrich
reviewed Details | Review

Description Michael Olbrich 2018-10-14 14:40:00 UTC
Just some basic gdb pretty printer for GStreamer types.
Comment 1 Michael Olbrich 2018-10-14 14:40:06 UTC
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>
Comment 2 Thibault Saunier 2018-10-15 11:44:38 UTC
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.
Comment 3 Tim-Philipp Müller 2018-10-15 12:06:05 UTC
Ooc, does this have to live in gst/ or can be put it somewhere else? (a subdir or elsewhere in the tree)?
Comment 4 Michael Olbrich 2018-10-16 07:32:31 UTC
(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.
Comment 5 Michael Olbrich 2018-10-16 07:35:46 UTC
(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?
Comment 6 Sebastian Dröge (slomo) 2018-10-16 07:58:38 UTC
We have bash completion things somewhere, that seems like a good location
Comment 7 Mathieu Duponchelle 2018-10-16 10:39:52 UTC
(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
Comment 8 Michael Olbrich 2018-10-18 08:37:51 UTC
(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?
Comment 9 Thibault Saunier 2018-10-18 12:02:22 UTC
(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?
Comment 10 GStreamer system administrator 2018-11-03 12:48:55 UTC
-- 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.