GDB libVLC

This forum is about all development around libVLC.
MCyr
Blank Cone
Blank Cone
Posts: 21
Joined: 07 Aug 2009 16:07
VLC version: 1.1.0-git
Operating System: Linux

GDB libVLC

Postby MCyr » 28 Sep 2009 20:43

Hi all,
I'm having troubles debugging a libVLC module (invmem). I compiled VLC from git with --enable-debug. When I run my program, I have a segfault and I don't know how to debug it.

Code: Select all

[0x7fffe800a870] mux_ts mux debug: adding input codec=mpgv pid=68 [0x7fffe800a870] mux_ts mux debug: new PCR PID is 68 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffee9ca910 (LWP 7340)] 0x0000000000000021 in ?? () (gdb) info stack #0 0x0000000000000021 in ?? () #1 0x00007fffee6c9047 in DecodeBlock () from /usr/lib64/vlc/codec/libinvmem_plugin.so #2 0x00007fffefdfba6e in Send () from /usr/lib64/vlc/stream_out/libstream_out_transcode_plugin.so
How can I load the source associated with libinvmem_plugin.so (invmem.c in modules/codec) so I can add breaks, and even see what line number is giving me a segfault (0x21 isn't obvious to me...)?

Thanks

Rémi Denis-Courmont
Developer
Developer
Posts: 15279
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: GDB libVLC

Postby Rémi Denis-Courmont » 29 Sep 2009 17:23

The plugin is loaded already...
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

MCyr
Blank Cone
Blank Cone
Posts: 21
Joined: 07 Aug 2009 16:07
VLC version: 1.1.0-git
Operating System: Linux

Re: GDB libVLC

Postby MCyr » 29 Sep 2009 18:06

Yeah sorry, I seem to have made a stupid mistake. I had conflicting libs installed, a set with --enable-debug and another one without. I forgot to put --libdir=/usr/lib64, so my debug enabled libs were in /usr/lib, and thus not loaded.

Btw, if anyone stumbles on something similar, as a general answer, check if the configure script supports something like --enable-debug. You can check if your libs include all the necessary debugging symbols using nm. Something like nm -l /usr/lib64/libsomething.so should show what source files and lines match a given function. If the lib do include those debugging symbols, then simply doing break sourcefile.c:line # will tell gdb to break, when it loads the associated library, on the equivalent of the source line number.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 32 guests