thread debugging problem
Michael Elizabeth Chastain
mec@shout.net
Mon Sep 15 14:36:00 GMT 2003
aw> I've switched to redhat9 and now I get thread info, but I'm having other
aw> problems instead. Strange behaviour which I believe shouldn't happen.
aw> When I step forward in the code it seems to be running into somekind of
aw> loop running the same lines of code several times when it shouldn't, as
aw> you can see in the gdb session below. This is with gdb 5.3.91 but I saw
aw> the same behaviour with 5.3 on my gentoo box at home.
This is normal gdb behavior when the code is optimized
(compiled with -O or -O1 or -O2 or -O3). The compiler interleaves
instructions from different source lines to improve performance.
You can get used to it, which takes a few days, or you can
compile your code with -O0 and get simpler "next" behavior
at the cost of more object code.
Michael C
More information about the Gdb
mailing list