1 Index: gdb-7.2.90.20110411/gdb/breakpoint.c
2 ===================================================================
3 --- gdb-7.2.90.20110411.orig/gdb/breakpoint.c 2011-04-11 19:11:55.000000000 +0200
4 +++ gdb-7.2.90.20110411/gdb/breakpoint.c 2011-04-11 19:18:10.000000000 +0200
5 @@ -11233,6 +11233,50 @@ re_set_breakpoint (struct breakpoint *b)
6 do_cleanups (cleanups);
10 +breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
12 + struct bp_location *bl, **blp_tmp;
15 + gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
17 + ALL_BP_LOCATIONS (bl, blp_tmp)
19 + struct obj_section *osect;
21 + /* BL->SECTION can be correctly NULL for breakpoints with multiple
22 + locations expanded through symtab. */
24 + ALL_OBJFILE_OSECTIONS (objfile, osect)
26 + CORE_ADDR relocated_address;
27 + CORE_ADDR delta_offset;
29 + delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
30 + if (delta_offset == 0)
32 + relocated_address = bl->address + delta_offset;
34 + if (obj_section_addr (osect) <= relocated_address
35 + && relocated_address < obj_section_endaddr (osect))
38 + remove_breakpoint (bl, mark_uninserted);
40 + bl->address += delta_offset;
41 + bl->requested_address += delta_offset;
49 + qsort (bp_location, bp_location_count, sizeof (*bp_location),
50 + bp_location_compare);
53 /* Reset a breakpoint given it's struct breakpoint * BINT.
54 The value we return ends up being the return value from catch_errors.
55 Unused in this case. */
56 Index: gdb-7.2.90.20110411/gdb/breakpoint.h
57 ===================================================================
58 --- gdb-7.2.90.20110411.orig/gdb/breakpoint.h 2011-04-11 19:11:55.000000000 +0200
59 +++ gdb-7.2.90.20110411/gdb/breakpoint.h 2011-04-11 19:17:53.000000000 +0200
60 @@ -1245,4 +1245,7 @@ extern int user_breakpoint_p (struct bre
62 extern void modify_semaphore (struct bp_location *location, int set);
64 +extern void breakpoints_relocate (struct objfile *objfile,
65 + struct section_offsets *delta);
67 #endif /* !defined (BREAKPOINT_H) */
68 Index: gdb-7.2.90.20110411/gdb/objfiles.c
69 ===================================================================
70 --- gdb-7.2.90.20110411.orig/gdb/objfiles.c 2011-04-11 19:11:55.000000000 +0200
71 +++ gdb-7.2.90.20110411/gdb/objfiles.c 2011-04-11 19:17:53.000000000 +0200
72 @@ -851,6 +851,11 @@ objfile_relocate1 (struct objfile *objfi
73 objfile->sf->sym_probe_fns->sym_relocate_probe (objfile,
76 + /* Final call of breakpoint_re_set can keep breakpoint locations disabled if
77 + their addresses match. */
78 + if (objfile->separate_debug_objfile_backlink == NULL)
79 + breakpoints_relocate (objfile, delta);