From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA] unexpected multiple location for breakpoint
Date: Tue, 28 Dec 2010 11:50:00 -0000 [thread overview]
Message-ID: <20101228112546.GB2436@adacore.com> (raw)
In-Reply-To: <20101210122337.GC2596@adacore.com>
> So, if I understand you well, you suggest that we rework a bit the
> "contained-in" elimination loop to avoid lowest-address assumptions.
> If 2 different PCs are inside the same block, then keep the lowest
> address. If PC1 is in BLOCK1 and PC2 in BLOCK2, and BLOCK2 is contained
> in BLOCK1, then PC2 should be discarded, even if PC2 > PC1. (and
> if the blocks are distinct, then keep both PCs).
Answering myself, I have another situation, which is a bit unrelated,
but could still be interesting in this discussion:
The source itself is a while loop
52. while CONDITION loop
53. Do_Something (...);
[some other code]
71. delay Random_Time;
72. end loop;
We are trying to break on line 53.
This source was compiled at -O1, and part of line 53 got hoisted outside
of the actual loop. The rest of line 53 is scattered around the rest
of the code in the actual loop. Something like this:
// line 53
[...]
// line 56, 62
[...]
//line 53:
cmp ...
.LL40:
[...]
// line 53:
[...]
(snip)
// end of loop
cmp ...
jmpne .LL40
As a user, we're expecting the debugger to stop on line 53 at every
iteration. But because we only break on the first instance of line 53,
and because that first instance is outside the actual loop, we end up
stopping only once.
(there are some lexical blocks in the assembly code I'm looking at,
but nothing significant to line 53, I believe).
According to you, bug or feature?
From a user's perspective, I think it is hard to accept this as normal
or expected, since a few "next" operations instead of a "continue" shows
that the debugger gets back to line 53 several times during the loop
execution. If this is a bug, then the only solution I can think of is
inserting a breakpoint at *every* instances of line 53, regardless of
lexical-block relationships.
Thoughts?
--
Joel
next prev parent reply other threads:[~2010-12-28 11:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-23 1:10 Joel Brobecker
2010-11-26 17:29 ` Joel Brobecker
2010-11-27 18:35 ` Daniel Jacobowitz
2010-12-10 12:23 ` Joel Brobecker
2010-12-28 11:50 ` Joel Brobecker [this message]
2010-12-28 20:15 ` Eli Zaretskii
2010-12-29 6:08 ` Joel Brobecker
2010-12-29 8:08 ` Joel Brobecker
2010-12-29 19:30 ` Eli Zaretskii
2010-12-30 20:40 ` Joel Brobecker
2010-12-30 21:03 ` Eli Zaretskii
2010-12-31 6:35 ` Michael Snyder
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=20101228112546.GB2436@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/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