1 Index: gdb-7.4.50.20120602/gdb/breakpoint.c
2 ===================================================================
3 --- gdb-7.4.50.20120602.orig/gdb/breakpoint.c 2012-06-02 19:11:54.000000000 +0200
4 +++ gdb-7.4.50.20120602/gdb/breakpoint.c 2012-06-02 19:52:58.161226506 +0200
5 @@ -15495,6 +15495,50 @@ initialize_breakpoint_ops (void)
9 +breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
11 + struct bp_location *bl, **blp_tmp;
14 + gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
16 + ALL_BP_LOCATIONS (bl, blp_tmp)
18 + struct obj_section *osect;
20 + /* BL->SECTION can be correctly NULL for breakpoints with multiple
21 + locations expanded through symtab. */
23 + ALL_OBJFILE_OSECTIONS (objfile, osect)
25 + CORE_ADDR relocated_address;
26 + CORE_ADDR delta_offset;
28 + delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
29 + if (delta_offset == 0)
31 + relocated_address = bl->address + delta_offset;
33 + if (obj_section_addr (osect) <= relocated_address
34 + && relocated_address < obj_section_endaddr (osect))
37 + remove_breakpoint (bl, mark_uninserted);
39 + bl->address += delta_offset;
40 + bl->requested_address += delta_offset;
48 + qsort (bp_location, bp_location_count, sizeof (*bp_location),
49 + bp_location_compare);
53 _initialize_breakpoint (void)
55 struct cmd_list_element *c;
56 Index: gdb-7.4.50.20120602/gdb/breakpoint.h
57 ===================================================================
58 --- gdb-7.4.50.20120602.orig/gdb/breakpoint.h 2012-05-16 16:35:03.000000000 +0200
59 +++ gdb-7.4.50.20120602/gdb/breakpoint.h 2012-06-02 19:53:09.268223263 +0200
60 @@ -1503,4 +1503,7 @@ extern struct gdbarch *get_sal_arch (str
62 extern void handle_solib_event (void);
64 +extern void breakpoints_relocate (struct objfile *objfile,
65 + struct section_offsets *delta);
67 #endif /* !defined (BREAKPOINT_H) */
68 Index: gdb-7.4.50.20120602/gdb/objfiles.c
69 ===================================================================
70 --- gdb-7.4.50.20120602.orig/gdb/objfiles.c 2012-05-10 21:50:08.000000000 +0200
71 +++ gdb-7.4.50.20120602/gdb/objfiles.c 2012-06-02 19:52:58.202226502 +0200
72 @@ -802,6 +802,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);