]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-archer-pie-addons-keep-disabled.patch
- updated (performance fixes).
[packages/gdb.git] / gdb-archer-pie-addons-keep-disabled.patch
CommitLineData
f412e1b4 1Index: gdb-7.4.50.20120103/gdb/breakpoint.c
51a5ef0f 2===================================================================
f412e1b4
PS
3--- gdb-7.4.50.20120103.orig/gdb/breakpoint.c 2012-01-03 05:52:15.000000000 +0100
4+++ gdb-7.4.50.20120103/gdb/breakpoint.c 2012-01-03 15:22:56.105405559 +0100
5@@ -13724,6 +13724,50 @@ initialize_breakpoint_ops (void)
51a5ef0f
PS
6 }
7
f412e1b4 8 void
51a5ef0f
PS
9+breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
10+{
11+ struct bp_location *bl, **blp_tmp;
12+ int changed = 0;
13+
14+ gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
15+
16+ ALL_BP_LOCATIONS (bl, blp_tmp)
17+ {
18+ struct obj_section *osect;
19+
20+ /* BL->SECTION can be correctly NULL for breakpoints with multiple
21+ locations expanded through symtab. */
22+
23+ ALL_OBJFILE_OSECTIONS (objfile, osect)
24+ {
25+ CORE_ADDR relocated_address;
26+ CORE_ADDR delta_offset;
27+
28+ delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
29+ if (delta_offset == 0)
30+ continue;
31+ relocated_address = bl->address + delta_offset;
32+
33+ if (obj_section_addr (osect) <= relocated_address
34+ && relocated_address < obj_section_endaddr (osect))
35+ {
36+ if (bl->inserted)
37+ remove_breakpoint (bl, mark_uninserted);
38+
39+ bl->address += delta_offset;
40+ bl->requested_address += delta_offset;
41+
42+ changed = 1;
43+ }
44+ }
45+ }
46+
47+ if (changed)
48+ qsort (bp_location, bp_location_count, sizeof (*bp_location),
49+ bp_location_compare);
50+}
51+
f412e1b4
PS
52+void
53 _initialize_breakpoint (void)
54 {
55 struct cmd_list_element *c;
56Index: gdb-7.4.50.20120103/gdb/breakpoint.h
51a5ef0f 57===================================================================
f412e1b4
PS
58--- gdb-7.4.50.20120103.orig/gdb/breakpoint.h 2012-01-03 05:52:15.000000000 +0100
59+++ gdb-7.4.50.20120103/gdb/breakpoint.h 2012-01-03 15:23:09.444356484 +0100
60@@ -1393,4 +1393,7 @@ extern struct gdbarch *get_sal_arch (str
6ed6bacf
AM
61
62 extern void modify_semaphore (struct bp_location *location, int set);
51a5ef0f
PS
63
64+extern void breakpoints_relocate (struct objfile *objfile,
65+ struct section_offsets *delta);
66+
67 #endif /* !defined (BREAKPOINT_H) */
f412e1b4 68Index: gdb-7.4.50.20120103/gdb/objfiles.c
51a5ef0f 69===================================================================
f412e1b4
PS
70--- gdb-7.4.50.20120103.orig/gdb/objfiles.c 2012-01-03 05:52:15.000000000 +0100
71+++ gdb-7.4.50.20120103/gdb/objfiles.c 2012-01-03 15:23:28.141287697 +0100
72@@ -818,6 +818,11 @@ objfile_relocate1 (struct objfile *objfi
6ed6bacf
AM
73 objfile->sf->sym_probe_fns->sym_relocate_probe (objfile,
74 new_offsets, delta);
51a5ef0f
PS
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 }
This page took 0.030617 seconds and 4 git commands to generate.