2012-02-24 Luis Machado <lgustavo@codesourcery.com>
authorLuis Machado <luisgpm@br.ibm.com>
Fri, 24 Feb 2012 14:59:35 +0000 (14:59 +0000)
committerLuis Machado <luisgpm@br.ibm.com>
Fri, 24 Feb 2012 14:59:35 +0000 (14:59 +0000)
* breakpoint.c (bp_location_compare): Sort by pspace before sorting by
number.

gdb/ChangeLog
gdb/breakpoint.c

index 8c6b20d143defd9a427d88cbdacbb0aa738c37f1..46b1dc60ce504649927e3d722da8df5be8260f81 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-24  Luis Machado  <lgustavo@codesourcery.com>
+
+       * breakpoint.c (bp_location_compare): Sort by pspace before sorting by
+       number.
+
 2012-02-24  Thomas Schwinge  <thomas@codesourcery.com>
 
        * sh-tdep.c (sh_skip_prologue): Use skip_prologue_using_sal.
index 37401575e7381da8e496298b99f66c2d4638181b..fd9dced5557a44d94361d5e60db707e690d9aa69 100644 (file)
@@ -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);