2012-02-09 Luis Machado * breakpoint.c (bp_location_compare): Sort by pspace before sorting by number. Index: gdb/gdb/breakpoint.c =================================================================== --- gdb.orig/gdb/breakpoint.c 2012-02-09 08:46:30.495074997 -0200 +++ gdb/gdb/breakpoint.c 2012-02-09 09:02:14.227075000 -0200 @@ -10593,6 +10593,14 @@ bp_location_compare (const void *ap, con where A and B memory inside GDB can differ. Breakpoint locations of the same type at the same address can be sorted in arbitrary order. */ + /* 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)); + if (a->owner->number != b->owner->number) return ((a->owner->number > b->owner->number) - (a->owner->number < b->owner->number));