]>
Commit | Line | Data |
---|---|---|
a7de96f0 PS |
1 | 2012-07-19 Gary Benson <gbenson@redhat.com> |
2 | ||
3 | * solib-svr4.c (svr4_info): Move earlier. | |
4 | (solib_svr4_pspace_data): Likewise. | |
5 | (svr4_pspace_data_cleanup): Likewise. | |
6 | (get_svr4_info): Likewise. | |
7 | ||
8 | diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c | |
9 | index 307e483..c88b9cb 100644 | |
10 | --- a/gdb/solib-svr4.c | |
11 | +++ b/gdb/solib-svr4.c | |
12 | @@ -106,6 +106,59 @@ static const char * const main_name_list[] = | |
13 | NULL | |
14 | }; | |
15 | ||
16 | +/* Per pspace SVR4 specific data. */ | |
17 | + | |
18 | +struct svr4_info | |
19 | +{ | |
20 | + CORE_ADDR debug_base; /* Base of dynamic linker structures. */ | |
21 | + | |
22 | + /* Validity flag for debug_loader_offset. */ | |
23 | + int debug_loader_offset_p; | |
24 | + | |
25 | + /* Load address for the dynamic linker, inferred. */ | |
26 | + CORE_ADDR debug_loader_offset; | |
27 | + | |
28 | + /* Name of the dynamic linker, valid if debug_loader_offset_p. */ | |
29 | + char *debug_loader_name; | |
30 | + | |
31 | + /* Load map address for the main executable. */ | |
32 | + CORE_ADDR main_lm_addr; | |
33 | + | |
34 | + CORE_ADDR interp_text_sect_low; | |
35 | + CORE_ADDR interp_text_sect_high; | |
36 | + CORE_ADDR interp_plt_sect_low; | |
37 | + CORE_ADDR interp_plt_sect_high; | |
38 | +}; | |
39 | + | |
40 | +/* Per-program-space data key. */ | |
41 | +static const struct program_space_data *solib_svr4_pspace_data; | |
42 | + | |
43 | +static void | |
44 | +svr4_pspace_data_cleanup (struct program_space *pspace, void *arg) | |
45 | +{ | |
46 | + struct svr4_info *info; | |
47 | + | |
48 | + info = program_space_data (pspace, solib_svr4_pspace_data); | |
49 | + xfree (info); | |
50 | +} | |
51 | + | |
52 | +/* Get the current svr4 data. If none is found yet, add it now. This | |
53 | + function always returns a valid object. */ | |
54 | + | |
55 | +static struct svr4_info * | |
56 | +get_svr4_info (void) | |
57 | +{ | |
58 | + struct svr4_info *info; | |
59 | + | |
60 | + info = program_space_data (current_program_space, solib_svr4_pspace_data); | |
61 | + if (info != NULL) | |
62 | + return info; | |
63 | + | |
64 | + info = XZALLOC (struct svr4_info); | |
65 | + set_program_space_data (current_program_space, solib_svr4_pspace_data, info); | |
66 | + return info; | |
67 | +} | |
68 | + | |
69 | /* Return non-zero if GDB_SO_NAME and INFERIOR_SO_NAME represent | |
70 | the same shared library. */ | |
71 | ||
72 | @@ -291,59 +344,6 @@ lm_addr_check (struct so_list *so, bfd *abfd) | |
73 | return so->lm_info->l_addr; | |
74 | } | |
75 | ||
76 | -/* Per pspace SVR4 specific data. */ | |
77 | - | |
78 | -struct svr4_info | |
79 | -{ | |
80 | - CORE_ADDR debug_base; /* Base of dynamic linker structures. */ | |
81 | - | |
82 | - /* Validity flag for debug_loader_offset. */ | |
83 | - int debug_loader_offset_p; | |
84 | - | |
85 | - /* Load address for the dynamic linker, inferred. */ | |
86 | - CORE_ADDR debug_loader_offset; | |
87 | - | |
88 | - /* Name of the dynamic linker, valid if debug_loader_offset_p. */ | |
89 | - char *debug_loader_name; | |
90 | - | |
91 | - /* Load map address for the main executable. */ | |
92 | - CORE_ADDR main_lm_addr; | |
93 | - | |
94 | - CORE_ADDR interp_text_sect_low; | |
95 | - CORE_ADDR interp_text_sect_high; | |
96 | - CORE_ADDR interp_plt_sect_low; | |
97 | - CORE_ADDR interp_plt_sect_high; | |
98 | -}; | |
99 | - | |
100 | -/* Per-program-space data key. */ | |
101 | -static const struct program_space_data *solib_svr4_pspace_data; | |
102 | - | |
103 | -static void | |
104 | -svr4_pspace_data_cleanup (struct program_space *pspace, void *arg) | |
105 | -{ | |
106 | - struct svr4_info *info; | |
107 | - | |
108 | - info = program_space_data (pspace, solib_svr4_pspace_data); | |
109 | - xfree (info); | |
110 | -} | |
111 | - | |
112 | -/* Get the current svr4 data. If none is found yet, add it now. This | |
113 | - function always returns a valid object. */ | |
114 | - | |
115 | -static struct svr4_info * | |
116 | -get_svr4_info (void) | |
117 | -{ | |
118 | - struct svr4_info *info; | |
119 | - | |
120 | - info = program_space_data (current_program_space, solib_svr4_pspace_data); | |
121 | - if (info != NULL) | |
122 | - return info; | |
123 | - | |
124 | - info = XZALLOC (struct svr4_info); | |
125 | - set_program_space_data (current_program_space, solib_svr4_pspace_data, info); | |
126 | - return info; | |
127 | -} | |
128 | - | |
129 | /* Local function prototypes */ | |
130 | ||
131 | static int match_main (const char *); |