aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorLuis Machado <luisgpm@br.ibm.com>2012-02-24 14:59:35 +0000
committerLuis Machado <luisgpm@br.ibm.com>2012-02-24 14:59:35 +0000
commitdea2aa5f5641c14149396dd0e699ffc42b08e4ba (patch)
tree3338e20b1a3eb2b972091deda72b5d4b5cea2ccb /gdb/breakpoint.c
parent277e4e52359c0e04b388a2b351e8d6ea14fefc5f (diff)
downloadgdb-dea2aa5f5641c14149396dd0e699ffc42b08e4ba.zip
gdb-dea2aa5f5641c14149396dd0e699ffc42b08e4ba.tar.gz
gdb-dea2aa5f5641c14149396dd0e699ffc42b08e4ba.tar.bz2
2012-02-24 Luis Machado <lgustavo@codesourcery.com>
* breakpoint.c (bp_location_compare): Sort by pspace before sorting by number.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c8
1 files changed, 8 insertions, 0 deletions
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);