Re: [gnome-love] Weird behaviour debugging with GDB



Elijah Newren wrote:
On Apr 10, 2005 3:20 PM, Jaap Haitsma <jaap haitsma org> wrote:

Hi,

I see sometimes see some weird behavior when I debug GNOME programs.
If I step trough some piece of sequential code without any loops or
jumps with the next command. The next instruction some times goes one back.
So if I had one instruction on each line I would expect gdb to go trough
the lines like this: 1, 2, 3, 4, 5, 6. What I see happening though is
something like this: 1, 2, 1, 2, 3, 4, 5, 6

Anybody knows why this is happening?


Sounds like you're trying to debug code that has been optimized (e.g.
compiled with '-O2').  It's much easier to debug code compiled without
such optimization flags.

Thanks, already thought of that. ;-) I just compiled with -g, or does that not disable all optimisation.

Jaap



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