]>
Commit | Line | Data |
---|---|---|
51a5ef0f PS |
1 | Index: gdb-7.1.90.20100711/gdb/breakpoint.c |
2 | =================================================================== | |
3 | --- gdb-7.1.90.20100711.orig/gdb/breakpoint.c 2010-07-12 23:07:33.000000000 +0200 | |
4 | +++ gdb-7.1.90.20100711/gdb/breakpoint.c 2010-07-13 00:38:04.000000000 +0200 | |
5 | @@ -10159,6 +10159,50 @@ update_breakpoint_locations (struct brea | |
6 | update_global_location_list (1); | |
7 | } | |
8 | ||
9 | +void | |
10 | +breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta) | |
11 | +{ | |
12 | + struct bp_location *bl, **blp_tmp; | |
13 | + int changed = 0; | |
14 | + | |
15 | + gdb_assert (objfile->separate_debug_objfile_backlink == NULL); | |
16 | + | |
17 | + ALL_BP_LOCATIONS (bl, blp_tmp) | |
18 | + { | |
19 | + struct obj_section *osect; | |
20 | + | |
21 | + /* BL->SECTION can be correctly NULL for breakpoints with multiple | |
22 | + locations expanded through symtab. */ | |
23 | + | |
24 | + ALL_OBJFILE_OSECTIONS (objfile, osect) | |
25 | + { | |
26 | + CORE_ADDR relocated_address; | |
27 | + CORE_ADDR delta_offset; | |
28 | + | |
29 | + delta_offset = ANOFFSET (delta, osect->the_bfd_section->index); | |
30 | + if (delta_offset == 0) | |
31 | + continue; | |
32 | + relocated_address = bl->address + delta_offset; | |
33 | + | |
34 | + if (obj_section_addr (osect) <= relocated_address | |
35 | + && relocated_address < obj_section_endaddr (osect)) | |
36 | + { | |
37 | + if (bl->inserted) | |
38 | + remove_breakpoint (bl, mark_uninserted); | |
39 | + | |
40 | + bl->address += delta_offset; | |
41 | + bl->requested_address += delta_offset; | |
42 | + | |
43 | + changed = 1; | |
44 | + } | |
45 | + } | |
46 | + } | |
47 | + | |
48 | + if (changed) | |
49 | + qsort (bp_location, bp_location_count, sizeof (*bp_location), | |
50 | + bp_location_compare); | |
51 | +} | |
52 | + | |
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.1.90.20100711/gdb/breakpoint.h | |
57 | =================================================================== | |
58 | --- gdb-7.1.90.20100711.orig/gdb/breakpoint.h 2010-07-12 23:07:33.000000000 +0200 | |
59 | +++ gdb-7.1.90.20100711/gdb/breakpoint.h 2010-07-13 00:37:34.000000000 +0200 | |
60 | @@ -1088,4 +1088,7 @@ extern void check_tracepoint_command (ch | |
61 | extern void start_rbreak_breakpoints (void); | |
62 | extern void end_rbreak_breakpoints (void); | |
63 | ||
64 | +extern void breakpoints_relocate (struct objfile *objfile, | |
65 | + struct section_offsets *delta); | |
66 | + | |
67 | #endif /* !defined (BREAKPOINT_H) */ | |
68 | Index: gdb-7.1.90.20100711/gdb/objfiles.c | |
69 | =================================================================== | |
70 | --- gdb-7.1.90.20100711.orig/gdb/objfiles.c 2010-05-16 02:46:46.000000000 +0200 | |
71 | +++ gdb-7.1.90.20100711/gdb/objfiles.c 2010-07-13 00:37:19.000000000 +0200 | |
72 | @@ -834,6 +834,11 @@ objfile_relocate1 (struct objfile *objfi | |
73 | obj_section_addr (s)); | |
74 | } | |
75 | ||
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); | |
80 | + | |
81 | /* Data changed. */ | |
82 | return 1; | |
83 | } |