This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[1/3] RFC: use PSYMBOL_CLASS
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 16 Jan 2013 09:08:12 -0700
- Subject: [1/3] RFC: use PSYMBOL_CLASS
psympriv.h defines PSYMBOL_CLASS, but it isn't always used.
This patch fixes spots still using SYMBOL_CLASS to use PSYMBOL_CLASS
instead.
This is just preparation for the next patch, but I think it is a
reasonable cleanup on its own. As we've discussed a few times now, in
the long run I think we should separate all the symbol accessors to
avoid this phony polymorphism.
Built and regtested on x86-64 Fedora 16.
Tom
* psymtab.c (find_pc_sect_psymbol, fixup_psymbol_section)
(print_partial_symbols, recursively_search_psymtabs): Use
PSYMBOL_CLASS.
---
gdb/psymtab.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 24aef99..38e9359 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -435,7 +435,7 @@ find_pc_sect_psymbol (struct objfile *objfile,
{
p = *pp;
if (SYMBOL_DOMAIN (p) == VAR_DOMAIN
- && SYMBOL_CLASS (p) == LOC_BLOCK
+ && PSYMBOL_CLASS (p) == LOC_BLOCK
&& pc >= SYMBOL_VALUE_ADDRESS (p)
&& (SYMBOL_VALUE_ADDRESS (p) > best_pc
|| (psymtab->textlow == 0
@@ -459,7 +459,7 @@ find_pc_sect_psymbol (struct objfile *objfile,
{
p = *pp;
if (SYMBOL_DOMAIN (p) == VAR_DOMAIN
- && SYMBOL_CLASS (p) == LOC_BLOCK
+ && PSYMBOL_CLASS (p) == LOC_BLOCK
&& pc >= SYMBOL_VALUE_ADDRESS (p)
&& (SYMBOL_VALUE_ADDRESS (p) > best_pc
|| (psymtab->textlow == 0
@@ -489,7 +489,7 @@ fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
gdb_assert (objfile);
- switch (SYMBOL_CLASS (psym))
+ switch (PSYMBOL_CLASS (psym))
{
case LOC_STATIC:
case LOC_LABEL:
@@ -905,7 +905,7 @@ print_partial_symbols (struct gdbarch *gdbarch,
fputs_filtered ("<invalid domain>, ", outfile);
break;
}
- switch (SYMBOL_CLASS (*p))
+ switch (PSYMBOL_CLASS (*p))
{
case LOC_UNDEF:
fputs_filtered ("undefined", outfile);
@@ -1347,12 +1347,12 @@ recursively_search_psymtabs (struct partial_symtab *ps,
if ((kind == ALL_DOMAIN
|| (kind == VARIABLES_DOMAIN
- && SYMBOL_CLASS (*psym) != LOC_TYPEDEF
- && SYMBOL_CLASS (*psym) != LOC_BLOCK)
+ && PSYMBOL_CLASS (*psym) != LOC_TYPEDEF
+ && PSYMBOL_CLASS (*psym) != LOC_BLOCK)
|| (kind == FUNCTIONS_DOMAIN
- && SYMBOL_CLASS (*psym) == LOC_BLOCK)
+ && PSYMBOL_CLASS (*psym) == LOC_BLOCK)
|| (kind == TYPES_DOMAIN
- && SYMBOL_CLASS (*psym) == LOC_TYPEDEF))
+ && PSYMBOL_CLASS (*psym) == LOC_TYPEDEF))
&& (*name_matcher) (SYMBOL_SEARCH_NAME (*psym), data))
{
/* Found a match, so notify our caller. */
--
1.7.7.6