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: thread debugging problem


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


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