On Tue, 25 Nov 2008 15:36:39 -0500, Gabi Voiculescu <[EMAIL PROTECTED]> wrote: > I want to better understand how the autodetection mechanism works in the > ffmpeg libraries. > > For this I plan to use gdb to step through ffplay.c or > http://www.dranger.com/ffmpeg/tutorial02.c. [...] > As I understand, when I build the ffplay.g file contains the debug > symbols necessary for interacting with gdb. Is this true or do I have to > modify the compile -g flag myself in the build system?Can you tell me if > I need to modify the ffmpeg build system to open up the application > directly in gdb?
Just add --disable-optimizations (hm, and --disable-mmx) and --disable-stripping to your configure command, then rebuild. You should then be able to run gdb on any binary it produces and do line-by-line debugging. Should be as simple as "gdb ffplay". If you install to a special path (you don't want this unoptimized copy to overwrite your real copy!), you need to do a little more work. here's what I do: $ rm -r ~/builds/ffmpeg && mkdir ~/builds/ffmpeg && cd ~/builds/ffmpeg $ ~/src/ffmpeg/configure --enable-shared --disable-static --prefix=~/buildenv --disable-optimizations --disable-mmx --disable-stripping $ make install $ LD_LIBRARY_PATH=~/buildenv/lib gdb --args ffplay ~/media/video/Hellsing/Hellsing\ ep\ 01\ -\ The\ undead.ogm (gdb) b main (gdb) r Those last two are the commands I give to gdb to add a breakpoint to the first line of ffplay, and the second runs it. I then use "n" (next) and "s" (step) list code with "l" and print variable contents with "p varname". You don't really need "--disable-optimizations", but it helps by making each line of source code happen in the order it was written. With optimizations turned on, the assembly generated by one line of code will get mixed in with others, and you'll see a very confusing trace as gdb jumps back and forth between lines of code. As I tested this, I found that it won't compile when given --disable-optimizations unless I also disable mmx. -- Michael Conrad IntelliTree Solutions llc. 513-552-6362 [EMAIL PROTECTED] _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
