2013-08-02 20:26:03 +00:00
|
|
|
Index: gdb-7.6.50.20130731-cvs/gdb/breakpoint.c
|
2010-01-16 22:32:10 +00:00
|
|
|
===================================================================
|
2013-08-02 20:26:03 +00:00
|
|
|
--- gdb-7.6.50.20130731-cvs.orig/gdb/breakpoint.c 2013-08-02 16:29:16.065402116 +0200
|
|
|
|
+++ gdb-7.6.50.20130731-cvs/gdb/breakpoint.c 2013-08-02 16:29:17.073403456 +0200
|
|
|
|
@@ -15963,6 +15963,50 @@ initialize_breakpoint_ops (void)
|
2013-01-19 22:41:55 +00:00
|
|
|
static struct cmd_list_element *enablebreaklist = NULL;
|
2012-01-03 15:00:12 +00:00
|
|
|
|
|
|
|
void
|
2010-01-12 22:15:57 +00:00
|
|
|
+breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
|
|
|
|
+{
|
|
|
|
+ struct bp_location *bl, **blp_tmp;
|
|
|
|
+ int changed = 0;
|
|
|
|
+
|
|
|
|
+ gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
|
|
|
|
+
|
|
|
|
+ ALL_BP_LOCATIONS (bl, blp_tmp)
|
|
|
|
+ {
|
|
|
|
+ struct obj_section *osect;
|
|
|
|
+
|
|
|
|
+ /* BL->SECTION can be correctly NULL for breakpoints with multiple
|
|
|
|
+ locations expanded through symtab. */
|
|
|
|
+
|
|
|
|
+ ALL_OBJFILE_OSECTIONS (objfile, osect)
|
|
|
|
+ {
|
|
|
|
+ CORE_ADDR relocated_address;
|
|
|
|
+ CORE_ADDR delta_offset;
|
|
|
|
+
|
|
|
|
+ delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
|
|
|
|
+ if (delta_offset == 0)
|
|
|
|
+ continue;
|
|
|
|
+ relocated_address = bl->address + delta_offset;
|
|
|
|
+
|
|
|
|
+ if (obj_section_addr (osect) <= relocated_address
|
|
|
|
+ && relocated_address < obj_section_endaddr (osect))
|
|
|
|
+ {
|
|
|
|
+ if (bl->inserted)
|
|
|
|
+ remove_breakpoint (bl, mark_uninserted);
|
|
|
|
+
|
|
|
|
+ bl->address += delta_offset;
|
|
|
|
+ bl->requested_address += delta_offset;
|
|
|
|
+
|
|
|
|
+ changed = 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (changed)
|
|
|
|
+ qsort (bp_location, bp_location_count, sizeof (*bp_location),
|
2010-01-16 22:32:10 +00:00
|
|
|
+ bp_location_compare);
|
2010-01-12 22:15:57 +00:00
|
|
|
+}
|
2012-01-03 15:00:12 +00:00
|
|
|
+
|
|
|
|
+void
|
2011-07-22 22:41:56 +00:00
|
|
|
_initialize_breakpoint (void)
|
2012-01-03 15:00:12 +00:00
|
|
|
{
|
|
|
|
struct cmd_list_element *c;
|
2013-08-02 20:26:03 +00:00
|
|
|
Index: gdb-7.6.50.20130731-cvs/gdb/breakpoint.h
|
2010-01-16 22:32:10 +00:00
|
|
|
===================================================================
|
2013-08-02 20:26:03 +00:00
|
|
|
--- gdb-7.6.50.20130731-cvs.orig/gdb/breakpoint.h 2013-08-02 16:29:17.074403457 +0200
|
|
|
|
+++ gdb-7.6.50.20130731-cvs/gdb/breakpoint.h 2013-08-02 16:29:30.221420896 +0200
|
|
|
|
@@ -1555,4 +1555,7 @@ extern void breakpoint_free_objfile (str
|
2011-02-06 21:46:57 +00:00
|
|
|
|
2013-08-02 20:26:03 +00:00
|
|
|
extern char *ep_parse_optional_if_clause (char **arg);
|
2010-01-12 22:15:57 +00:00
|
|
|
|
|
|
|
+extern void breakpoints_relocate (struct objfile *objfile,
|
|
|
|
+ struct section_offsets *delta);
|
|
|
|
+
|
|
|
|
#endif /* !defined (BREAKPOINT_H) */
|
2013-08-02 20:26:03 +00:00
|
|
|
Index: gdb-7.6.50.20130731-cvs/gdb/objfiles.c
|
2010-01-16 22:32:10 +00:00
|
|
|
===================================================================
|
2013-08-02 20:26:03 +00:00
|
|
|
--- gdb-7.6.50.20130731-cvs.orig/gdb/objfiles.c 2013-08-02 16:29:16.068402120 +0200
|
|
|
|
+++ gdb-7.6.50.20130731-cvs/gdb/objfiles.c 2013-08-02 16:29:17.075403458 +0200
|
|
|
|
@@ -851,6 +851,11 @@ objfile_relocate1 (struct objfile *objfi
|
2011-03-20 20:44:20 +00:00
|
|
|
objfile->sf->sym_probe_fns->sym_relocate_probe (objfile,
|
|
|
|
new_offsets, delta);
|
2010-01-16 22:32:10 +00:00
|
|
|
|
2010-01-12 22:15:57 +00:00
|
|
|
+ /* Final call of breakpoint_re_set can keep breakpoint locations disabled if
|
|
|
|
+ their addresses match. */
|
|
|
|
+ if (objfile->separate_debug_objfile_backlink == NULL)
|
|
|
|
+ breakpoints_relocate (objfile, delta);
|
|
|
|
+
|
2010-01-16 22:32:10 +00:00
|
|
|
/* Data changed. */
|
|
|
|
return 1;
|
2010-01-12 22:15:57 +00:00
|
|
|
}
|