gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 5 Feb 2013 20:23:19 +0000 (20:23 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 5 Feb 2013 20:23:19 +0000 (20:23 +0000)
* breakpoint.c (add_location_to_breakpoint): Insert the location with
ADDRESS sorted.

gdb/ChangeLog
gdb/breakpoint.c

index a88999123eea372d76e9952735ffa8030ec521f5..efa0771870023328cc7a7eefd1a02048652bf417 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * breakpoint.c (add_location_to_breakpoint): Insert the location with
+       ADDRESS sorted.
+
 2013-02-05  Marcus Shawcroft  <marcus.shawcroft@arm.com>
 
        * aarch64-tdep.c (aarch64_analyze_prologue): ARI fix:
index 026ce739a2fc7ce79fe2e8c1077223544e88738a..fb57a57d88cb018da9830dd1a8167349644fbea4 100644 (file)
@@ -8827,9 +8827,12 @@ add_location_to_breakpoint (struct breakpoint *b,
   adjusted_address = adjust_breakpoint_address (loc_gdbarch,
                                                sal->pc, b->type);
 
+  /* Sort the locations by their ADDRESS.  */
   loc = allocate_bp_location (b);
-  for (tmp = &(b->loc); *tmp != NULL; tmp = &((*tmp)->next))
+  for (tmp = &(b->loc); *tmp != NULL && (*tmp)->address <= adjusted_address;
+       tmp = &((*tmp)->next))
     ;
+  loc->next = *tmp;
   *tmp = loc;
 
   loc->requested_address = sal->pc;