This is the mail archive of the
mailing list for the GDB project.
Re: thread debugging problem
- From: Michael Elizabeth Chastain <mec at shout dot net>
- To: ac131313 at redhat dot com, andwes-8 at student dot luth dot se
- Cc: gdb at sources dot redhat dot com
- Date: Mon, 15 Sep 2003 10:36:40 -0400
- Subject: 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.