Need help on running VLC under gdb
Posted: 21 May 2006 11:32
Hi everyone!
Hope someone can help me or point in a right direction
I study how VLC works and as one of the things I'm trying to run VLC under gdb. Here I'm experiencing problem because don't have much exprerience with gdb.
VLC at some point runs into several threads and this is exactly where I lose a control over the VLC. For example, I found a function VLC_VolumeMute that should be executed when user clicks Mute icon in gui. I set a breakpoint and run VLC under gdb:
(gdb) break VLC_VolumeMute
Breakpoint 1 at 0x805983f: file libvlc.c, line 1859.
(gdb) run
Starting program: /home/user/VLC/vlc-0.8.5/vlc
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 16437)]
VLC media player 0.8.5 Janus
[New Thread 32769 (LWP 16438)]
[New Thread 16386 (LWP 16439)]
[New Thread 32771 (LWP 16440)]
[New Thread 49156 (LWP 16441)]
[New Thread 65541 (LWP 16442)]
[New Thread 81926 (LWP 16443)]
However, cliking on Mute icon in running instance of VLC does stop the program under gdb. As far as I understand, it is somehow related to the fact that breakpoint should be set in a right thread or something like this.
Program received signal SIGINT, Interrupt.
[Switching to Thread 81926 (LWP 16443)]
0x40041456 in nanosleep () from /lib/libpthread.so.0
(gdb) info threads
* 7 Thread 81926 (LWP 16443) 0x40041456 in nanosleep () from /lib/libpthread.so.0
6 Thread 65541 (LWP 16442) 0x40041456 in nanosleep () from /lib/libpthread.so.0
5 Thread 49156 (LWP 16441) 0x40041456 in nanosleep () from /lib/libpthread.so.0
4 Thread 32771 (LWP 16440) 0x40041456 in nanosleep () from /lib/libpthread.so.0
3 Thread 16386 (LWP 16439) 0x40041456 in nanosleep () from /lib/libpthread.so.0
2 Thread 32769 (LWP 16438) 0x40230ada in poll () from /lib/libc.so.6
1 Thread 16384 (LWP 16437) 0x40230ada in poll () from /lib/libc.so.6
Seems that thread 1 is a right place:
(gdb) thread 1
[Switching to thread 1 (Thread 16384 (LWP 16437))]#0 0x40230ada in poll () from /lib/libc.so.6
(gdb) bt
#0 0x40230ada in poll () from /lib/libc.so.6
#1 0x408e71e6 in wxapp_poll_func () from /usr/local/lib/libwx_gtk2_core-2.6.so.0
#2 0x412202b6 in g_main_loop_get_context () from /usr/lib/libglib-2.0.so.0
#3 0x4121f8b0 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#4 0x4121fed3 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#5 0x40f04bb3 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#6 0x40902368 in wxEventLoop::Run () from /usr/local/lib/libwx_gtk2_core-2.6.so.0
#7 0x40999875 in wxAppBase::MainLoop () from /usr/local/lib/libwx_gtk2_core-2.6.so.0
#8 0x409999da in wxAppBase::OnRun () from /usr/local/lib/libwx_gtk2_core-2.6.so.0
#9 0x40c7bf3e in wxEntry () from /usr/local/lib/libwx_base-2.6.so.0
#10 0x4046bd6b in Init (p_intf=0xfffffffc) at wxwidgets.cpp:323
#11 0x0805afae in RunInterface (p_intf=0x84bda60) at interface/interface.c:394
#12 0x0805ab7e in intf_RunThread (p_intf=0x84bda60) at interface/interface.c:222
#13 0x080599b9 in AddIntfInternal (i_object=0, psz_module=0x1 <Address 0x1 out of bounds>,
b_block=1, b_play=1, i_options=-4, ppsz_options=0xfffffffc) at libvlc.c:1945
#14 0x080583c2 in VLC_AddIntf (i_object=-4,
psz_module=0xfffffffc <Address 0xfffffffc out of bounds>, b_block=-4, b_play=-4)
at libvlc.c:859
#15 0x0804baa4 in main (i_argc=-4, ppsz_argv=0xfffffffc) at src/vlc.c:109
However, setting breakpoint on VLC_VolumeMute in this thread doesn't help.
Could someone help to me how to follow execution of VLC under gdb, how to stop under gdb, for example, on clicking on Mute icon?
Thank you in advance.
Here is some info that might be usefull:
VLC 0.8.5
Debian 3.1 (2.4.27-2-686)
GCC 3.3.5
GDB 6.3
Hope someone can help me or point in a right direction
I study how VLC works and as one of the things I'm trying to run VLC under gdb. Here I'm experiencing problem because don't have much exprerience with gdb.
VLC at some point runs into several threads and this is exactly where I lose a control over the VLC. For example, I found a function VLC_VolumeMute that should be executed when user clicks Mute icon in gui. I set a breakpoint and run VLC under gdb:
(gdb) break VLC_VolumeMute
Breakpoint 1 at 0x805983f: file libvlc.c, line 1859.
(gdb) run
Starting program: /home/user/VLC/vlc-0.8.5/vlc
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 16437)]
VLC media player 0.8.5 Janus
[New Thread 32769 (LWP 16438)]
[New Thread 16386 (LWP 16439)]
[New Thread 32771 (LWP 16440)]
[New Thread 49156 (LWP 16441)]
[New Thread 65541 (LWP 16442)]
[New Thread 81926 (LWP 16443)]
However, cliking on Mute icon in running instance of VLC does stop the program under gdb. As far as I understand, it is somehow related to the fact that breakpoint should be set in a right thread or something like this.
Program received signal SIGINT, Interrupt.
[Switching to Thread 81926 (LWP 16443)]
0x40041456 in nanosleep () from /lib/libpthread.so.0
(gdb) info threads
* 7 Thread 81926 (LWP 16443) 0x40041456 in nanosleep () from /lib/libpthread.so.0
6 Thread 65541 (LWP 16442) 0x40041456 in nanosleep () from /lib/libpthread.so.0
5 Thread 49156 (LWP 16441) 0x40041456 in nanosleep () from /lib/libpthread.so.0
4 Thread 32771 (LWP 16440) 0x40041456 in nanosleep () from /lib/libpthread.so.0
3 Thread 16386 (LWP 16439) 0x40041456 in nanosleep () from /lib/libpthread.so.0
2 Thread 32769 (LWP 16438) 0x40230ada in poll () from /lib/libc.so.6
1 Thread 16384 (LWP 16437) 0x40230ada in poll () from /lib/libc.so.6
Seems that thread 1 is a right place:
(gdb) thread 1
[Switching to thread 1 (Thread 16384 (LWP 16437))]#0 0x40230ada in poll () from /lib/libc.so.6
(gdb) bt
#0 0x40230ada in poll () from /lib/libc.so.6
#1 0x408e71e6 in wxapp_poll_func () from /usr/local/lib/libwx_gtk2_core-2.6.so.0
#2 0x412202b6 in g_main_loop_get_context () from /usr/lib/libglib-2.0.so.0
#3 0x4121f8b0 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#4 0x4121fed3 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#5 0x40f04bb3 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#6 0x40902368 in wxEventLoop::Run () from /usr/local/lib/libwx_gtk2_core-2.6.so.0
#7 0x40999875 in wxAppBase::MainLoop () from /usr/local/lib/libwx_gtk2_core-2.6.so.0
#8 0x409999da in wxAppBase::OnRun () from /usr/local/lib/libwx_gtk2_core-2.6.so.0
#9 0x40c7bf3e in wxEntry () from /usr/local/lib/libwx_base-2.6.so.0
#10 0x4046bd6b in Init (p_intf=0xfffffffc) at wxwidgets.cpp:323
#11 0x0805afae in RunInterface (p_intf=0x84bda60) at interface/interface.c:394
#12 0x0805ab7e in intf_RunThread (p_intf=0x84bda60) at interface/interface.c:222
#13 0x080599b9 in AddIntfInternal (i_object=0, psz_module=0x1 <Address 0x1 out of bounds>,
b_block=1, b_play=1, i_options=-4, ppsz_options=0xfffffffc) at libvlc.c:1945
#14 0x080583c2 in VLC_AddIntf (i_object=-4,
psz_module=0xfffffffc <Address 0xfffffffc out of bounds>, b_block=-4, b_play=-4)
at libvlc.c:859
#15 0x0804baa4 in main (i_argc=-4, ppsz_argv=0xfffffffc) at src/vlc.c:109
However, setting breakpoint on VLC_VolumeMute in this thread doesn't help.
Could someone help to me how to follow execution of VLC under gdb, how to stop under gdb, for example, on clicking on Mute icon?
Thank you in advance.
Here is some info that might be usefull:
VLC 0.8.5
Debian 3.1 (2.4.27-2-686)
GCC 3.3.5
GDB 6.3