From: Pedro Alves <pedro@codesourcery.com>
To: gdb@sourceware.org
Cc: Peter Toft <pto@linuxbog.dk>
Subject: Re: Single stepping a simple C-program, but...
Date: Tue, 20 May 2008 11:05:00 -0000 [thread overview]
Message-ID: <200805201205.35865.pedro@codesourcery.com> (raw)
In-Reply-To: <eb054e10edfbbf004c0c1b0cf951bbcf@petertoft.dk>
A Tuesday 20 May 2008 08:11:20, Peter Toft wrote:
> Pedro - your mail is very interesting and very illustrative.
> To be 100% sure that I understand you, and "problem" that we get a line
> counter increment of -1 from 8 to 7 above
> comes from gcc i.e. gdb does the right thing. Do we agree?
Yes. GDB shows the user what the debug info tells it to.
> Then the question is why gcc does this?!
I don't know.
Based on what I see, the bug is that at -O0, if the predicate
involves subexpressions, the jump at the end of the then block
is attributed to the expression line, while it should be attributed
to the same line as the last statement of the then block -- if that
were so, stepping over the printf call in your example would only
stop at line 12, as expected.
--
Pedro Alves
next prev parent reply other threads:[~2008-05-20 11:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-19 20:19 Peter Toft
2008-05-19 20:39 ` Daniel Jacobowitz
2008-05-20 7:19 ` Peter Toft
2008-05-19 20:48 ` Pedro Alves
2008-05-19 22:39 ` Pedro Alves
2008-05-20 7:11 ` Peter Toft
2008-05-20 11:05 ` Pedro Alves [this message]
2008-05-20 18:33 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200805201205.35865.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb@sourceware.org \
--cc=pto@linuxbog.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox