From d30113d4f5666ee889549d0383b9a12f33c5301c Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 5 Feb 2013 20:23:19 +0000 Subject: [PATCH] gdb/ * breakpoint.c (add_location_to_breakpoint): Insert the location with ADDRESS sorted. --- gdb/ChangeLog | 5 +++++ gdb/breakpoint.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a88999123ee..efa07718700 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-02-05 Jan Kratochvil + + * breakpoint.c (add_location_to_breakpoint): Insert the location with + ADDRESS sorted. + 2013-02-05 Marcus Shawcroft * aarch64-tdep.c (aarch64_analyze_prologue): ARI fix: diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 026ce739a2f..fb57a57d88c 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -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; -- 2.30.2