* inftarg.c (child_thread_alive): New function to see if a
[deliverable/binutils-gdb.git] / gdb / partial-stab.h
CommitLineData
7e258d18 1/* Shared code to pre-read a stab (dbx-style), when building a psymtab.
576c3913 2 Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995
65ce5df4 3 Free Software Foundation, Inc.
7e258d18
PB
4
5This file is part of GDB.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21/* The following need to be defined:
22 SET_NAMESTRING() --Set namestring to name of symbol.
23 CUR_SYMBOL_TYPE --Type code of current symbol.
24 CUR_SYMBOL_VALUE --Value field of current symbol. May be adjusted here.
48b2d07e
JK
25 namestring - variable pointing to the name of the stab.
26 section_offsets - variable pointing to the section offsets.
27 pst - the partial symbol table being built.
28
29 psymtab_include_list, includes_used, includes_allocated - list of include
30 file names (N_SOL) seen so far.
31 dependency_list, dependencies_used, dependencies_allocated - list of
32 N_EXCL stabs seen so far.
33
34 END_PSYMTAB -- end a partial symbol table.
35 START_PSYMTAB -- start a partial symbol table.
7e258d18
PB
36 */
37
7e258d18
PB
38/* End of macro definitions, now let's handle them symbols! */
39
40 switch (CUR_SYMBOL_TYPE)
41 {
42 char *p;
43 /*
44 * Standard, external, non-debugger, symbols
45 */
46
7e258d18
PB
47 case N_TEXT | N_EXT:
48 case N_NBTEXT | N_EXT:
2670f34d
JG
49 CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
50 goto record_it;
51
52 case N_DATA | N_EXT:
7e258d18 53 case N_NBDATA | N_EXT:
2670f34d
JG
54 CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
55 goto record_it;
56
164207ca 57 case N_BSS:
2670f34d 58 case N_BSS | N_EXT:
7e258d18 59 case N_NBBSS | N_EXT:
2670f34d
JG
60 case N_SETV | N_EXT: /* FIXME, is this in BSS? */
61 CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_BSS);
62 goto record_it;
63
7e258d18 64 case N_ABS | N_EXT:
2670f34d 65 record_it:
aab77d5f 66#ifdef DBXREAD_ONLY
7e258d18
PB
67 SET_NAMESTRING();
68
69 bss_ext_symbol:
1ab3bf1b
JG
70 record_minimal_symbol (namestring, CUR_SYMBOL_VALUE,
71 CUR_SYMBOL_TYPE, objfile); /* Always */
aab77d5f 72#endif /* DBXREAD_ONLY */
7e258d18
PB
73 continue;
74
75 /* Standard, local, non-debugger, symbols */
76
77 case N_NBTEXT:
78
79 /* We need to be able to deal with both N_FN or N_TEXT,
80 because we have no way of knowing whether the sys-supplied ld
81 or GNU ld was used to make the executable. Sequents throw
82 in another wrinkle -- they renumbered N_FN. */
83
84 case N_FN:
85 case N_FN_SEQ:
86 case N_TEXT:
aab77d5f 87#ifdef DBXREAD_ONLY
2670f34d 88 CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
7e258d18
PB
89 SET_NAMESTRING();
90 if ((namestring[0] == '-' && namestring[1] == 'l')
91 || (namestring [(nsl = strlen (namestring)) - 1] == 'o'
7da1e27d 92 && namestring [nsl - 2] == '.')
866ed2b5
JL
93#ifdef GDB_TARGET_IS_HPPA
94 /* This braindamage is necessary for versions of GCC 2.6 and
95 earlier; it will not be necessary for GCC 2.7.
96
97 In a nutshell, we need a way to determine when we've hit
98 the end of a file with debug symbols. Most ports do this
99 with a N_SO record with a NULL symbol name (as will GCC 2.7
100 on the PA). GCC 2.6 (and earlier) on the PA instead creates
101 an N_TEXT symbol with the name "end_file." */
102 || (namestring[0] == 'e' && STREQ (namestring, "end_file."))
103#endif
7da1e27d 104 )
7e258d18 105 {
866ed2b5 106#ifndef GDB_TARGET_IS_HPPA
5e2e79f8 107 if (objfile -> ei.entry_point < CUR_SYMBOL_VALUE &&
2670f34d 108 objfile -> ei.entry_point >= last_o_file_start)
7e258d18 109 {
5e2e79f8
FF
110 objfile -> ei.entry_file_lowpc = last_o_file_start;
111 objfile -> ei.entry_file_highpc = CUR_SYMBOL_VALUE;
7e258d18 112 }
866ed2b5 113#endif
7e258d18
PB
114 if (past_first_source_file && pst
115 /* The gould NP1 uses low values for .o and -l symbols
116 which are not the address. */
369172bb 117 && CUR_SYMBOL_VALUE >= pst->textlow)
7e258d18
PB
118 {
119 END_PSYMTAB (pst, psymtab_include_list, includes_used,
120 symnum * symbol_size, CUR_SYMBOL_VALUE,
121 dependency_list, dependencies_used);
122 pst = (struct partial_symtab *) 0;
123 includes_used = 0;
124 dependencies_used = 0;
125 }
126 else
127 past_first_source_file = 1;
128 last_o_file_start = CUR_SYMBOL_VALUE;
129 }
164207ca
JK
130 else
131 goto record_it;
aab77d5f 132#endif /* DBXREAD_ONLY */
7e258d18
PB
133 continue;
134
135 case N_DATA:
2670f34d 136 CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
164207ca 137 goto record_it;
7e258d18
PB
138
139 case N_UNDF | N_EXT:
aab77d5f 140#ifdef DBXREAD_ONLY
7e258d18
PB
141 if (CUR_SYMBOL_VALUE != 0) {
142 /* This is a "Fortran COMMON" symbol. See if the target
143 environment knows where it has been relocated to. */
144
145 CORE_ADDR reladdr;
146
147 SET_NAMESTRING();
148 if (target_lookup_symbol (namestring, &reladdr)) {
149 continue; /* Error in lookup; ignore symbol for now. */
150 }
151 CUR_SYMBOL_TYPE ^= (N_BSS^N_UNDF); /* Define it as a bss-symbol */
152 CUR_SYMBOL_VALUE = reladdr;
153 goto bss_ext_symbol;
154 }
aab77d5f 155#endif /* DBXREAD_ONLY */
7e258d18 156 continue; /* Just undefined, not COMMON */
7e258d18 157
9342ecb9
JG
158 case N_UNDF:
159#ifdef DBXREAD_ONLY
160 if (processing_acc_compilation && bufp->n_strx == 1) {
bcbf9559
JG
161 /* Deal with relative offsets in the string table
162 used in ELF+STAB under Solaris. If we want to use the
163 n_strx field, which contains the name of the file,
164 we must adjust file_string_table_offset *before* calling
165 SET_NAMESTRING(). */
9342ecb9
JG
166 past_first_source_file = 1;
167 file_string_table_offset = next_file_string_table_offset;
168 next_file_string_table_offset =
169 file_string_table_offset + bufp->n_value;
170 if (next_file_string_table_offset < file_string_table_offset)
171 error ("string table offset backs up at %d", symnum);
172 /* FIXME -- replace error() with complaint. */
173 continue;
174 }
175#endif /* DBXREAD_ONLY */
176 continue;
177
7e258d18
PB
178 /* Lots of symbol types we can just ignore. */
179
7e258d18 180 case N_ABS:
7e258d18
PB
181 case N_NBDATA:
182 case N_NBBSS:
183 continue;
184
185 /* Keep going . . .*/
186
187 /*
188 * Special symbol types for GNU
189 */
190 case N_INDR:
191 case N_INDR | N_EXT:
192 case N_SETA:
193 case N_SETA | N_EXT:
194 case N_SETT:
195 case N_SETT | N_EXT:
196 case N_SETD:
197 case N_SETD | N_EXT:
198 case N_SETB:
199 case N_SETB | N_EXT:
200 case N_SETV:
201 continue;
202
203 /*
204 * Debugger symbols
205 */
206
207 case N_SO: {
fc39be58 208 unsigned long valu;
cdaa27e9
SG
209 static int prev_so_symnum = -10;
210 static int first_so_symnum;
c72af089 211 char *p;
fc39be58
JK
212
213 valu = CUR_SYMBOL_VALUE + ANOFFSET (section_offsets, SECT_OFF_TEXT);
576c3913
PS
214#ifdef SOFUN_ADDRESS_MAYBE_MISSING
215 /* A zero value is probably an indication for the SunPRO 3.0
216 compiler. end_psymtab explicitly tests for zero, so
217 don't relocate it. */
218 if (CUR_SYMBOL_VALUE == 0)
219 valu = 0;
220#endif
fc39be58 221
cdaa27e9
SG
222 past_first_source_file = 1;
223
224 if (prev_so_symnum != symnum - 1)
225 { /* Here if prev stab wasn't N_SO */
226 first_so_symnum = symnum;
227
228 if (pst)
229 {
230 END_PSYMTAB (pst, psymtab_include_list, includes_used,
231 symnum * symbol_size, valu,
232 dependency_list, dependencies_used);
233 pst = (struct partial_symtab *) 0;
234 includes_used = 0;
235 dependencies_used = 0;
236 }
237 }
238
239 prev_so_symnum = symnum;
240
7e258d18
PB
241 /* End the current partial symtab and start a new one */
242
243 SET_NAMESTRING();
244
cad1498f
SG
245 /* Null name means end of .o file. Don't start a new one. */
246 if (*namestring == '\000')
247 continue;
248
c72af089
SG
249 /* Some compilers (including gcc) emit a pair of initial N_SOs.
250 The first one is a directory name; the second the file name.
251 If pst exists, is empty, and has a filename ending in '/',
252 we assume the previous N_SO was a directory name. */
253
323227fe 254 p = strrchr (namestring, '/');
c72af089 255 if (p && *(p+1) == '\000')
cdaa27e9 256 continue; /* Simply ignore directory name SOs */
c72af089
SG
257
258 /* Some other compilers (C++ ones in particular) emit useless
cdaa27e9
SG
259 SOs for non-existant .c files. We ignore all subsequent SOs that
260 immediately follow the first. */
261
262 if (!pst)
263 pst = START_PSYMTAB (objfile, section_offsets,
264 namestring, valu,
265 first_so_symnum * symbol_size,
266 objfile -> global_psymbols.next,
267 objfile -> static_psymbols.next);
7e258d18
PB
268 continue;
269 }
270
7e258d18 271 case N_BINCL:
91f87016 272 {
aab77d5f 273#ifdef DBXREAD_ONLY
91f87016
JL
274 enum language tmp_language;
275 /* Add this bincl to the bincl_list for future EXCLs. No
276 need to save the string; it'll be around until
277 read_dbx_symtab function returns */
7e258d18 278
91f87016
JL
279 SET_NAMESTRING();
280
281 tmp_language = deduce_language_from_filename (namestring);
282
283 /* Only change the psymtab's language if we've learned
284 something useful (eg. tmp_language is not language_unknown).
285 In addition, to match what start_subfile does, never change
286 from C++ to C. */
287 if (tmp_language != language_unknown
288 && (tmp_language != language_c
289 || psymtab_language != language_cplus))
290 psymtab_language = tmp_language;
7e258d18 291
91f87016 292 add_bincl_to_list (pst, namestring, CUR_SYMBOL_VALUE);
7e258d18 293
91f87016 294 /* Mark down an include file in the current psymtab */
7e258d18 295
91f87016 296 goto record_include_file;
7e258d18 297
8a1c3e99 298#else /* DBXREAD_ONLY */
91f87016 299 continue;
8a1c3e99 300#endif
91f87016 301 }
7e258d18
PB
302
303 case N_SOL:
7e258d18 304 {
91f87016
JL
305 enum language tmp_language;
306 /* Mark down an include file in the current psymtab */
307
308 SET_NAMESTRING();
309
310 tmp_language = deduce_language_from_filename (namestring);
311
312 /* Only change the psymtab's language if we've learned
313 something useful (eg. tmp_language is not language_unknown).
314 In addition, to match what start_subfile does, never change
315 from C++ to C. */
316 if (tmp_language != language_unknown
317 && (tmp_language != language_c
318 || psymtab_language != language_cplus))
319 psymtab_language = tmp_language;
320
321 /* In C++, one may expect the same filename to come round many
322 times, when code is coming alternately from the main file
323 and from inline functions in other files. So I check to see
324 if this is a file we've seen before -- either the main
325 source file, or a previously included file.
326
327 This seems to be a lot of time to be spending on N_SOL, but
328 things like "break c-exp.y:435" need to work (I
329 suppose the psymtab_include_list could be hashed or put
330 in a binary tree, if profiling shows this is a major hog). */
331 if (pst && STREQ (namestring, pst->filename))
7e258d18 332 continue;
7e258d18 333 {
91f87016
JL
334 register int i;
335 for (i = 0; i < includes_used; i++)
336 if (STREQ (namestring, psymtab_include_list[i]))
337 {
338 i = -1;
339 break;
340 }
341 if (i == -1)
342 continue;
7e258d18 343 }
91f87016
JL
344
345#ifdef DBXREAD_ONLY
346 record_include_file:
347#endif
348
349 psymtab_include_list[includes_used++] = namestring;
350 if (includes_used >= includes_allocated)
351 {
352 char **orig = psymtab_include_list;
353
354 psymtab_include_list = (char **)
355 alloca ((includes_allocated *= 2) *
356 sizeof (char *));
357 memcpy ((PTR)psymtab_include_list, (PTR)orig,
358 includes_used * sizeof (char *));
359 }
360 continue;
361 }
7e258d18
PB
362 case N_LSYM: /* Typedef or automatic variable. */
363 case N_STSYM: /* Data seg var -- static */
364 case N_LCSYM: /* BSS " */
2670f34d 365 case N_ROSYM: /* Read-only data seg var -- static. */
7e258d18
PB
366 case N_NBSTS: /* Gould nobase. */
367 case N_NBLCS: /* symbols. */
4ae030b9
JK
368 case N_FUN:
369 case N_GSYM: /* Global (extern) variable; can be
370 data or bss (sigh FIXME). */
371
372 /* Following may probably be ignored; I'll leave them here
373 for now (until I do Pascal and Modula 2 extensions). */
374
375 case N_PC: /* I may or may not need this; I
376 suspect not. */
377 case N_M2C: /* I suspect that I can ignore this here. */
378 case N_SCOPE: /* Same. */
7e258d18
PB
379
380 SET_NAMESTRING();
381
382 p = (char *) strchr (namestring, ':');
4ae030b9
JK
383 if (!p)
384 continue; /* Not a debugging symbol. */
7e258d18 385
4ae030b9
JK
386
387
388 /* Main processing section for debugging symbols which
389 the initial read through the symbol tables needs to worry
390 about. If we reach this point, the symbol which we are
391 considering is definitely one we are interested in.
392 p must also contain the (valid) index into the namestring
393 which indicates the debugging type symbol. */
7e258d18
PB
394
395 switch (p[1])
396 {
4ae030b9
JK
397 case 'S':
398 CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
137a07e6
JK
399#ifdef STATIC_TRANSFORM_NAME
400 namestring = STATIC_TRANSFORM_NAME (namestring);
401#endif
4ae030b9
JK
402 ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring,
403 VAR_NAMESPACE, LOC_STATIC,
404 objfile->static_psymbols,
405 CUR_SYMBOL_VALUE,
406 psymtab_language, objfile);
407 continue;
408 case 'G':
409 CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
410 /* The addresses in these entries are reported to be
411 wrong. See the code that reads 'G's for symtabs. */
412 ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring,
413 VAR_NAMESPACE, LOC_STATIC,
414 objfile->global_psymbols,
415 CUR_SYMBOL_VALUE,
416 psymtab_language, objfile);
417 continue;
418
7e258d18 419 case 'T':
bcbf9559 420 if (p != namestring) /* a name is there, not just :T... */
7e258d18 421 {
7e258d18 422 ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
bcbf9559 423 STRUCT_NAMESPACE, LOC_TYPEDEF,
2e4964ad
FF
424 objfile->static_psymbols,
425 CUR_SYMBOL_VALUE,
426 psymtab_language, objfile);
bcbf9559
JG
427 if (p[2] == 't')
428 {
429 /* Also a typedef with the same name. */
430 ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
431 VAR_NAMESPACE, LOC_TYPEDEF,
2e4964ad
FF
432 objfile->static_psymbols,
433 CUR_SYMBOL_VALUE, psymtab_language,
434 objfile);
bcbf9559
JG
435 p += 1;
436 }
91f87016
JL
437 /* The semantics of C++ state that "struct foo { ... }"
438 also defines a typedef for "foo". Unfortuantely, cfront
439 never makes the typedef when translating from C++ to C.
440 We make the typedef here so that "ptype foo" works as
441 expected for cfront translated code. */
442 else if (psymtab_language == language_cplus)
443 {
444 /* Also a typedef with the same name. */
445 ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
446 VAR_NAMESPACE, LOC_TYPEDEF,
447 objfile->static_psymbols,
448 CUR_SYMBOL_VALUE, psymtab_language,
449 objfile);
450 }
7e258d18
PB
451 }
452 goto check_enum;
453 case 't':
bcbf9559
JG
454 if (p != namestring) /* a name is there, not just :T... */
455 {
456 ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
457 VAR_NAMESPACE, LOC_TYPEDEF,
2e4964ad
FF
458 objfile->static_psymbols,
459 CUR_SYMBOL_VALUE,
460 psymtab_language, objfile);
bcbf9559 461 }
7e258d18 462 check_enum:
7e258d18
PB
463 /* If this is an enumerated type, we need to
464 add all the enum constants to the partial symbol
465 table. This does not cover enums without names, e.g.
466 "enum {a, b} c;" in C, but fortunately those are
467 rare. There is no way for GDB to find those from the
468 enum type without spending too much time on it. Thus
4ae030b9
JK
469 to solve this problem, the compiler needs to put out the
470 enum in a nameless type. GCC2 does this. */
7e258d18
PB
471
472 /* We are looking for something of the form
473 <name> ":" ("t" | "T") [<number> "="] "e"
474 {<constant> ":" <value> ","} ";". */
475
476 /* Skip over the colon and the 't' or 'T'. */
477 p += 2;
478 /* This type may be given a number. Also, numbers can come
479 in pairs like (0,26). Skip over it. */
480 while ((*p >= '0' && *p <= '9')
481 || *p == '(' || *p == ',' || *p == ')'
482 || *p == '=')
483 p++;
484
485 if (*p++ == 'e')
486 {
487 /* We have found an enumerated type. */
488 /* According to comments in read_enum_type
489 a comma could end it instead of a semicolon.
490 I don't know where that happens.
491 Accept either. */
492 while (*p && *p != ';' && *p != ',')
493 {
494 char *q;
495
496 /* Check for and handle cretinous dbx symbol name
497 continuation! */
91a0575c 498 if (*p == '\\' || (*p == '?' && p[1] == '\0'))
7e258d18
PB
499 p = next_symbol_text ();
500
501 /* Point to the character after the name
502 of the enum constant. */
503 for (q = p; *q && *q != ':'; q++)
504 ;
505 /* Note that the value doesn't matter for
506 enum constants in psymtabs, just in symtabs. */
507 ADD_PSYMBOL_TO_LIST (p, q - p,
508 VAR_NAMESPACE, LOC_CONST,
2e4964ad
FF
509 objfile->static_psymbols, 0,
510 psymtab_language, objfile);
7e258d18
PB
511 /* Point past the name. */
512 p = q;
513 /* Skip over the value. */
514 while (*p && *p != ',')
515 p++;
516 /* Advance past the comma. */
517 if (*p)
518 p++;
519 }
520 }
7e258d18
PB
521 continue;
522 case 'c':
523 /* Constant, e.g. from "const" in Pascal. */
524 ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
525 VAR_NAMESPACE, LOC_CONST,
2e4964ad
FF
526 objfile->static_psymbols, CUR_SYMBOL_VALUE,
527 psymtab_language, objfile);
7e258d18 528 continue;
7e258d18
PB
529
530 case 'f':
2fe3b329 531 CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
9342ecb9
JG
532#ifdef DBXREAD_ONLY
533 /* Kludges for ELF/STABS with Sun ACC */
534 last_function_name = namestring;
2d336b1b 535#ifdef SOFUN_ADDRESS_MAYBE_MISSING
a66e8382
SG
536 /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
537 value for the bottom of the text seg in those cases. */
538 if (pst && pst->textlow == 0 && !symfile_relocatable)
2d336b1b
JK
539 pst->textlow =
540 find_stab_function_addr (namestring, pst, objfile);
541#endif
9342ecb9
JG
542#if 0
543 if (startup_file_end == 0)
544 startup_file_end = CUR_SYMBOL_VALUE;
545#endif
546 /* End kludge. */
547#endif /* DBXREAD_ONLY */
7e258d18
PB
548 ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
549 VAR_NAMESPACE, LOC_BLOCK,
2e4964ad
FF
550 objfile->static_psymbols, CUR_SYMBOL_VALUE,
551 psymtab_language, objfile);
7e258d18
PB
552 continue;
553
554 /* Global functions were ignored here, but now they
555 are put into the global psymtab like one would expect.
65ce5df4 556 They're also in the minimal symbol table. */
7e258d18 557 case 'F':
2fe3b329 558 CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
9342ecb9
JG
559#ifdef DBXREAD_ONLY
560 /* Kludges for ELF/STABS with Sun ACC */
561 last_function_name = namestring;
2d336b1b 562#ifdef SOFUN_ADDRESS_MAYBE_MISSING
a66e8382
SG
563 /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
564 value for the bottom of the text seg in those cases. */
565 if (pst && pst->textlow == 0 && !symfile_relocatable)
2d336b1b
JK
566 pst->textlow =
567 find_stab_function_addr (namestring, pst, objfile);
568#endif
9342ecb9
JG
569#if 0
570 if (startup_file_end == 0)
571 startup_file_end = CUR_SYMBOL_VALUE;
572#endif
573 /* End kludge. */
574#endif /* DBXREAD_ONLY */
7e258d18
PB
575 ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
576 VAR_NAMESPACE, LOC_BLOCK,
2e4964ad
FF
577 objfile->global_psymbols, CUR_SYMBOL_VALUE,
578 psymtab_language, objfile);
7e258d18
PB
579 continue;
580
581 /* Two things show up here (hopefully); static symbols of
582 local scope (static used inside braces) or extensions
583 of structure symbols. We can ignore both. */
584 case 'V':
585 case '(':
586 case '0':
587 case '1':
588 case '2':
589 case '3':
590 case '4':
591 case '5':
592 case '6':
593 case '7':
594 case '8':
595 case '9':
fb494327 596 case '-':
7e258d18
PB
597 continue;
598
9d271503
JK
599 case ':':
600 /* It is a C++ nested symbol. We don't need to record it
601 (I don't think); if we try to look up foo::bar::baz,
602 then symbols for the symtab containing foo should get
603 read in, I think. */
604 /* Someone says sun cc puts out symbols like
7e258d18
PB
605 /foo/baz/maclib::/usr/local/bin/maclib,
606 which would get here with a symbol type of ':'. */
9d271503
JK
607 continue;
608
609 default:
610 /* Unexpected symbol descriptor. The second and subsequent stabs
611 of a continued stab can show up here. The question is
612 whether they ever can mimic a normal stab--it would be
613 nice if not, since we certainly don't want to spend the
614 time searching to the end of every string looking for
615 a backslash. */
616
65ce5df4 617 complain (&unknown_symchar_complaint, p[1]);
9d271503
JK
618
619 /* Ignore it; perhaps it is an extension that we don't
620 know about. */
7e258d18
PB
621 continue;
622 }
623
7e258d18 624 case N_EXCL:
aab77d5f 625#ifdef DBXREAD_ONLY
7e258d18
PB
626
627 SET_NAMESTRING();
628
629 /* Find the corresponding bincl and mark that psymtab on the
630 psymtab dependency list */
631 {
632 struct partial_symtab *needed_pst =
633 find_corresponding_bincl_psymtab (namestring, CUR_SYMBOL_VALUE);
634
635 /* If this include file was defined earlier in this file,
636 leave it alone. */
637 if (needed_pst == pst) continue;
638
639 if (needed_pst)
640 {
641 int i;
642 int found = 0;
643
644 for (i = 0; i < dependencies_used; i++)
645 if (dependency_list[i] == needed_pst)
646 {
647 found = 1;
648 break;
649 }
650
651 /* If it's already in the list, skip the rest. */
652 if (found) continue;
653
654 dependency_list[dependencies_used++] = needed_pst;
655 if (dependencies_used >= dependencies_allocated)
656 {
657 struct partial_symtab **orig = dependency_list;
658 dependency_list =
659 (struct partial_symtab **)
660 alloca ((dependencies_allocated *= 2)
661 * sizeof (struct partial_symtab *));
be772100 662 memcpy ((PTR)dependency_list, (PTR)orig,
7e258d18
PB
663 (dependencies_used
664 * sizeof (struct partial_symtab *)));
665#ifdef DEBUG_INFO
199b2450
TL
666 fprintf_unfiltered (gdb_stderr, "Had to reallocate dependency list.\n");
667 fprintf_unfiltered (gdb_stderr, "New dependencies allocated: %d\n",
7e258d18
PB
668 dependencies_allocated);
669#endif
670 }
671 }
7e258d18 672 }
aab77d5f 673#endif /* DBXREAD_ONLY */
7e258d18 674 continue;
7e258d18
PB
675
676 case N_RBRAC:
677#ifdef HANDLE_RBRAC
678 HANDLE_RBRAC(CUR_SYMBOL_VALUE);
aab77d5f 679 continue;
7e258d18
PB
680#endif
681 case N_EINCL:
682 case N_DSLINE:
683 case N_BSLINE:
684 case N_SSYM: /* Claim: Structure or union element.
685 Hopefully, I can ignore this. */
686 case N_ENTRY: /* Alternate entry point; can ignore. */
687 case N_MAIN: /* Can definitely ignore this. */
688 case N_CATCH: /* These are GNU C++ extensions */
689 case N_EHDECL: /* that can safely be ignored here. */
690 case N_LENG:
691 case N_BCOMM:
692 case N_ECOMM:
693 case N_ECOML:
694 case N_FNAME:
695 case N_SLINE:
696 case N_RSYM:
697 case N_PSYM:
698 case N_LBRAC:
699 case N_NSYMS: /* Ultrix 4.0: symbol count */
700 case N_DEFD: /* GNU Modula-2 */
9342ecb9 701
4c7c6bab 702 case N_OBJ: /* useless types from Solaris */
9342ecb9 703 case N_OPT:
4c7c6bab 704 case N_ENDM:
7e258d18
PB
705 /* These symbols aren't interesting; don't worry about them */
706
707 continue;
708
709 default:
7e258d18
PB
710 /* If we haven't found it yet, ignore it. It's probably some
711 new type we don't know about yet. */
51b80b00 712 complain (&unknown_symtype_complaint,
833e0d94 713 local_hex_string (CUR_SYMBOL_TYPE));
7e258d18
PB
714 continue;
715 }
This page took 0.22647 seconds and 4 git commands to generate.