diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-01-28 08:09:50 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2022-04-11 10:45:36 -0400 |
commit | 4aeddc50d7a06294cc124dfd8f43992ffa0b7382 (patch) | |
tree | 82c6a016c94112c6e5dc7cf763cc5641d91e6b6e /gdb/printcmd.c | |
parent | 96d368d10456f5a599db759aab20e84a61f361f9 (diff) | |
download | gdb-4aeddc50d7a06294cc124dfd8f43992ffa0b7382.zip gdb-4aeddc50d7a06294cc124dfd8f43992ffa0b7382.tar.gz gdb-4aeddc50d7a06294cc124dfd8f43992ffa0b7382.tar.bz2 |
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
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 3c78edf..e870b35 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -645,7 +645,7 @@ build_address_symbolic (struct gdbarch *gdbarch, pointer is <function+3>. This matches the ISA behavior. */ addr = gdbarch_addr_bits_remove (gdbarch, addr); - name_location = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (symbol)); + name_location = BLOCK_ENTRY_PC (symbol->value_block ()); if (do_demangle || asm_demangle) name_temp = symbol->print_name (); else @@ -673,7 +673,7 @@ build_address_symbolic (struct gdbarch *gdbarch, under consideration. */ if (symbol == NULL || (!prefer_sym_over_minsym - && BMSYMBOL_VALUE_ADDRESS (msymbol) == addr + && msymbol.value_address () == addr && name_location != addr)) { /* If this is a function (i.e. a code address), strip out any @@ -688,7 +688,7 @@ build_address_symbolic (struct gdbarch *gdbarch, addr = gdbarch_addr_bits_remove (gdbarch, addr); symbol = 0; - name_location = BMSYMBOL_VALUE_ADDRESS (msymbol); + name_location = msymbol.value_address (); if (do_demangle || asm_demangle) name_temp = msymbol.minsym->print_name (); else @@ -1551,7 +1551,7 @@ info_symbol_command (const char *arg, int from_tty) const char *loc_string; matches = 1; - offset = sect_addr - MSYMBOL_VALUE_ADDRESS (objfile, msymbol); + offset = sect_addr - msymbol->value_address (objfile); mapped = section_is_mapped (osect) ? _("mapped") : _("unmapped"); sec_name = osect->the_bfd_section->name; msym_name = msymbol->print_name (); @@ -1649,7 +1649,7 @@ info_address_command (const char *exp, int from_tty) struct objfile *objfile = msymbol.objfile; gdbarch = objfile->arch (); - load_addr = BMSYMBOL_VALUE_ADDRESS (msymbol); + load_addr = msymbol.value_address (); gdb_printf ("Symbol \""); fprintf_symbol (gdb_stdout, exp, @@ -1679,7 +1679,7 @@ info_address_command (const char *exp, int from_tty) gdb_printf ("Symbol \""); gdb_puts (sym->print_name ()); gdb_printf ("\" is "); - val = SYMBOL_VALUE (sym); + val = sym->value_longest (); if (sym->is_objfile_owned ()) section = sym->obj_section (symbol_objfile (sym)); else @@ -1703,7 +1703,7 @@ info_address_command (const char *exp, int from_tty) case LOC_LABEL: gdb_printf ("a label at address "); - load_addr = SYMBOL_VALUE_ADDRESS (sym); + load_addr = sym->value_address (); fputs_styled (paddress (gdbarch, load_addr), address_style.style (), gdb_stdout); if (section_is_overlay (section)) @@ -1739,7 +1739,7 @@ info_address_command (const char *exp, int from_tty) case LOC_STATIC: gdb_printf (_("static storage at address ")); - load_addr = SYMBOL_VALUE_ADDRESS (sym); + load_addr = sym->value_address (); fputs_styled (paddress (gdbarch, load_addr), address_style.style (), gdb_stdout); if (section_is_overlay (section)) @@ -1778,7 +1778,7 @@ info_address_command (const char *exp, int from_tty) case LOC_BLOCK: gdb_printf (_("a function at address ")); - load_addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)); + load_addr = BLOCK_ENTRY_PC (sym->value_block ()); fputs_styled (paddress (gdbarch, load_addr), address_style.style (), gdb_stdout); if (section_is_overlay (section)) @@ -1806,7 +1806,7 @@ info_address_command (const char *exp, int from_tty) if (section && (section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0) { - load_addr = MSYMBOL_VALUE_RAW_ADDRESS (msym.minsym); + load_addr = msym.minsym->value_raw_address (); gdb_printf (_("a thread-local variable at offset %s " "in the thread-local storage for `%s'"), paddress (gdbarch, load_addr), @@ -1814,7 +1814,7 @@ info_address_command (const char *exp, int from_tty) } else { - load_addr = BMSYMBOL_VALUE_ADDRESS (msym); + load_addr = msym.value_address (); gdb_printf (_("static storage at address ")); fputs_styled (paddress (gdbarch, load_addr), address_style.style (), gdb_stdout); |