summaryrefslogtreecommitdiff
path: root/gdb/coffread.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2022-01-27 22:16:41 -0500
committerSimon Marchi <simon.marchi@efficios.com>2022-02-06 16:03:47 -0500
commit5f9c5a63ce38b103f778f54394c6a3d43b7ade90 (patch)
treec356fc03c61b9e9234aa8e187fb6c2303b8e5d2c /gdb/coffread.c
parentf5abd8f234426bbe8ccd08c43e6ae7cbe635e042 (diff)
downloadbinutils-gdb-5f9c5a63ce38b103f778f54394c6a3d43b7ade90.tar.gz
gdb: remove SYMBOL_TYPE macro
Add a getter and a setter for a symbol's type. Remove the corresponding macro and adjust all callers. Change-Id: Ie1a137744c5bfe1df4d4f9ae5541c5299577c8de
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r--gdb/coffread.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index e4db4fdb02f..3ff62bc96c0 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -1492,8 +1492,8 @@ patch_opaque_types (struct symtab *s)
from different files with the same name. */
if (real_sym->aclass () == LOC_TYPEDEF
&& real_sym->domain () == VAR_DOMAIN
- && SYMBOL_TYPE (real_sym)->code () == TYPE_CODE_PTR
- && TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
+ && real_sym->type ()->code () == TYPE_CODE_PTR
+ && TYPE_LENGTH (TYPE_TARGET_TYPE (real_sym->type ())) != 0)
{
const char *name = real_sym->linkage_name ();
int hash = hashname (name);
@@ -1514,7 +1514,7 @@ patch_opaque_types (struct symtab *s)
opaque_type_chain[hash] = SYMBOL_VALUE_CHAIN (sym);
}
- patch_type (SYMBOL_TYPE (sym), SYMBOL_TYPE (real_sym));
+ patch_type (sym->type (), real_sym->type ());
if (prev)
{
@@ -1571,9 +1571,9 @@ process_coff_symbol (struct coff_symbol *cs,
if (ISFCN (cs->c_type))
{
SYMBOL_VALUE (sym) += objfile->text_section_offset ();
- SYMBOL_TYPE (sym) =
- lookup_function_type (decode_function_type (cs, cs->c_type,
- aux, objfile));
+ sym->set_type
+ (lookup_function_type (decode_function_type (cs, cs->c_type,
+ aux, objfile)));
sym->set_aclass_index (LOC_BLOCK);
if (cs->c_sclass == C_STAT || cs->c_sclass == C_THUMBSTAT
@@ -1585,7 +1585,7 @@ process_coff_symbol (struct coff_symbol *cs,
}
else
{
- SYMBOL_TYPE (sym) = decode_type (cs, cs->c_type, aux, objfile);
+ sym->set_type (decode_type (cs, cs->c_type, aux, objfile));
switch (cs->c_sclass)
{
case C_NULL:
@@ -1656,10 +1656,10 @@ process_coff_symbol (struct coff_symbol *cs,
sym->set_domain (VAR_DOMAIN);
/* If type has no name, give it one. */
- if (SYMBOL_TYPE (sym)->name () == 0)
+ if (sym->type ()->name () == 0)
{
- if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_PTR
- || SYMBOL_TYPE (sym)->code () == TYPE_CODE_FUNC)
+ if (sym->type ()->code () == TYPE_CODE_PTR
+ || sym->type ()->code () == TYPE_CODE_FUNC)
{
/* If we are giving a name to a type such as
"pointer to foo" or "function returning foo", we
@@ -1682,7 +1682,7 @@ process_coff_symbol (struct coff_symbol *cs,
;
}
else
- SYMBOL_TYPE (sym)->set_name (xstrdup (sym->linkage_name ()));
+ sym->type ()->set_name (xstrdup (sym->linkage_name ()));
}
/* Keep track of any type which points to empty structured
@@ -1691,9 +1691,9 @@ process_coff_symbol (struct coff_symbol *cs,
not an empty structured type, though; the forward
references work themselves out via the magic of
coff_lookup_type. */
- if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_PTR
- && TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))) == 0
- && TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))->code ()
+ if (sym->type ()->code () == TYPE_CODE_PTR
+ && TYPE_LENGTH (TYPE_TARGET_TYPE (sym->type ())) == 0
+ && TYPE_TARGET_TYPE (sym->type ())->code ()
!= TYPE_CODE_UNDEF)
{
int i = hashname (sym->linkage_name ());
@@ -1713,11 +1713,11 @@ process_coff_symbol (struct coff_symbol *cs,
/* Some compilers try to be helpful by inventing "fake"
names for anonymous enums, structures, and unions, like
"~0fake" or ".0fake". Thanks, but no thanks... */
- if (SYMBOL_TYPE (sym)->name () == 0)
+ if (sym->type ()->name () == 0)
if (sym->linkage_name () != NULL
&& *sym->linkage_name () != '~'
&& *sym->linkage_name () != '.')
- SYMBOL_TYPE (sym)->set_name (xstrdup (sym->linkage_name ()));
+ sym->type ()->set_name (xstrdup (sym->linkage_name ()));
add_symbol_to_list (sym, get_file_symbols ());
break;
@@ -2143,7 +2143,7 @@ coff_read_enum_type (int index, int length, int lastsym,
{
struct symbol *xsym = syms->symbol[j];
- SYMBOL_TYPE (xsym) = type;
+ xsym->set_type (type);
type->field (n).set_name (xsym->linkage_name ());
type->field (n).set_loc_enumval (SYMBOL_VALUE (xsym));
if (SYMBOL_VALUE (xsym) < 0)