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