From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA] unexpected multiple location for breakpoint
Date: Fri, 26 Nov 2010 17:29:00 -0000 [thread overview]
Message-ID: <20101126172942.GK2634@adacore.com> (raw)
In-Reply-To: <1290474625-1582-1-git-send-email-brobecker@adacore.com>
> + We start from last to first in our list of PCs, in order to take
> + care of the case where 2 entries are associated to the same block:
> + When we have one or more lines in the same block, we want to stop
> + at the first instruction of that line, hence we want to eliminate
> + the highest address. */
> +
> + for (i = ret.nelts - 1; i >= 0; i--)
> if (blocks[i] != NULL)
> - for (j = i+1; j < ret.nelts; ++j)
> - if (blocks[j] == blocks[i])
> + for (j = 0; j < ret.nelts; ++j)
> + if (j != i && filter[j] && contained_in (blocks[i], blocks[j]))
About this patch - Doug and I had a quick talk about on IRC, and one
of the things I said was that the items in the SAL list should be
ordered by ascending PC. I'm not sure that's true anymore. This is
true within a linetable, but the array is a collection of entries
for potentially more than 1 unit. So that assumption was wrong.
However, I wonder if that makes any difference at all in our case:
If we have a "contained-in" relationship between two entries, then
the first of the two entries necessarily has a lower PC than the
second one.
The one scenario that Doug and I identified which my patch probably
does not handle well is the following case:
block1:
block2:
.line N
end block2
.line N
end block1
If the user tries to break on line N, what should we do? With the
current approach, we expect GDB to select the second entry only.
This is not optimal, because we probably should try to break on
the entry with the lowest address if we can. But just breaking
on the first one runs the risk of never stopping - this may happen
if entry in block2 is conditional.
So we determined that we should select both line entries in that case.
This is achieved by reducing the iteration range for the inner for loop
to [0, i[.
I will work on submitting a patch with that change and additional
comments ASAP.
--
Joel
next prev parent reply other threads:[~2010-11-26 17:29 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 [this message]
2010-11-27 18:35 ` Daniel Jacobowitz
2010-12-10 12:23 ` Joel Brobecker
2010-12-28 11:50 ` Joel Brobecker
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=20101126172942.GK2634@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