This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Who's insane: gdb or I?


> On Wed, 3 Jul 2002, Bernd Jendrissek wrote:
>
> > Why did gdb tell me that the "OVERtime+=..." part happened several times
> > over?
>
> Because compiler optimizations move code around, so that the machine
> instructions generated for those two lines are interleaved.
>
> Simply get used to this.  I usually wait until the line shjown by GDB is
> after the one I'm interested in, and then print the relevant variables.

I get this all the time too so I usually debug code compiled without
optimization.  Unfortunately if you're chasing an optimization bug all bets
are off and, like Bernd said, you just have to get used to it.

cheers,

Kris


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]