2012-02-08 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-08 19:29:41.887074999 -0200 +++ gdb/gdb/breakpoint.c 2012-02-08 21:38:10.935074996 -0200 @@ -10589,6 +10589,12 @@ bp_location_compare (const void *ap, con if (a_perm != b_perm) return (a_perm < b_perm) - (a_perm > b_perm); + /* 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); + /* Make the internal GDB representation stable across GDB runs 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. */