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 588141 - char *g_lookup_symbol (gpointer address)
char *g_lookup_symbol (gpointer address)
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: general
2.21.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2009-07-09 08:41 UTC by Benjamin Otte (Company)
Modified: 2013-02-03 05:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Benjamin Otte (Company) 2009-07-09 08:41:38 UTC
It would be nice to have a simple way to lookup functions inside glib. This would be most useful for producing debug output, like generating stack traces.
My ideal function for that is what I posted in the summary:

char *g_lookup_symbol (gpointer address);

I could hand it a function pointer and have it return a description that is as useful as possible, ideally something like "my_function() [myfile.c:1337]"
It can fall back to returning g_strdup_printf ("%p", address) on unsupported platforms easily.

Bug 588077 has a patch that contains code to practically implements it, however it depends on libbfd which is GPL3. I guess this is problematic.
Would conditionally compiling the libbfd code when --enable-debug=yes be a good idea for this?
Comment 1 Benjamin Otte (Company) 2009-07-09 08:46:53 UTC
Another option is to pull in a mini-bsd implementation, like the ones in use by sysprof or Chris Wilson's odin:
<ickle> sysprof memprof have one, but I prefer (I'm biased ;-) http://cgit.freedesktop.org/~ickle/odin/tree/src/minibfd
<ickle> and you have to remove demangle as that's GPLv2
<ickle> but the rest you are free to use under LPGL (even though they currently say GPLv3)
Comment 2 Matthias Clasen 2013-02-03 05:07:56 UTC
closing some old bugs