[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [22.1.90]: Point before start of properties

From: Eli Zaretskii
Subject: Re: [22.1.90]: Point before start of properties
Date: Wed, 20 Feb 2008 21:40:13 +0200

> From: Stefan Monnier <address@hidden>
> Date: Wed, 20 Feb 2008 12:17:01 -0500
> Cc: address@hidden, Chong Yidong <address@hidden>
> Whenever I have to debug optimized code, I tend to rely a lot on good'ol
> fprintf (stderr, ...), so try to add a few such printfs just before
> calling `error', where you print things like `i', i->up.interval,
> i->up_obj, ...

So 20 years after GCC was a pioneer of the idea that it should be
possible to debug optimized code, we are back at printf debugging
because GCC developers no longer think it's important enough.
Progress, indeed...

To Simon: if compiling with -O1 does not give you reasonably
debuggable code, you may wish to look at the machine code at the
offending places.  For example, you might find out that, while
"p (((i)->up_obj || (i)->up.interval == 0))" yields zero, the real
values of up_obj and/or up.interval are loaded in registers, and thus
the condition does fire.  Although I find this rather surprising for

Btw, I'd also suggest to try "-ggdb -g3" instead of just -g, it should
cause GCC to produce more elaborate debug info, and could help you
discover real values of variables.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]