X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fsymtab.c;h=622e27788cab7d6919011413cabe13d669543c47;hb=0d5f99947baa22a5dda53be002c3885ffe311ca5;hp=d984a35420544d8f5cdeb160951f0885602a4ea8;hpb=aa1ee363bce1eac43bf9824069e231d7113f7453;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/symtab.c b/gdb/symtab.c index d984a35420..622e27788c 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1,7 +1,7 @@ /* Symbol table lookup for the GNU debugger, GDB. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, - 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -114,8 +114,6 @@ struct symbol *lookup_symbol_aux_minsyms (const char *name, struct symtab **symtab); #endif -static struct symbol *find_active_alias (struct symbol *sym, CORE_ADDR addr); - /* This flag is used in hppa-tdep.c, and set in hp-symtab-read.c */ /* Signals the presence of objects compiled by HP compilers */ int hp_som_som_object_present = 0; @@ -345,7 +343,7 @@ gdb_mangle_name (struct type *type, int method_id, int signature_id) is_full_physname_constructor = is_constructor_name (physname); is_constructor = - is_full_physname_constructor || (newname && STREQ (field_name, newname)); + is_full_physname_constructor || (newname && strcmp (field_name, newname) == 0); if (!is_destructor) is_destructor = (strncmp (physname, "__dt", 4) == 0); @@ -487,7 +485,7 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol, /* Set both the mangled and demangled (if any) names for GSYMBOL based on LINKAGE_NAME and LEN. The hash table corresponding to OBJFILE - is used, and the memory comes from that objfile's symbol_obstack. + is used, and the memory comes from that objfile's objfile_obstack. LINKAGE_NAME is copied, so the pointer can be discarded after calling this function. */ @@ -574,7 +572,7 @@ symbol_set_names (struct general_symbol_info *gsymbol, /* If there is a demangled name, place it right after the mangled name. Otherwise, just place a second zero byte after the end of the mangled name. */ - *slot = obstack_alloc (&objfile->symbol_obstack, + *slot = obstack_alloc (&objfile->objfile_obstack, lookup_len + demangled_len + 2); memcpy (*slot, lookup_name, lookup_len + 1); if (demangled_name != NULL) @@ -1482,15 +1480,23 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, } /* Look up a type named NAME in the struct_domain. The type returned - must not be opaque -- i.e., must have at least one field defined + must not be opaque -- i.e., must have at least one field + defined. */ - This code was modelled on lookup_symbol -- the parts not relevant to looking - up types were just left out. In particular it's assumed here that types - are available in struct_domain and only at file-static or global blocks. */ +struct type * +lookup_transparent_type (const char *name) +{ + return current_language->la_lookup_transparent_type (name); +} +/* The standard implementation of lookup_transparent_type. This code + was modeled on lookup_symbol -- the parts not relevant to looking + up types were just left out. In particular it's assumed here that + types are available in struct_domain and only at file-static or + global blocks. */ struct type * -lookup_transparent_type (const char *name) +basic_lookup_transparent_type (const char *name) { struct symbol *sym; struct symtab *s = NULL; @@ -1668,29 +1674,6 @@ lookup_block_symbol (const struct block *block, const char *name, && (linkage_name != NULL ? strcmp (SYMBOL_LINKAGE_NAME (sym), linkage_name) == 0 : 1)) { - /* If SYM has aliases, then use any alias that is active - at the current PC. If no alias is active at the current - PC, then use the main symbol. - - ?!? Is checking the current pc correct? Is this routine - ever called to look up a symbol from another context? - - FIXME: No, it's not correct. If someone sets a - conditional breakpoint at an address, then the - breakpoint's `struct expression' should refer to the - `struct symbol' appropriate for the breakpoint's - address, which may not be the PC. - - Even if it were never called from another context, - it's totally bizarre for lookup_symbol's behavior to - depend on the value of the inferior's current PC. We - should pass in the appropriate PC as well as the - block. The interface to lookup_symbol should change - to require the caller to provide a PC. */ - - if (SYMBOL_ALIASES (sym)) - sym = find_active_alias (sym, read_pc ()); - sym_found = sym; if (SYMBOL_CLASS (sym) != LOC_ARG && SYMBOL_CLASS (sym) != LOC_LOCAL_ARG && @@ -1708,38 +1691,6 @@ lookup_block_symbol (const struct block *block, const char *name, } } -/* Given a main symbol SYM and ADDR, search through the alias - list to determine if an alias is active at ADDR and return - the active alias. - - If no alias is active, then return SYM. */ - -static struct symbol * -find_active_alias (struct symbol *sym, CORE_ADDR addr) -{ - struct range_list *r; - struct alias_list *aliases; - - /* If we have aliases, check them first. */ - aliases = SYMBOL_ALIASES (sym); - - while (aliases) - { - if (!SYMBOL_RANGES (aliases->sym)) - return aliases->sym; - for (r = SYMBOL_RANGES (aliases->sym); r; r = r->next) - { - if (r->start <= addr && r->end > addr) - return aliases->sym; - } - aliases = aliases->next; - } - - /* Nothing found, return the main symbol. */ - return sym; -} - - /* Find the symtab associated with PC and SECTION. Look through the psymtabs and read in another symtab if necessary. */ @@ -1872,7 +1823,7 @@ find_pc_symtab (CORE_ADDR pc) /* If it's worth the effort, we could be using a binary search. */ struct symtab_and_line -find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent) +find_pc_sect_line (CORE_ADDR pc, struct bfd_section *section, int notcurrent) { struct symtab *s; struct linetable *l; @@ -1969,7 +1920,7 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent) if (MSYMBOL_TYPE (msymbol) == mst_solib_trampoline) { mfunsym = lookup_minimal_symbol_text (SYMBOL_LINKAGE_NAME (msymbol), - NULL, NULL); + NULL); if (mfunsym == NULL) /* I eliminated this warning since it is coming out * in the following situation: @@ -2182,7 +2133,7 @@ find_line_symtab (struct symtab *symtab, int line, int *index, int *exact_match) struct linetable *l; int ind; - if (!STREQ (symtab->filename, s->filename)) + if (strcmp (symtab->filename, s->filename) != 0) continue; l = LINETABLE (s); ind = find_line_common (l, line, &exact); @@ -2371,10 +2322,6 @@ find_function_start_sal (struct symbol *sym, int funfirstline) } sal = find_pc_sect_line (pc, SYMBOL_BFD_SECTION (sym), 0); -#ifdef PROLOGUE_FIRSTLINE_OVERLAP - /* Convex: no need to suppress code on first line, if any */ - sal.pc = pc; -#else /* Check if SKIP_PROLOGUE left us in mid-line, and the next line is still part of the same function. */ if (sal.pc != pc @@ -2387,7 +2334,6 @@ find_function_start_sal (struct symbol *sym, int funfirstline) sal = find_pc_sect_line (pc, SYMBOL_BFD_SECTION (sym), 0); } sal.pc = pc; -#endif return sal; } @@ -3930,7 +3876,7 @@ decode_line_spec (char *string, int funfirstline) sals = decode_line_1 (&string, funfirstline, cursal.symtab, cursal.line, - (char ***) NULL); + (char ***) NULL, NULL); if (*string) error ("Junk at end of line specification: %s", string);