Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: gdb/symtab.h

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gdb/symmisc.c ('k') | gdb/symtab.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
None
OLDNEW
1 /* Symbol table definitions for GDB. 1 /* Symbol table definitions for GDB.
2 2
3 Copyright (C) 1986, 1988-2004, 2007-2012 Free Software Foundation, 3 Copyright (C) 1986, 1988-2004, 2007-2012 Free Software Foundation,
4 Inc. 4 Inc.
5 5
6 This file is part of GDB. 6 This file is part of GDB.
7 7
8 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or 10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version. 11 (at your option) any later version.
12 12
13 This program is distributed in the hope that it will be useful, 13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details. 16 GNU General Public License for more details.
17 17
18 You should have received a copy of the GNU General Public License 18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 20
21 #if !defined (SYMTAB_H) 21 #if !defined (SYMTAB_H)
22 #define SYMTAB_H 1 22 #define SYMTAB_H 1
23 23
24 #include "vec.h" 24 #include "vec.h"
25 #include "gdb_vecs.h"
25 26
26 /* Opaque declarations. */ 27 /* Opaque declarations. */
27 struct ui_file; 28 struct ui_file;
28 struct frame_info; 29 struct frame_info;
29 struct symbol; 30 struct symbol;
30 struct obstack; 31 struct obstack;
31 struct objfile; 32 struct objfile;
32 struct block; 33 struct block;
33 struct blockvector; 34 struct blockvector;
34 struct axs_value; 35 struct axs_value;
35 struct agent_expr; 36 struct agent_expr;
36 struct program_space; 37 struct program_space;
37 struct language_defn; 38 struct language_defn;
39 struct probe;
38 40
39 /* Some of the structures in this file are space critical. 41 /* Some of the structures in this file are space critical.
40 The space-critical structures are: 42 The space-critical structures are:
41 43
42 struct general_symbol_info 44 struct general_symbol_info
43 struct symbol 45 struct symbol
44 struct partial_symbol 46 struct partial_symbol
45 47
46 These structures are laid out to encourage good packing. 48 These structures are laid out to encourage good packing.
47 They use ENUM_BITFIELD and short int fields, and they order the 49 They use ENUM_BITFIELD and short int fields, and they order the
(...skipping 26 matching lines...) Expand all
74 The third line shows the savings from the optimizations in symtab.h. 76 The third line shows the savings from the optimizations in symtab.h.
75 The fourth line shows the savings from the optimizations in 77 The fourth line shows the savings from the optimizations in
76 gdbtypes.h. Both optimizations are in gdb HEAD now. 78 gdbtypes.h. Both optimizations are in gdb HEAD now.
77 79
78 --chastain 2003-08-21 */ 80 --chastain 2003-08-21 */
79 81
80 /* Struct for storing C++ specific information. Allocated when needed. */ 82 /* Struct for storing C++ specific information. Allocated when needed. */
81 83
82 struct cplus_specific 84 struct cplus_specific
83 { 85 {
84 char *demangled_name; 86 const char *demangled_name;
85 }; 87 };
86 88
87 /* Define a structure for the information that is common to all symbol types, 89 /* Define a structure for the information that is common to all symbol types,
88 including minimal symbols, partial symbols, and full symbols. In a 90 including minimal symbols, partial symbols, and full symbols. In a
89 multilanguage environment, some language specific information may need to 91 multilanguage environment, some language specific information may need to
90 be recorded along with each symbol. */ 92 be recorded along with each symbol. */
91 93
92 /* This structure is space critical. See space comments at the top. */ 94 /* This structure is space critical. See space comments at the top. */
93 95
94 struct general_symbol_info 96 struct general_symbol_info
95 { 97 {
96 /* Name of the symbol. This is a required field. Storage for the 98 /* Name of the symbol. This is a required field. Storage for the
97 name is allocated on the objfile_obstack for the associated 99 name is allocated on the objfile_obstack for the associated
98 objfile. For languages like C++ that make a distinction between 100 objfile. For languages like C++ that make a distinction between
99 the mangled name and demangled name, this is the mangled 101 the mangled name and demangled name, this is the mangled
100 name. */ 102 name. */
101 103
102 char *name; 104 const char *name;
103 105
104 /* Value of the symbol. Which member of this union to use, and what 106 /* Value of the symbol. Which member of this union to use, and what
105 it means, depends on what kind of symbol this is and its 107 it means, depends on what kind of symbol this is and its
106 SYMBOL_CLASS. See comments there for more details. All of these 108 SYMBOL_CLASS. See comments there for more details. All of these
107 are in host byte order (though what they point to might be in 109 are in host byte order (though what they point to might be in
108 target byte order, e.g. LOC_CONST_BYTES). */ 110 target byte order, e.g. LOC_CONST_BYTES). */
109 111
110 union 112 union
111 { 113 {
112 /* The fact that this is a long not a LONGEST mainly limits the 114 LONGEST ivalue;
113 range of a LOC_CONST. Since LOC_CONST_BYTES exists, I'm not
114 sure that is a big deal. */
115 long ivalue;
116 115
117 struct block *block; 116 struct block *block;
118 117
119 gdb_byte *bytes; 118 gdb_byte *bytes;
120 119
121 CORE_ADDR address; 120 CORE_ADDR address;
122 121
123 /* For opaque typedef struct chain. */ 122 /* For opaque typedef struct chain. */
124 123
125 struct symbol *chain; 124 struct symbol *chain;
126 } 125 }
127 value; 126 value;
128 127
129 /* Since one and only one language can apply, wrap the language specific 128 /* Since one and only one language can apply, wrap the language specific
130 information inside a union. */ 129 information inside a union. */
131 130
132 union 131 union
133 { 132 {
134 /* This is used by languages which wish to store a demangled name. 133 /* This is used by languages which wish to store a demangled name.
135 currently used by Ada, Java, and Objective C. */ 134 currently used by Ada, Java, and Objective C. */
136 struct mangled_lang 135 struct mangled_lang
137 { 136 {
138 char *demangled_name; 137 const char *demangled_name;
139 } 138 }
140 mangled_lang; 139 mangled_lang;
141 140
142 struct cplus_specific *cplus_specific; 141 struct cplus_specific *cplus_specific;
143 } 142 }
144 language_specific; 143 language_specific;
145 144
146 /* Record the source code language that applies to this symbol. 145 /* Record the source code language that applies to this symbol.
147 This is used to select one of the fields from the language specific 146 This is used to select one of the fields from the language specific
148 union above. */ 147 union above. */
(...skipping 10 matching lines...) Expand all
159 short section; 158 short section;
160 159
161 /* The section associated with this symbol. It can be NULL. */ 160 /* The section associated with this symbol. It can be NULL. */
162 161
163 struct obj_section *obj_section; 162 struct obj_section *obj_section;
164 }; 163 };
165 164
166 extern void symbol_set_demangled_name (struct general_symbol_info *, char *, 165 extern void symbol_set_demangled_name (struct general_symbol_info *, char *,
167 struct objfile *); 166 struct objfile *);
168 167
169 extern char *symbol_get_demangled_name (const struct general_symbol_info *); 168 extern const char *symbol_get_demangled_name
169 (const struct general_symbol_info *);
170 170
171 extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *); 171 extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *);
172 172
173 /* Note that all the following SYMBOL_* macros are used with the 173 /* Note that all the following SYMBOL_* macros are used with the
174 SYMBOL argument being either a partial symbol, a minimal symbol or 174 SYMBOL argument being either a partial symbol, a minimal symbol or
175 a full symbol. All three types have a ginfo field. In particular 175 a full symbol. All three types have a ginfo field. In particular
176 the SYMBOL_SET_LANGUAGE, SYMBOL_DEMANGLED_NAME, etc. 176 the SYMBOL_SET_LANGUAGE, SYMBOL_DEMANGLED_NAME, etc.
177 macros cannot be entirely substituted by 177 macros cannot be entirely substituted by
178 functions, unless the callers are changed to pass in the ginfo 178 functions, unless the callers are changed to pass in the ginfo
179 field only, instead of the SYMBOL parameter. */ 179 field only, instead of the SYMBOL parameter. */
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 specifically need to know whether SYMBOL_NATURAL_NAME and 218 specifically need to know whether SYMBOL_NATURAL_NAME and
219 SYMBOL_LINKAGE_NAME are different. */ 219 SYMBOL_LINKAGE_NAME are different. */
220 220
221 /* Return SYMBOL's "natural" name, i.e. the name that it was called in 221 /* Return SYMBOL's "natural" name, i.e. the name that it was called in
222 the original source code. In languages like C++ where symbols may 222 the original source code. In languages like C++ where symbols may
223 be mangled for ease of manipulation by the linker, this is the 223 be mangled for ease of manipulation by the linker, this is the
224 demangled name. */ 224 demangled name. */
225 225
226 #define SYMBOL_NATURAL_NAME(symbol) \ 226 #define SYMBOL_NATURAL_NAME(symbol) \
227 (symbol_natural_name (&(symbol)->ginfo)) 227 (symbol_natural_name (&(symbol)->ginfo))
228 extern char *symbol_natural_name (const struct general_symbol_info *symbol); 228 extern const char *symbol_natural_name
229 (const struct general_symbol_info *symbol);
229 230
230 /* Return SYMBOL's name from the point of view of the linker. In 231 /* Return SYMBOL's name from the point of view of the linker. In
231 languages like C++ where symbols may be mangled for ease of 232 languages like C++ where symbols may be mangled for ease of
232 manipulation by the linker, this is the mangled name; otherwise, 233 manipulation by the linker, this is the mangled name; otherwise,
233 it's the same as SYMBOL_NATURAL_NAME. */ 234 it's the same as SYMBOL_NATURAL_NAME. */
234 235
235 #define SYMBOL_LINKAGE_NAME(symbol) (symbol)->ginfo.name 236 #define SYMBOL_LINKAGE_NAME(symbol) (symbol)->ginfo.name
236 237
237 /* Return the demangled name for a symbol based on the language for 238 /* Return the demangled name for a symbol based on the language for
238 that symbol. If no demangled name exists, return NULL. */ 239 that symbol. If no demangled name exists, return NULL. */
239 #define SYMBOL_DEMANGLED_NAME(symbol) \ 240 #define SYMBOL_DEMANGLED_NAME(symbol) \
240 (symbol_demangled_name (&(symbol)->ginfo)) 241 (symbol_demangled_name (&(symbol)->ginfo))
241 extern char *symbol_demangled_name (const struct general_symbol_info *symbol); 242 extern const char *symbol_demangled_name
243 (const struct general_symbol_info *symbol);
242 244
243 /* Macro that returns a version of the name of a symbol that is 245 /* Macro that returns a version of the name of a symbol that is
244 suitable for output. In C++ this is the "demangled" form of the 246 suitable for output. In C++ this is the "demangled" form of the
245 name if demangle is on and the "mangled" form of the name if 247 name if demangle is on and the "mangled" form of the name if
246 demangle is off. In other languages this is just the symbol name. 248 demangle is off. In other languages this is just the symbol name.
247 The result should never be NULL. Don't use this for internal 249 The result should never be NULL. Don't use this for internal
248 purposes (e.g. storing in a hashtable): it's only suitable for output. 250 purposes (e.g. storing in a hashtable): it's only suitable for output.
249 251
250 N.B. symbol may be anything with a ginfo member, 252 N.B. symbol may be anything with a ginfo member,
251 e.g., struct symbol or struct minimal_symbol. */ 253 e.g., struct symbol or struct minimal_symbol. */
252 254
253 #define SYMBOL_PRINT_NAME(symbol) \ 255 #define SYMBOL_PRINT_NAME(symbol) \
254 (demangle ? SYMBOL_NATURAL_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol)) 256 (demangle ? SYMBOL_NATURAL_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol))
255 extern int demangle; 257 extern int demangle;
256 258
257 /* Macro that tests a symbol for a match against a specified name string.
258 First test the unencoded name, then looks for and test a C++ encoded
259 name if it exists. Note that whitespace is ignored while attempting to
260 match a C++ encoded name, so that "foo::bar(int,long)" is the same as
261 "foo :: bar (int, long)".
262 Evaluates to zero if the match fails, or nonzero if it succeeds. */
263
264 /* Macro that tests a symbol for a match against a specified name
265 string. It tests against SYMBOL_NATURAL_NAME, and it ignores
266 whitespace and trailing parentheses. (See strcmp_iw for details
267 about its behavior.) */
268
269 #define SYMBOL_MATCHES_NATURAL_NAME(symbol, name) \
270 (strcmp_iw (SYMBOL_NATURAL_NAME (symbol), (name)) == 0)
271
272 /* Macro that returns the name to be used when sorting and searching symbols. 259 /* Macro that returns the name to be used when sorting and searching symbols.
273 In C++, Chill, and Java, we search for the demangled form of a name, 260 In C++, Chill, and Java, we search for the demangled form of a name,
274 and so sort symbols accordingly. In Ada, however, we search by mangled 261 and so sort symbols accordingly. In Ada, however, we search by mangled
275 name. If there is no distinct demangled name, then SYMBOL_SEARCH_NAME 262 name. If there is no distinct demangled name, then SYMBOL_SEARCH_NAME
276 returns the same value (same pointer) as SYMBOL_LINKAGE_NAME. */ 263 returns the same value (same pointer) as SYMBOL_LINKAGE_NAME. */
277 #define SYMBOL_SEARCH_NAME(symbol) \ 264 #define SYMBOL_SEARCH_NAME(symbol) \
278 (symbol_search_name (&(symbol)->ginfo)) 265 (symbol_search_name (&(symbol)->ginfo))
279 extern char *symbol_search_name (const struct general_symbol_info *); 266 extern const char *symbol_search_name (const struct general_symbol_info *);
280 267
281 /* Analogous to SYMBOL_MATCHES_NATURAL_NAME, but uses the search 268 /* Return non-zero if NAME matches the "search" name of SYMBOL.
282 name. */ 269 Whitespace and trailing parentheses are ignored.
270 See strcmp_iw for details about its behavior. */
283 #define SYMBOL_MATCHES_SEARCH_NAME(symbol, name) \ 271 #define SYMBOL_MATCHES_SEARCH_NAME(symbol, name) \
284 (strcmp_iw (SYMBOL_SEARCH_NAME (symbol), (name)) == 0) 272 (strcmp_iw (SYMBOL_SEARCH_NAME (symbol), (name)) == 0)
285 273
286 /* Classification types for a minimal symbol. These should be taken as 274 /* Classification types for a minimal symbol. These should be taken as
287 "advisory only", since if gdb can't easily figure out a 275 "advisory only", since if gdb can't easily figure out a
288 classification it simply selects mst_unknown. It may also have to 276 classification it simply selects mst_unknown. It may also have to
289 guess when it can't figure out which is a better match between two 277 guess when it can't figure out which is a better match between two
290 types (mst_data versus mst_bss) for example. Since the minimal 278 types (mst_data versus mst_bss) for example. Since the minimal
291 symbol info is sometimes derived from the BFD library's view of a 279 symbol info is sometimes derived from the BFD library's view of a
292 file, we need to live with what information bfd supplies. */ 280 file, we need to live with what information bfd supplies. */
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 327
340 struct general_symbol_info ginfo; 328 struct general_symbol_info ginfo;
341 329
342 /* Size of this symbol. end_psymtab in dbxread.c uses this 330 /* Size of this symbol. end_psymtab in dbxread.c uses this
343 information to calculate the end of the partial symtab based on the 331 information to calculate the end of the partial symtab based on the
344 address of the last symbol plus the size of the last symbol. */ 332 address of the last symbol plus the size of the last symbol. */
345 333
346 unsigned long size; 334 unsigned long size;
347 335
348 /* Which source file is this symbol in? Only relevant for mst_file_*. */ 336 /* Which source file is this symbol in? Only relevant for mst_file_*. */
349 char *filename; 337 const char *filename;
350 338
351 /* Classification type for this minimal symbol. */ 339 /* Classification type for this minimal symbol. */
352 340
353 ENUM_BITFIELD(minimal_symbol_type) type : 8; 341 ENUM_BITFIELD(minimal_symbol_type) type : 8;
354 342
343 /* Non-zero if this symbol was created by gdb.
344 Such symbols do not appear in the output of "info var|fun". */
345 unsigned int created_by_gdb : 1;
346
355 /* Two flag bits provided for the use of the target. */ 347 /* Two flag bits provided for the use of the target. */
356 unsigned int target_flag_1 : 1; 348 unsigned int target_flag_1 : 1;
357 unsigned int target_flag_2 : 1; 349 unsigned int target_flag_2 : 1;
358 350
359 /* Minimal symbols with the same hash key are kept on a linked 351 /* Minimal symbols with the same hash key are kept on a linked
360 list. This is the link. */ 352 list. This is the link. */
361 353
362 struct minimal_symbol *hash_next; 354 struct minimal_symbol *hash_next;
363 355
364 /* Minimal symbols are stored in two different hash tables. This is 356 /* Minimal symbols are stored in two different hash tables. This is
365 the `next' pointer for the demangled hash table. */ 357 the `next' pointer for the demangled hash table. */
366 358
367 struct minimal_symbol *demangled_hash_next; 359 struct minimal_symbol *demangled_hash_next;
368 }; 360 };
369 361
370 #define MSYMBOL_TARGET_FLAG_1(msymbol) (msymbol)->target_flag_1 362 #define MSYMBOL_TARGET_FLAG_1(msymbol) (msymbol)->target_flag_1
371 #define MSYMBOL_TARGET_FLAG_2(msymbol) (msymbol)->target_flag_2 363 #define MSYMBOL_TARGET_FLAG_2(msymbol) (msymbol)->target_flag_2

error: old chunk mismatch

OLDNEW
« no previous file with comments | « gdb/symmisc.c ('k') | gdb/symtab.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698