I have encounter a problem using gdb to debug vlc.exe in windows environment. I follow the instruction on http://wiki.videolan.org/Win32Compile and successfully compiled and packaged VLC under linux.
The program is running fine and I got the symbol table in the project folder too. However I'm not able to let the gdb load the necessary symbol files to set up break point and stuff.
Under the vlc folder, the object file is listed under like
and the executable is stored in
"gdb vlc.exe" in Cygwin shell loads not much useful symbols.
I tried symbol-table command to load a specific symbol file. It loads file and I can see the function in the break prompt. But when I run the program I got the warning:
Cannot insert breakpoint 1.
Error accessing memory address 0x2800: Input/Output error.
Is there a way to feed gdb with the symbol files so that I can debug it like in linux environment?
Here's a little background if anyone's interested in why am I doing this.
I'm studying the VLC codebase about its wrap over DXVA2 interface. The project is pretty big and complex with lots of function pointers trying to mimic a C++ inheritance and encapsulation which makes it hard to understand.
My purpose is to step through the VLC source code on the DXVA2 (Microsoft DirectX Video Acceleration 2) h264 path, which only runs on windows platform. AFAIK vlc don't have a IDE project file that I could use for compile and debugging. I choose cross compilation because VLC website suggests it and I thought if I can get the symbol file, source code and the executable, I can debug it.
Help will be much appreciated. Thanks in advance.
I found out the solution.
gdb needs to know where to load the symbol file, which can be done using the path function or adding the symbol files location at path.
gdb also needs to know where to load the source file, which can be done directory function or specify when the program starts.
This is what I do:
Add this in my .bashrc file:
PATH=$PATH:[vlc proj folder] export PATH
Then start gdb like:
gdb `find [vlc proj folder] -type d -printf '-d %p '` vlc.exe