aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2009-04-16 17:21:06 +0000
committerJoel Brobecker <brobecker@gnat.com>2009-04-16 17:21:06 +0000
commit6f38eac82e6519916e5e71193fcdaef65d19fc43 (patch)
tree83b04110314bd1254f5a25673803ba3ba84373d6
parentf9bc20b9bed700cb200d59ef8afb4745ad6bfc0f (diff)
downloadgdb-6f38eac82e6519916e5e71193fcdaef65d19fc43.zip
gdb-6f38eac82e6519916e5e71193fcdaef65d19fc43.tar.gz
gdb-6f38eac82e6519916e5e71193fcdaef65d19fc43.tar.bz2
* ada-lang.c (symtab_for_sym): Delete.
(user_select_syms): Use sym->symtab instead of calling symtab_for_sym.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ada-lang.c61
2 files changed, 6 insertions, 60 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ccbdfea..3e20aa8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2009-04-16 Joel Brobecker <brobecker@adacore.com>
+ * ada-lang.c (symtab_for_sym): Delete.
+ (user_select_syms): Use sym->symtab instead of calling symtab_for_sym.
+
+2009-04-16 Joel Brobecker <brobecker@adacore.com>
+
* ada-lang.c (extract_string): Delete.
(ada_main_name): Reimplement using target_read_string instead of
extract_string.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 814a793..09d6897 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -126,8 +126,6 @@ static struct partial_symbol *ada_lookup_partial_symbol (struct partial_symtab
*, const char *, int,
domain_enum, int);
-static struct symtab *symtab_for_sym (struct symbol *);
-
static struct value *resolve_subexp (struct expression **, int *, int,
struct type *);
@@ -3281,7 +3279,7 @@ See set/show multiple-symbol."));
(SYMBOL_CLASS (syms[i].sym) == LOC_CONST
&& SYMBOL_TYPE (syms[i].sym) != NULL
&& TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) == TYPE_CODE_ENUM);
- struct symtab *symtab = symtab_for_sym (syms[i].sym);
+ struct symtab *symtab = syms[i].sym->symtab;
if (SYMBOL_LINE (syms[i].sym) != 0 && symtab != NULL)
printf_unfiltered (_("[%d] %s at %s:%d\n"),
@@ -4200,63 +4198,6 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name,
return NULL;
}
-/* Find a symbol table containing symbol SYM or NULL if none. */
-
-static struct symtab *
-symtab_for_sym (struct symbol *sym)
-{
- struct symtab *s;
- struct objfile *objfile;
- struct block *b;
- struct symbol *tmp_sym;
- struct dict_iterator iter;
- int j;
-
- ALL_PRIMARY_SYMTABS (objfile, s)
- {
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_CONST:
- case LOC_STATIC:
- case LOC_TYPEDEF:
- case LOC_REGISTER:
- case LOC_LABEL:
- case LOC_BLOCK:
- case LOC_CONST_BYTES:
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
- ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym)
- return s;
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
- ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym)
- return s;
- break;
- default:
- break;
- }
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM_ADDR:
- case LOC_LOCAL:
- case LOC_TYPEDEF:
- case LOC_COMPUTED:
- for (j = FIRST_LOCAL_BLOCK;
- j < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)); j += 1)
- {
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), j);
- ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym)
- return s;
- }
- break;
- default:
- break;
- }
- }
- return NULL;
-}
-
/* Return a minimal symbol matching NAME according to Ada decoding
rules. Returns NULL if there is no such minimal symbol. Names
prefixed with "standard__" are handled specially: "standard__" is