]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blob - gdb/patches/gdb-archer-pie-addons-keep-disabled.patch
gdb: Update to 7.3.50.20110722.
[people/stevee/ipfire-3.x.git] / gdb / patches / gdb-archer-pie-addons-keep-disabled.patch
1 Index: gdb-7.3.50.20110722/gdb/breakpoint.c
2 ===================================================================
3 --- gdb-7.3.50.20110722.orig/gdb/breakpoint.c 2011-07-22 19:08:19.000000000 +0200
4 +++ gdb-7.3.50.20110722/gdb/breakpoint.c 2011-07-22 19:32:04.000000000 +0200
5 @@ -13195,6 +13195,50 @@ iterate_over_breakpoints (int (*callback
6
7 return NULL;
8 }
9 +
10 +void
11 +breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
12 +{
13 + struct bp_location *bl, **blp_tmp;
14 + int changed = 0;
15 +
16 + gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
17 +
18 + ALL_BP_LOCATIONS (bl, blp_tmp)
19 + {
20 + struct obj_section *osect;
21 +
22 + /* BL->SECTION can be correctly NULL for breakpoints with multiple
23 + locations expanded through symtab. */
24 +
25 + ALL_OBJFILE_OSECTIONS (objfile, osect)
26 + {
27 + CORE_ADDR relocated_address;
28 + CORE_ADDR delta_offset;
29 +
30 + delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
31 + if (delta_offset == 0)
32 + continue;
33 + relocated_address = bl->address + delta_offset;
34 +
35 + if (obj_section_addr (osect) <= relocated_address
36 + && relocated_address < obj_section_endaddr (osect))
37 + {
38 + if (bl->inserted)
39 + remove_breakpoint (bl, mark_uninserted);
40 +
41 + bl->address += delta_offset;
42 + bl->requested_address += delta_offset;
43 +
44 + changed = 1;
45 + }
46 + }
47 + }
48 +
49 + if (changed)
50 + qsort (bp_location, bp_location_count, sizeof (*bp_location),
51 + bp_location_compare);
52 +}
53
54 void
55 _initialize_breakpoint (void)
56 Index: gdb-7.3.50.20110722/gdb/breakpoint.h
57 ===================================================================
58 --- gdb-7.3.50.20110722.orig/gdb/breakpoint.h 2011-07-22 19:08:19.000000000 +0200
59 +++ gdb-7.3.50.20110722/gdb/breakpoint.h 2011-07-22 19:31:22.000000000 +0200
60 @@ -1328,4 +1328,7 @@ extern int user_breakpoint_p (struct bre
61
62 extern void modify_semaphore (struct bp_location *location, int set);
63
64 +extern void breakpoints_relocate (struct objfile *objfile,
65 + struct section_offsets *delta);
66 +
67 #endif /* !defined (BREAKPOINT_H) */
68 Index: gdb-7.3.50.20110722/gdb/objfiles.c
69 ===================================================================
70 --- gdb-7.3.50.20110722.orig/gdb/objfiles.c 2011-07-22 19:08:19.000000000 +0200
71 +++ gdb-7.3.50.20110722/gdb/objfiles.c 2011-07-22 19:31:22.000000000 +0200
72 @@ -847,6 +847,11 @@ objfile_relocate1 (struct objfile *objfi
73 objfile->sf->sym_probe_fns->sym_relocate_probe (objfile,
74 new_offsets, delta);
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 }