[Ffmpeg-devel] Re: [BUG] Compilation failure when using --disable-opts

Måns Rullgård mans
Fri Mar 16 10:30:03 CET 2007

Rich Felker <dalias at aerifal.cx> writes:

> On Fri, Mar 16, 2007 at 12:38:28AM +0000, M?ns Rullg?rd wrote:
>> >> some vain hope to spot the point where things go wrong.  Debuggers
>> >> can also interfere with the execution, especially timing, in ways that
>> >> might cause the bug to never manifest itself.
>> > This is IMHO the most problematic thing with debuggers. But if timing
>> > isn't concerned debuggers are useful (again IMHO).
>> As I said, you are entitled to your opinion.  I still say that 99% of
>> what can be done with a debugger can be done more easily with printf.
>> For the remaining 1% I'll happily use a debugger.  It's all about
>> using the appropriate tool for the job.
> For what it's worth, I find debuggers useful only for tracking down
> obscure (usually due to nonportable assumptions.. grrrr) bugs in
> poorly documented code written by other people. If the code is
> something I've written or that I'm familiar with or can easily become
> familiar with, printf almost always wins for me.

I encountered a good example of that recently.  Some code at work was
misbehaving on ARM targets but worked fine on some others.  Knowing
that of the targets in questions, ARM was the only one not allowing
unaligned accesses, I suspected an unaligned access might be the cause
of the problem.  I set the CPU to trap on any unaligned access and put
a breakpoint at the trap handler.  Sure enough, it trapped and the
problem could easily be fixed.

Simply reading the code and thinking about it for a bit is another
approach I've found useful at times.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list