From dea2aa5f5641c14149396dd0e699ffc42b08e4ba Mon Sep 17 00:00:00 2001 From: Luis Machado Date: Fri, 24 Feb 2012 14:59:35 +0000 Subject: [PATCH] 2012-02-24 Luis Machado * breakpoint.c (bp_location_compare): Sort by pspace before sorting by number. --- gdb/ChangeLog | 5 +++++ gdb/breakpoint.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8c6b20d..46b1dc6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-02-24 Luis Machado + + * breakpoint.c (bp_location_compare): Sort by pspace before sorting by + number. + 2012-02-24 Thomas Schwinge * sh-tdep.c (sh_skip_prologue): Use skip_prologue_using_sal. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 3740157..fd9dced 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -10609,6 +10609,14 @@ bp_location_compare (const void *ap, const void *bp) 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); -- 2.7.4