aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-12-16 21:39:16 +0000
committerTom Tromey <tromey@redhat.com>2011-12-16 21:39:16 +0000
commit07fea4b4130330d60119a8068e711ff59725f04e (patch)
treebd6760a0d82f74f7cc778f667e62a4e7e35ce819
parent39b856a4b12bb7dc5a03b1f91f76c4ebc822c5a4 (diff)
downloadfsf-binutils-gdb-07fea4b4130330d60119a8068e711ff59725f04e.zip
fsf-binutils-gdb-07fea4b4130330d60119a8068e711ff59725f04e.tar.gz
fsf-binutils-gdb-07fea4b4130330d60119a8068e711ff59725f04e.tar.bz2
* linespec.c (collect_symbols): Call maybe_add_address after
calling symbol_to_sal. (minsym_found): Call maybe_add_address here. (search_minsyms_for_name): Don't call maybe_add_address.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/linespec.c27
2 files changed, 15 insertions, 19 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 261ad9d..1b94ffd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2011-12-16 Tom Tromey <tromey@redhat.com>
+ * linespec.c (collect_symbols): Call maybe_add_address after
+ calling symbol_to_sal.
+ (minsym_found): Call maybe_add_address here.
+ (search_minsyms_for_name): Don't call maybe_add_address.
+
+2011-12-16 Tom Tromey <tromey@redhat.com>
+
* linespec.c (struct collect_info) <objfile>: Remove field.
(decode_objc): Update.
(find_method): Update.
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 3d9c0c7..4d44478 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -2659,19 +2659,10 @@ collect_symbols (struct symbol *sym, void *data)
struct collect_info *info = data;
struct symtab_and_line sal;
- if ((SYMBOL_CLASS (sym) == LOC_STATIC
- && !info->state->funfirstline
- && !maybe_add_address (info->state->addr_set,
- SYMTAB_PSPACE (SYMBOL_SYMTAB (sym)),
- SYMBOL_VALUE_ADDRESS (sym)))
- || (SYMBOL_CLASS (sym) == LOC_BLOCK
- && !maybe_add_address (info->state->addr_set,
- SYMTAB_PSPACE (SYMBOL_SYMTAB (sym)),
- BLOCK_START (SYMBOL_BLOCK_VALUE (sym)))))
- {
- /* Nothing. */
- }
- else if (symbol_to_sal (&sal, info->state->funfirstline, sym))
+ if (symbol_to_sal (&sal, info->state->funfirstline, sym)
+ && maybe_add_address (info->state->addr_set,
+ SYMTAB_PSPACE (SYMBOL_SYMTAB (sym)),
+ sal.pc))
add_sal_to_sals (info->state, &info->result, &sal,
SYMBOL_NATURAL_NAME (sym));
@@ -2703,7 +2694,8 @@ minsym_found (struct linespec_state *self, struct objfile *objfile,
if (self->funfirstline)
skip_prologue_sal (&sal);
- add_sal_to_sals (self, result, &sal, SYMBOL_NATURAL_NAME (msymbol));
+ if (maybe_add_address (self->addr_set, objfile->pspace, sal.pc))
+ add_sal_to_sals (self, result, &sal, SYMBOL_NATURAL_NAME (msymbol));
}
/* A helper struct which just holds a minimal symbol and the object
@@ -2842,11 +2834,8 @@ search_minsyms_for_name (struct collect_info *info, const char *name,
if (classify_mtype (MSYMBOL_TYPE (item->minsym)) != classification)
break;
- if (maybe_add_address (info->state->addr_set,
- item->objfile->pspace,
- SYMBOL_VALUE_ADDRESS (item->minsym)))
- minsym_found (info->state, item->objfile, item->minsym,
- &info->result);
+ minsym_found (info->state, item->objfile, item->minsym,
+ &info->result);
}
}