diff options
author | Peter Schauer <Peter.Schauer@mytum.de> | 1994-03-30 09:57:08 +0000 |
---|---|---|
committer | Peter Schauer <Peter.Schauer@mytum.de> | 1994-03-30 09:57:08 +0000 |
commit | db2302cb933984f307b2175d7ffaa86ccd41c2a0 (patch) | |
tree | d5585b0351adeed20e2f4beb923f2e104021c4d3 /gdb/mdebugread.c | |
parent | 1f655b81a6deae5fc9aacaf0eae8acfc516b18f3 (diff) | |
download | gdb-db2302cb933984f307b2175d7ffaa86ccd41c2a0.zip gdb-db2302cb933984f307b2175d7ffaa86ccd41c2a0.tar.gz gdb-db2302cb933984f307b2175d7ffaa86ccd41c2a0.tar.bz2 |
* ch-exp.y (decode_integer_value, match_character_literal,
match_bitstring_literal): Guard tolower calls with isupper,
tolower on old BSD systems blindly subtracts a constant.
* dbxread.c (read_ofile_symtab): Check for __gnu_compiled_* as
well when determining the producer of the object file.
* mdebugread.c (has_opaque_xref): New function to check for
cross reference to an opaque aggregate.
* mdebugread.c (parse_symbol, parse_partial_symbols): Do not
enter typedefs to opaque aggregates into the symbol tables.
* mdebugread.c (parse_external): Remove skip_procedures argument,
it has always been 1. Remove code that handled stProc symbols,
it was never executed and was wrong, as the index of a
stProc symbol points to the local symbol table and not to the
auxiliary symbol info. Update caller.
* mdebugread.c (parse_partial_symbols): Do not enter external
stProc symbols into the partial symbol table, they are already
entered into the minimal symbol table.
* config/i386/tm-symmetry.h: Clean up, it is now only used for Dynix.
Remove all conditionals and definitions for ptx.
I386_REGNO_TO_SYMMETRY moved to here from symm-tdep.c.
Fix addresses of floating point registers in REGISTER_U_ADDR.
STORE_STRUCT_RETURN now handles cc and gcc conventions.
FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC,
IN_SIGTRAMP, SIGCONTEXT_PC_OFFSET defined to make backtracing through
signal trampoline code work.
* config/i386/xm-symmetry.h: Clean up, it is now only used for Dynix.
Remove all conditionals and definitions for ptx.
Remove KDB definitions.
* symm-nat.c (store_inferior_registers): Fetch registers before
storing them to obtain valid floating point control registers.
Store fpu registers.
* symm-nat.c (print_1167_control_word): Dynix 3.1.1 defines
FPA_PCR_CC_C0 and FPA_PCR_CC_C1, avoid duplicate case value.
* symm-nat.c (fetch_inferior_registers, child_xfer_memory):
Fix typos.
* symm-nat.c (child_resume): Update type of `signal' parameter.
* symm-tdep.c (I386_REGNO_TO_SYMMETRY): Moved to tm-symmetry.h.
Diffstat (limited to 'gdb/mdebugread.c')
-rw-r--r-- | gdb/mdebugread.c | 87 |
1 files changed, 62 insertions, 25 deletions
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 7471f1e..b302418 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -293,6 +293,9 @@ static FDR *get_rfd PARAMS ((int, int)); static int +has_opaque_xref PARAMS ((FDR *, SYMR *)); + +static int cross_ref PARAMS ((int, union aux_ext *, struct type **, enum type_code, char **, int, char *)); @@ -1235,6 +1238,11 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets) to struct foo sometimes is given as `foo *' instead of `struct foo *'. The problem is fixed with alpha cc. */ + /* However if the typedef cross references to an opaque aggregate, it + is safe to omit it from the symbol table. */ + + if (has_opaque_xref (cur_fdr, sh)) + break; s = new_symbol (name); SYMBOL_NAMESPACE (s) = VAR_NAMESPACE; SYMBOL_CLASS (s) = LOC_TYPEDEF; @@ -1856,18 +1864,16 @@ ecoff_relocate_efi (sym, delta) } /* Parse the external symbol ES. Just call parse_symbol() after - making sure we know where the aux are for it. For procedures, - parsing of the PDRs has already provided all the needed - information, we only parse them if SKIP_PROCEDURES is false, - and only if this causes no symbol duplication. + making sure we know where the aux are for it. BIGEND says whether aux entries are big-endian or little-endian. This routine clobbers top_stack->cur_block and ->cur_st. */ +static void parse_external PARAMS ((EXTR *, int, struct section_offsets *)); + static void -parse_external (es, skip_procedures, bigend, section_offsets) +parse_external (es, bigend, section_offsets) EXTR *es; - int skip_procedures; int bigend; struct section_offsets *section_offsets; { @@ -1924,14 +1930,17 @@ parse_external (es, skip_procedures, bigend, section_offsets) switch (es->asym.st) { case stProc: - /* If we have full symbols we do not need more */ - if (skip_procedures) - return; - if (mylookup_symbol (debug_info->ssext + es->asym.iss, - top_stack->cur_block, - VAR_NAMESPACE, LOC_BLOCK)) - break; - /* fall through */ + case stStaticProc: + /* There is no need to parse the external procedure symbols. + If they are from objects compiled without -g, their index will + be indexNil, and the symbol definition from the minimal symbol + is preferrable (yielding a function returning int instead of int). + If the index points to a local procedure symbol, the local + symbol already provides the correct type. + Note that the index of the external procedure symbol points + to the local procedure symbol in the local symbol table, and + _not_ to the auxiliary symbol info. */ + break; case stGlobal: case stLabel: /* Note that the case of a symbol with indexNil must be handled @@ -2477,8 +2486,8 @@ parse_partial_symbols (objfile, section_offsets) case stTypedef:/* Typedef */ /* Skip typedefs for forward declarations and opaque - structs from alpha cc. */ - if (sh.iss == 0) + structs from alpha and mips cc. */ + if (sh.iss == 0 || has_opaque_xref (fh, &sh)) goto skip; class = LOC_TYPEDEF; break; @@ -2571,14 +2580,10 @@ parse_partial_symbols (objfile, section_offsets) continue; case stProc: case stStaticProc: - /* If the index of the global symbol is not indexNil, - it points to the local stProc symbol with the same - name, which has already been entered into the - partial symbol table above. */ - if (psh->index != indexNil) - continue; - class = LOC_BLOCK; - break; + /* External procedure symbols have been entered + into the minimal symbol table in pass 2 above. + Ignore them, as parse_external will ignore them too. */ + continue; case stLabel: class = LOC_LABEL; break; @@ -3067,7 +3072,7 @@ psymtab_to_symtab_1 (pst, filename) ext_ptr = PST_PRIVATE (pst)->extern_tab; for (i = PST_PRIVATE (pst)->extern_count; --i >= 0; ext_ptr++) - parse_external (ext_ptr, 1, fh->fBigendian, pst->section_offsets); + parse_external (ext_ptr, fh->fBigendian, pst->section_offsets); /* If there are undefined symbols, tell the user. The alpha has an undefined symbol for every symbol that is @@ -3099,6 +3104,38 @@ psymtab_to_symtab_1 (pst, filename) /* Ancillary parsing procedures. */ +/* Return 1 if the symbol pointed to by SH has a cross reference + to an opaque aggregate type, else 0. */ + +static int +has_opaque_xref (fh, sh) + FDR *fh; + SYMR *sh; +{ + TIR tir; + union aux_ext *ax; + RNDXR rn[1]; + unsigned int rf; + + if (sh->index == indexNil) + return 0; + + ax = debug_info->external_aux + fh->iauxBase + sh->index; + ecoff_swap_tir_in (fh->fBigendian, &ax->a_ti, &tir); + if (tir.bt != btStruct && tir.bt != btUnion && tir.bt != btEnum) + return 0; + + ax++; + ecoff_swap_rndx_in (fh->fBigendian, &ax->a_rndx, rn); + if (rn->rfd == 0xfff) + rf = AUX_GET_ISYM (fh->fBigendian, ax + 1); + else + rf = rn->rfd; + if (rf != -1) + return 0; + return 1; +} + /* Lookup the type at relative index RN. Return it in TPP if found and in any event come up with its name PNAME. BIGEND says whether aux symbols are big-endian or not (from fh->fBigendian). |