From: Luis Gustavo <luis_gustavo@mentor.com>
To: Pedro Alves <palves@redhat.com>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>,
Joel Brobecker <brobecker@adacore.com>,
gdb-patches@sourceware.org
Subject: Re: [patch] update_global_location_list my comment fix [Re: [PATCH] Fix breakpoint updates for multi-inferior]
Date: Fri, 24 Feb 2012 15:24:00 -0000 [thread overview]
Message-ID: <4F47AB82.5080502@mentor.com> (raw)
In-Reply-To: <4F33AE8C.5000400@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1582 bytes --]
On 02/09/2012 09:31 AM, Pedro Alves wrote:
> On 02/09/2012 11:04 AM, Luis Gustavo wrote:
>> On 02/09/2012 06:22 AM, Jan Kratochvil wrote:
>>> On Thu, 09 Feb 2012 00:39:42 +0100, Luis Gustavo wrote:
>>>> + /* Sort by pspace. This effectively sorts locations by inferior in
>>>> + a multi-inferior environment. */
>>>> +
>>>> + if (a->pspace != b->pspace)
>>>> + return (a->pspace> b->pspace) - (a->pspace< b->pspace);
>>>
>>> This does not follow the comment I made:
>>>
>>> /* Make the internal GDB representation stable across GDB runs
>>> where A and B memory inside GDB can differ.
>>>
>>> I would prefer there (and it will not fit on a single line :-) ):
>>>
>>> return (a->pspace->num> b->pspace->num) - (a->pspace->num< b->pspace->num);
>>>
>>> NUM should be the same on each GDB run for the same inferior / command file.
>>
>> I would still like to keep an appropriate comment regarding multi-inferiors next to the pspace comparison, like the following... maybe it would've been best to keep the change above your new comment. Here's a new version.
>>
>> What do you think?
>
> We need to sort by pspace even before that, before:
>
> /* Sort permanent breakpoints first. */
> if (a_perm != b_perm)
> return (a_perm< b_perm) - (a_perm> b_perm);
>
> So that you don't get:
>
> #1 PSPACE1 ADDR1 PERM
> #2 PSPACE2 ADDR1 PERM
> #3 PSPACE1 ADDR1
> #4 PSPACE2 ADDR1
>
> But instead:
>
> #1 PSPACE1 ADDR1 PERM
> #2 PSPACE1 ADDR1
> #3 PSPACE2 ADDR1 PERM
> #4 PSPACE2 ADDR1
>
I've checked the following in...
Luis
[-- Attachment #2: 0001-fix_multiprocess_breaks.diff --]
[-- Type: text/x-patch, Size: 947 bytes --]
2012-02-24 Luis Machado <lgustavo@codesourcery.com>
* breakpoint.c (bp_location_compare): Sort by pspace before sorting by
number.
Index: gdb/gdb/breakpoint.c
===================================================================
--- gdb.orig/gdb/breakpoint.c 2012-02-24 12:44:27.582553984 -0200
+++ gdb/gdb/breakpoint.c 2012-02-24 12:44:59.210553984 -0200
@@ -10609,6 +10609,14 @@ bp_location_compare (const void *ap, con
if (a->address != b->address)
return (a->address > b->address) - (a->address < b->address);
+ /* Sort locations at the same address by their pspace number, keeping
+ locations of the same inferior (in a multi-inferior environment)
+ grouped. */
+
+ if (a->pspace->num != b->pspace->num)
+ return ((a->pspace->num > b->pspace->num)
+ - (a->pspace->num < b->pspace->num));
+
/* Sort permanent breakpoints first. */
if (a_perm != b_perm)
return (a_perm < b_perm) - (a_perm > b_perm);
next prev parent reply other threads:[~2012-02-24 15:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-25 21:27 [PATCH] Fix breakpoint updates for multi-inferior Luis Gustavo
2012-02-07 23:44 ` Luis Gustavo
2012-02-08 15:17 ` Pedro Alves
2012-02-08 15:27 ` Luis Gustavo
2012-02-08 15:47 ` Pedro Alves
2012-02-08 17:28 ` [patch] update_global_location_list my comment fix [Re: [PATCH] Fix breakpoint updates for multi-inferior] Jan Kratochvil
2012-02-08 23:19 ` Luis Gustavo
2012-02-08 23:32 ` Joel Brobecker
2012-02-08 23:40 ` Luis Gustavo
2012-02-09 8:23 ` Jan Kratochvil
2012-02-09 11:05 ` Luis Gustavo
2012-02-09 11:32 ` Pedro Alves
2012-02-24 15:24 ` Luis Gustavo [this message]
2012-02-09 8:21 ` [commit] " Jan Kratochvil
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=4F47AB82.5080502@mentor.com \
--to=luis_gustavo@mentor.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=palves@redhat.com \
/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