Some examples

James Oakley jfunk at roadrunner.nf.net
Fri Sep 3 19:00:23 BST 1999


Jacek Wojdel wrote:

> I compiled it with options -g3 -O3 and started debugger (at work I use XEmacs
> as a front-end, but this shoudn't matter to the way the gdb works). When doing
> step-by-step execution the line number 9 is never visited. Even if you set the
> breakpoint on that line, the execution will stop at line 10. When compiling
> with -O0, the line #9 is normally visited. Of course for some more complicated
> programs the results of optimizations can be more "twisted" which results in
> seemingly random jumping over some statements. If you really don't experience
> such behavior, I'd like to know which versions of gcc/g++/gdb you use... and
> upgrade, upgrade, UPGRADE !!! :)

Hey, you're right. I just tried it. That's pretty strange because I had
no trouble with a much larger program I used KDevelop for... Maybe it
occurred in some other part of the program I didn't debug. I guess I got
lucky. I used functions from linux/include/asm-386/io.h which required
at minimum -O1 to work.

I'm not sure where, but I read something about how debugging with
optimisations in g++ worked. Maybe it simply works 'better'.

I'm not going to trust that anymore...

JFunk



More information about the KDevelop mailing list