gdb: remove symbol value macros

Remove all macros related to getting and setting some symbol value:

    #define SYMBOL_VALUE(symbol)           (symbol)->value.ivalue
    #define SYMBOL_VALUE_ADDRESS(symbol)                         \
    #define SET_SYMBOL_VALUE_ADDRESS(symbol, new_value)    \
    #define SYMBOL_VALUE_BYTES(symbol)     (symbol)->value.bytes
    #define SYMBOL_VALUE_COMMON_BLOCK(symbol) (symbol)->value.common_block
    #define SYMBOL_BLOCK_VALUE(symbol)     (symbol)->value.block
    #define SYMBOL_VALUE_CHAIN(symbol)     (symbol)->value.chain
    #define MSYMBOL_VALUE(symbol)          (symbol)->value.ivalue
    #define MSYMBOL_VALUE_RAW_ADDRESS(symbol) ((symbol)->value.address + 0)
    #define MSYMBOL_VALUE_ADDRESS(objfile, symbol)                         \
    #define BMSYMBOL_VALUE_ADDRESS(symbol) \
    #define SET_MSYMBOL_VALUE_ADDRESS(symbol, new_value)   \
    #define MSYMBOL_VALUE_BYTES(symbol)    (symbol)->value.bytes
    #define MSYMBOL_BLOCK_VALUE(symbol)    (symbol)->value.block

Replace them with equivalent methods on the appropriate objects.

Change-Id: Iafdab3b8eefc6dc2fd895aa955bf64fafc59ed50
This commit is contained in:
Simon Marchi
2022-01-28 08:09:50 -05:00
parent 96d368d104
commit 4aeddc50d7
90 changed files with 503 additions and 461 deletions

View File

@@ -134,7 +134,7 @@ find_pc_sect_psymtab_closer (struct objfile *objfile,
object's symbol table. */
p = find_pc_sect_psymbol (objfile, tpst, pc, section);
if (p != NULL
&& (p->address (objfile) == BMSYMBOL_VALUE_ADDRESS (msymbol)))
&& (p->address (objfile) == msymbol.value_address ()))
return tpst;
/* Also accept the textlow value of a psymtab as a
@@ -211,7 +211,7 @@ psymbol_functions::find_pc_sect_psymtab (struct objfile *objfile,
p = find_pc_sect_psymbol (objfile, pst, pc, section);
if (p == NULL
|| (p->address (objfile)
!= BMSYMBOL_VALUE_ADDRESS (msymbol)))
!= msymbol.value_address ()))
goto next;
}
@@ -1287,7 +1287,7 @@ psymbol_bcache::hash (const void *addr, int length)
unsigned int domain = psymbol->domain;
unsigned int theclass = psymbol->aclass;
h = fast_hash (&psymbol->ginfo.value, sizeof (psymbol->ginfo.value), h);
h = fast_hash (&psymbol->ginfo.m_value, sizeof (psymbol->ginfo.m_value), h);
h = fast_hash (&lang, sizeof (unsigned int), h);
h = fast_hash (&domain, sizeof (unsigned int), h);
h = fast_hash (&theclass, sizeof (unsigned int), h);
@@ -1306,8 +1306,8 @@ psymbol_bcache::compare (const void *addr1, const void *addr2, int length)
struct partial_symbol *sym1 = (struct partial_symbol *) addr1;
struct partial_symbol *sym2 = (struct partial_symbol *) addr2;
return (memcmp (&sym1->ginfo.value, &sym2->ginfo.value,
sizeof (sym1->ginfo.value)) == 0
return (memcmp (&sym1->ginfo.m_value, &sym2->ginfo.m_value,
sizeof (sym1->ginfo.m_value)) == 0
&& sym1->ginfo.language () == sym2->ginfo.language ()
&& sym1->domain == sym2->domain
&& sym1->aclass == sym2->aclass
@@ -1804,7 +1804,7 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
/* Skip symbols for inlined functions without address. These may
or may not have a match in the full symtab. */
if (psym->aclass == LOC_BLOCK
&& psym->ginfo.value.address == 0)
&& psym->ginfo.value_address () == 0)
continue;
sym = block_lookup_symbol (b, psym->ginfo.search_name (),