2010-07-21 21:30:20 +00:00
|
|
|
Index: gdb-7.1.90.20100711/gdb/breakpoint.c
|
2010-01-16 22:32:10 +00:00
|
|
|
===================================================================
|
2010-07-21 21:30:20 +00:00
|
|
|
--- gdb-7.1.90.20100711.orig/gdb/breakpoint.c 2010-07-12 23:07:33.000000000 +0200
|
|
|
|
+++ gdb-7.1.90.20100711/gdb/breakpoint.c 2010-07-13 00:38:04.000000000 +0200
|
|
|
|
@@ -10159,6 +10159,50 @@ update_breakpoint_locations (struct brea
|
2010-01-12 22:15:57 +00:00
|
|
|
update_global_location_list (1);
|
|
|
|
}
|
|
|
|
|
|
|
|
+void
|
|
|
|
+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
|
|
|
+}
|
2010-07-21 21:30:20 +00:00
|
|
|
+
|
2010-01-12 22:15:57 +00:00
|
|
|
/* Reset a breakpoint given it's struct breakpoint * BINT.
|
|
|
|
The value we return ends up being the return value from catch_errors.
|
2010-07-21 21:30:20 +00:00
|
|
|
Unused in this case. */
|
|
|
|
Index: gdb-7.1.90.20100711/gdb/breakpoint.h
|
2010-01-16 22:32:10 +00:00
|
|
|
===================================================================
|
2010-07-21 21:30:20 +00:00
|
|
|
--- gdb-7.1.90.20100711.orig/gdb/breakpoint.h 2010-07-12 23:07:33.000000000 +0200
|
|
|
|
+++ gdb-7.1.90.20100711/gdb/breakpoint.h 2010-07-13 00:37:34.000000000 +0200
|
|
|
|
@@ -1088,4 +1088,7 @@ extern void check_tracepoint_command (ch
|
|
|
|
extern void start_rbreak_breakpoints (void);
|
|
|
|
extern void end_rbreak_breakpoints (void);
|
2010-01-12 22:15:57 +00:00
|
|
|
|
|
|
|
+extern void breakpoints_relocate (struct objfile *objfile,
|
|
|
|
+ struct section_offsets *delta);
|
|
|
|
+
|
|
|
|
#endif /* !defined (BREAKPOINT_H) */
|
2010-07-21 21:30:20 +00:00
|
|
|
Index: gdb-7.1.90.20100711/gdb/objfiles.c
|
2010-01-16 22:32:10 +00:00
|
|
|
===================================================================
|
2010-07-21 21:30:20 +00:00
|
|
|
--- gdb-7.1.90.20100711.orig/gdb/objfiles.c 2010-05-16 02:46:46.000000000 +0200
|
|
|
|
+++ gdb-7.1.90.20100711/gdb/objfiles.c 2010-07-13 00:37:19.000000000 +0200
|
|
|
|
@@ -834,6 +834,11 @@ objfile_relocate1 (struct objfile *objfi
|
2010-01-12 22:15:57 +00:00
|
|
|
obj_section_addr (s));
|
|
|
|
}
|
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
|
|
|
}
|