diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2013-02-05 20:23:19 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2013-02-05 20:23:19 +0000 |
commit | d30113d4f5666ee889549d0383b9a12f33c5301c (patch) | |
tree | e7fbae7a9ca2ab2270d46cf293fff8f04f0096c9 /gdb/breakpoint.c | |
parent | 430ed3f014e02cc8a6f608a099e017c857fcbacd (diff) | |
download | gdb-d30113d4f5666ee889549d0383b9a12f33c5301c.zip gdb-d30113d4f5666ee889549d0383b9a12f33c5301c.tar.gz gdb-d30113d4f5666ee889549d0383b9a12f33c5301c.tar.bz2 |
gdb/
* breakpoint.c (add_location_to_breakpoint): Insert the location with
ADDRESS sorted.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 026ce73..fb57a57 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; |