public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/4] gdb: remove symbol value macros
@ 2022-04-10 12:51 Simon Marchi
  2022-04-10 12:51 ` [PATCH 2/4] gdb: remove MSYMBOL_TYPE macro Simon Marchi
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Simon Marchi @ 2022-04-10 12:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@efficios.com>

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
---
 gdb/ada-exp.y                       |   2 +-
 gdb/ada-lang.c                      |  18 ++--
 gdb/ada-tasks.c                     |   8 +-
 gdb/aix-thread.c                    |   4 +-
 gdb/alpha-mdebug-tdep.c             |   2 +-
 gdb/arc-linux-tdep.c                |   4 +-
 gdb/arm-tdep.c                      |   6 +-
 gdb/auxv.c                          |   2 +-
 gdb/avr-tdep.c                      |   2 +-
 gdb/ax-gdb.c                        |  12 +--
 gdb/blockframe.c                    |  14 +--
 gdb/breakpoint.c                    |  11 +--
 gdb/bsd-uthread.c                   |   2 +-
 gdb/buildsym.c                      |   2 +-
 gdb/c-exp.y                         |   6 +-
 gdb/c-valprint.c                    |   2 +-
 gdb/coff-pe-read.c                  |   2 +-
 gdb/coffread.c                      |  49 ++++------
 gdb/compile/compile-c-symbols.c     |  14 +--
 gdb/compile/compile-cplus-symbols.c |  14 +--
 gdb/compile/compile-cplus-types.c   |   4 +-
 gdb/compile/compile-object-load.c   |   4 +-
 gdb/compile/compile-object-run.c    |   2 +-
 gdb/cp-namespace.c                  |   2 +-
 gdb/ctfread.c                       |   2 +-
 gdb/dbxread.c                       |   8 +-
 gdb/dwarf2/loc.c                    |   6 +-
 gdb/dwarf2/read.c                   |  35 ++++---
 gdb/elfread.c                       |   4 +-
 gdb/f-valprint.c                    |   2 +-
 gdb/fbsd-tdep.c                     |   4 +-
 gdb/findvar.c                       |  27 +++---
 gdb/frame.c                         |   4 +-
 gdb/frv-tdep.c                      |   2 +-
 gdb/ft32-tdep.c                     |   2 +-
 gdb/glibc-tdep.c                    |   2 +-
 gdb/gnu-v3-abi.c                    |   4 +-
 gdb/hppa-tdep.c                     |   4 +-
 gdb/infcmd.c                        |   6 +-
 gdb/infrun.c                        |   2 +-
 gdb/inline-frame.c                  |   4 +-
 gdb/jit.c                           |  12 +--
 gdb/linespec.c                      |  14 +--
 gdb/linux-thread-db.c               |   2 +-
 gdb/m2-exp.y                        |   2 +-
 gdb/m32c-tdep.c                     |   8 +-
 gdb/m32r-tdep.c                     |   2 +-
 gdb/m68hc11-tdep.c                  |   2 +-
 gdb/machoread.c                     |   2 +-
 gdb/maint.c                         |   2 +-
 gdb/mdebugread.c                    |  32 +++----
 gdb/mi/mi-symbol-cmds.c             |   2 +-
 gdb/minsyms.c                       |  55 ++++++-----
 gdb/minsyms.h                       |   5 +
 gdb/mips-fbsd-tdep.c                |   2 +-
 gdb/mips-linux-tdep.c               |   2 +-
 gdb/mips-tdep.c                     |   8 +-
 gdb/netbsd-tdep.c                   |   2 +-
 gdb/objc-lang.c                     |   2 +-
 gdb/objfiles.c                      |   7 +-
 gdb/obsd-tdep.c                     |   2 +-
 gdb/p-exp.y                         |   4 +-
 gdb/p-valprint.c                    |   2 +-
 gdb/parse.c                         |   6 +-
 gdb/ppc-linux-tdep.c                |   6 +-
 gdb/ppc-sysv-tdep.c                 |   2 +-
 gdb/printcmd.c                      |  22 ++---
 gdb/proc-service.c                  |   2 +-
 gdb/psympriv.h                      |   6 +-
 gdb/psymtab.c                       |  12 +--
 gdb/ravenscar-thread.c              |   2 +-
 gdb/remote.c                        |   2 +-
 gdb/sol-thread.c                    |   2 +-
 gdb/sol2-tdep.c                     |   2 +-
 gdb/solib-dsbt.c                    |   2 +-
 gdb/solib-frv.c                     |   4 +-
 gdb/solib-svr4.c                    |  10 +-
 gdb/solib.c                         |   4 +-
 gdb/stabsread.c                     |  83 ++++++++---------
 gdb/stack.c                         |   6 +-
 gdb/symfile.c                       |   6 +-
 gdb/symmisc.c                       |  34 ++++---
 gdb/symtab.c                        |  61 +++++++-----
 gdb/symtab.h                        | 140 ++++++++++++++++++++--------
 gdb/tracepoint.c                    |  37 ++++----
 gdb/tui/tui-disasm.c                |   6 +-
 gdb/valops.c                        |   2 +-
 gdb/value.c                         |   6 +-
 gdb/xcoffread.c                     |   7 +-
 gdb/z80-tdep.c                      |  13 ++-
 90 files changed, 501 insertions(+), 461 deletions(-)

diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index a2755d7501ed..60a7c1bf91f5 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -1382,7 +1382,7 @@ block_lookup (const struct block *context, const char *raw_name)
     {
       if (syms.size () > 1)
 	warning (_("Function name \"%s\" ambiguous here"), raw_name);
-      result = SYMBOL_BLOCK_VALUE (syms[0].symbol);
+      result = syms[0].symbol->value_block ();
     }
 
   return result;
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index d819038e63b6..29f2a4b255a9 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -819,7 +819,7 @@ ada_main_name (void)
 
   if (msym.minsym != NULL)
     {
-      CORE_ADDR main_program_name_addr = BMSYMBOL_VALUE_ADDRESS (msym);
+      CORE_ADDR main_program_name_addr = msym.value_address ();
       if (main_program_name_addr == 0)
 	error (_("Invalid address for Ada main program name."));
 
@@ -4825,7 +4825,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
 		  && startswith (name1 + len0, "___XV")));
       }
     case LOC_CONST:
-      return SYMBOL_VALUE (sym0) == SYMBOL_VALUE (sym1)
+      return sym0->value_longest () == sym1->value_longest ()
 	&& equiv_types (sym0->type (), sym1->type ());
 
     case LOC_STATIC:
@@ -4833,7 +4833,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
 	const char *name0 = sym0->linkage_name ();
 	const char *name1 = sym1->linkage_name ();
 	return (strcmp (name0, name1) == 0
-		&& SYMBOL_VALUE_ADDRESS (sym0) == SYMBOL_VALUE_ADDRESS (sym1));
+		&& sym0->value_address () == sym1->value_address ());
       }
 
     default:
@@ -5003,7 +5003,7 @@ symbols_are_identical_enums (const std::vector<struct block_symbol> &syms)
 
   /* Quick check: They should all have the same value.  */
   for (i = 1; i < syms.size (); i++)
-    if (SYMBOL_VALUE (syms[i].symbol) != SYMBOL_VALUE (syms[0].symbol))
+    if (syms[i].symbol->value_longest () != syms[0].symbol->value_longest ())
       return 0;
 
   /* Quick check: They should all have the same number of enumerals.  */
@@ -5077,8 +5077,8 @@ remove_extra_symbols (std::vector<struct block_symbol> *syms)
 			     (*syms)[j].symbol->linkage_name ()) == 0
 		  && ((*syms)[i].symbol->aclass ()
 		      == (*syms)[j].symbol->aclass ())
-		  && SYMBOL_VALUE_ADDRESS ((*syms)[i].symbol)
-		  == SYMBOL_VALUE_ADDRESS ((*syms)[j].symbol))
+		  && (*syms)[i].symbol->value_address ()
+		  == (*syms)[j].symbol->value_address ())
 		remove_p = 1;
 	    }
 	}
@@ -12987,7 +12987,7 @@ ada_add_standard_exceptions (compiled_regex *preg,
 	  if (msymbol.minsym != NULL)
 	    {
 	      struct ada_exc_info info
-		= {name, BMSYMBOL_VALUE_ADDRESS (msymbol)};
+		= {name, msymbol.value_address ()};
 
 	      exceptions->push_back (info);
 	    }
@@ -13029,7 +13029,7 @@ ada_add_exceptions_from_frame (compiled_regex *preg,
 	      if (ada_is_exception_sym (sym))
 		{
 		  struct ada_exc_info info = {sym->print_name (),
-					      SYMBOL_VALUE_ADDRESS (sym)};
+					      sym->value_address ()};
 
 		  exceptions->push_back (info);
 		}
@@ -13105,7 +13105,7 @@ ada_add_global_exceptions (compiled_regex *preg,
 		    && name_matches_regex (sym->natural_name (), preg))
 		  {
 		    struct ada_exc_info info
-		      = {sym->print_name (), SYMBOL_VALUE_ADDRESS (sym)};
+		      = {sym->print_name (), sym->value_address ()};
 
 		    exceptions->push_back (info);
 		  }
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
index 5622772b013e..0043f2999d9d 100644
--- a/gdb/ada-tasks.c
+++ b/gdb/ada-tasks.c
@@ -574,7 +574,7 @@ ada_get_tcb_types_info (void)
   unsigned int first_id = 0;
   if (first_id_sym.minsym != nullptr)
     {
-      CORE_ADDR addr = BMSYMBOL_VALUE_ADDRESS (first_id_sym);
+      CORE_ADDR addr = first_id_sym.value_address ();
       /* This symbol always has type uint32_t.  */
       struct type *u32type = builtin_type (target_gdbarch ())->builtin_uint32;
       first_id = value_as_long (value_at (u32type, addr));
@@ -896,7 +896,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
   if (msym.minsym != NULL)
     {
       data->known_tasks_kind = ADA_TASKS_ARRAY;
-      data->known_tasks_addr = BMSYMBOL_VALUE_ADDRESS (msym);
+      data->known_tasks_addr = msym.value_address ();
 
       /* Try to get pointer type and array length from the symtab.  */
       sym = lookup_symbol_in_language (KNOWN_TASKS_NAME, NULL, VAR_DOMAIN,
@@ -942,12 +942,12 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
   if (msym.minsym != NULL)
     {
       data->known_tasks_kind = ADA_TASKS_LIST;
-      data->known_tasks_addr = BMSYMBOL_VALUE_ADDRESS (msym);
+      data->known_tasks_addr = msym.value_address ();
       data->known_tasks_length = 1;
 
       sym = lookup_symbol_in_language (KNOWN_TASKS_LIST, NULL, VAR_DOMAIN,
 				       language_c, NULL).symbol;
-      if (sym != NULL && SYMBOL_VALUE_ADDRESS (sym) != 0)
+      if (sym != NULL && sym->value_address () != 0)
 	{
 	  /* Validate.  */
 	  struct type *type = check_typedef (sym->type ());
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 85be4c15f1c6..4e41cde66945 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -360,7 +360,7 @@ pdc_symbol_addrs (pthdb_user_t user, pthdb_symbol_t *symbols, int count)
 		gdb_printf (gdb_stdlog, " returning PDC_FAILURE\n");
 	      return PDC_FAILURE;
 	    }
-	  symbols[i].addr = BMSYMBOL_VALUE_ADDRESS (ms);
+	  symbols[i].addr = ms->value_address ();
 	}
       if (debug_aix_thread)
 	gdb_printf (gdb_stdlog, "  symbols[%d].addr = %s\n",
@@ -969,7 +969,7 @@ pd_enable (void)
   ms = lookup_minimal_symbol (stub_name, NULL, NULL);
   if (ms.minsym == NULL)
     return;
-  pd_brk_addr = BMSYMBOL_VALUE_ADDRESS (ms);
+  pd_brk_addr = ms->value_address ();
   if (!create_thread_event_breakpoint (target_gdbarch (), pd_brk_addr))
     return;
 
diff --git a/gdb/alpha-mdebug-tdep.c b/gdb/alpha-mdebug-tdep.c
index ec11bc45423e..a8b4bcbea4aa 100644
--- a/gdb/alpha-mdebug-tdep.c
+++ b/gdb/alpha-mdebug-tdep.c
@@ -114,7 +114,7 @@ find_proc_desc (CORE_ADDR pc)
 
   if (sym)
     {
-      proc_desc = (struct mdebug_extra_func_info *) SYMBOL_VALUE_BYTES (sym);
+      proc_desc = (struct mdebug_extra_func_info *) sym->value_bytes ();
 
       /* Correct incorrect setjmp procedure descriptor from the library
 	 to make backtrace through setjmp work.  */
diff --git a/gdb/arc-linux-tdep.c b/gdb/arc-linux-tdep.c
index 1744b7544cdc..13595f2e8e9b 100644
--- a/gdb/arc-linux-tdep.c
+++ b/gdb/arc-linux-tdep.c
@@ -509,7 +509,7 @@ arc_linux_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
     {
       if (resolver.minsym != nullptr)
 	{
-	  CORE_ADDR res_addr = BMSYMBOL_VALUE_ADDRESS (resolver);
+	  CORE_ADDR res_addr = resolver.value_address ();
 	  arc_linux_debug_printf ("pc = %s, resolver at %s",
 				  print_core_address (gdbarch, pc),
 				  print_core_address (gdbarch, res_addr));
@@ -519,7 +519,7 @@ arc_linux_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
 				print_core_address (gdbarch, pc));
     }
 
-  if (resolver.minsym != nullptr && BMSYMBOL_VALUE_ADDRESS (resolver) == pc)
+  if (resolver.minsym != nullptr && resolver.value_address () == pc)
     {
       /* Find the return address.  */
       return frame_unwind_caller_pc (get_current_frame ());
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index fbc0a38bff3b..7002bcaa279f 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -600,7 +600,7 @@ skip_prologue_function (struct gdbarch *gdbarch, CORE_ADDR pc, int is_thumb)
 
   msym = lookup_minimal_symbol_by_pc (pc);
   if (msym.minsym != NULL
-      && BMSYMBOL_VALUE_ADDRESS (msym) == pc
+      && msym.value_address () == pc
       && msym.minsym->linkage_name () != NULL)
     {
       const char *name = msym.minsym->linkage_name ();
@@ -8521,7 +8521,7 @@ arm_skip_cmse_entry (CORE_ADDR pc, const char *name, struct objfile *objfile)
    = lookup_minimal_symbol (target_name, NULL, objfile);
 
   if (minsym.minsym != nullptr)
-    return BMSYMBOL_VALUE_ADDRESS (minsym);
+    return minsym.value_address ();
 
   return 0;
 }
@@ -8610,7 +8610,7 @@ arm_skip_stub (struct frame_info *frame, CORE_ADDR pc)
       objfile = (sec == NULL) ? NULL : sec->objfile;
       minsym = lookup_minimal_symbol (target_name, NULL, objfile);
       if (minsym.minsym != NULL)
-	return BMSYMBOL_VALUE_ADDRESS (minsym);
+	return minsym.value_address ();
       else
 	return 0;
     }
diff --git a/gdb/auxv.c b/gdb/auxv.c
index 840db0257af6..190cd69d6bd8 100644
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -101,7 +101,7 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
      resides.  DATA_ADDRESS is the inferior value present in
      `_dl_auxv', therefore the real inferior AUXV address.  */
 
-  pointer_address = BMSYMBOL_VALUE_ADDRESS (msym);
+  pointer_address = msym.value_address ();
 
   /* The location of the _dl_auxv symbol may no longer be correct if
      ld.so runs at a different address than the one present in the
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 310c8cf9ca2a..9e73c507b2eb 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -664,7 +664,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
 
       /* Resolve offset (in words) from __prologue_saves__ symbol.
 	 Which is a pushes count in `-mcall-prologues' mode */
-      num_pushes = AVR_MAX_PUSHES - (i - BMSYMBOL_VALUE_ADDRESS (msymbol)) / 2;
+      num_pushes = AVR_MAX_PUSHES - (i - msymbol.value_address ()) / 2;
 
       if (num_pushes > AVR_MAX_PUSHES)
 	{
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index be2063f23666..e2e311f9d74a 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -499,7 +499,7 @@ gen_offset (struct agent_expr *ax, int offset)
 static void
 gen_sym_offset (struct agent_expr *ax, struct symbol *var)
 {
-  gen_offset (ax, SYMBOL_VALUE (var));
+  gen_offset (ax, var->value_longest ());
 }
 
 
@@ -523,12 +523,12 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
   switch (var->aclass ())
     {
     case LOC_CONST:		/* A constant, like an enum value.  */
-      ax_const_l (ax, (LONGEST) SYMBOL_VALUE (var));
+      ax_const_l (ax, (LONGEST) var->value_longest ());
       value->kind = axs_rvalue;
       break;
 
     case LOC_LABEL:		/* A goto label, being used as a value.  */
-      ax_const_l (ax, (LONGEST) SYMBOL_VALUE_ADDRESS (var));
+      ax_const_l (ax, (LONGEST) var->value_address ());
       value->kind = axs_rvalue;
       break;
 
@@ -540,7 +540,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
       /* Variable at a fixed location in memory.  Easy.  */
     case LOC_STATIC:
       /* Push the address of the variable.  */
-      ax_const_l (ax, SYMBOL_VALUE_ADDRESS (var));
+      ax_const_l (ax, var->value_address ());
       value->kind = axs_lvalue_memory;
       break;
 
@@ -571,7 +571,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
       break;
 
     case LOC_BLOCK:
-      ax_const_l (ax, BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (var)));
+      ax_const_l (ax, BLOCK_ENTRY_PC (var->value_block ()));
       value->kind = axs_rvalue;
       break;
 
@@ -603,7 +603,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
 	  error (_("Couldn't resolve symbol `%s'."), var->print_name ());
 
 	/* Push the address of the variable.  */
-	ax_const_l (ax, BMSYMBOL_VALUE_ADDRESS (msym));
+	ax_const_l (ax, msym.value_address ());
 	value->kind = axs_lvalue_memory;
       }
       break;
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 50c464f44a24..df03901b6e79 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -95,7 +95,7 @@ get_pc_function_start (CORE_ADDR pc)
 
       if (symbol)
 	{
-	  bl = SYMBOL_BLOCK_VALUE (symbol);
+	  bl = symbol->value_block ();
 	  return BLOCK_ENTRY_PC (bl);
 	}
     }
@@ -103,7 +103,7 @@ get_pc_function_start (CORE_ADDR pc)
   msymbol = lookup_minimal_symbol_by_pc (pc);
   if (msymbol.minsym)
     {
-      CORE_ADDR fstart = BMSYMBOL_VALUE_ADDRESS (msymbol);
+      CORE_ADDR fstart = msymbol.value_address ();
 
       if (find_pc_section (fstart))
 	return fstart;
@@ -254,10 +254,10 @@ find_pc_partial_function_sym (CORE_ADDR pc,
       f = find_pc_sect_function (mapped_pc, section);
       if (f != NULL
 	  && (msymbol.minsym == NULL
-	      || (BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (f))
-		  >= BMSYMBOL_VALUE_ADDRESS (msymbol))))
+	      || (BLOCK_ENTRY_PC (f->value_block ())
+		  >= msymbol.value_address ())))
 	{
-	  const struct block *b = SYMBOL_BLOCK_VALUE (f);
+	  const struct block *b = f->value_block ();
 
 	  cache_pc_function_sym = f;
 	  cache_pc_function_section = section;
@@ -326,7 +326,7 @@ find_pc_partial_function_sym (CORE_ADDR pc,
       return false;
     }
 
-  cache_pc_function_low = BMSYMBOL_VALUE_ADDRESS (msymbol);
+  cache_pc_function_low = msymbol.value_address ();
   cache_pc_function_sym = msymbol.minsym;
   cache_pc_function_section = section;
   cache_pc_function_high = minimal_symbol_upper_bound (msymbol);
@@ -425,7 +425,7 @@ find_function_type (CORE_ADDR pc)
 {
   struct symbol *sym = find_pc_function (pc);
 
-  if (sym != NULL && BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)) == pc)
+  if (sym != NULL && BLOCK_ENTRY_PC (sym->value_block ()) == pc)
     return sym->type ();
 
   return NULL;
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index b21d83d8019a..af7eb6cc1133 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3256,7 +3256,7 @@ create_overlay_event_breakpoint (void)
 	  bp_objfile_data->overlay_msym = m;
 	}
 
-      addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym);
+      addr = bp_objfile_data->overlay_msym.value_address ();
       b = create_internal_breakpoint (objfile->arch (), addr,
 				      bp_overlay_event,
 				      &internal_breakpoint_ops);
@@ -3366,7 +3366,7 @@ create_longjmp_master_breakpoint_names (objfile *objfile)
 	  bp_objfile_data->longjmp_msym[i] = m;
 	}
 
-      addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->longjmp_msym[i]);
+      addr = bp_objfile_data->longjmp_msym[i].value_address ();
       b = create_internal_breakpoint (gdbarch, addr, bp_longjmp_master,
 				      &internal_breakpoint_ops);
       initialize_explicit_location (&explicit_loc);
@@ -3449,7 +3449,7 @@ create_std_terminate_master_breakpoint (void)
 	      bp_objfile_data->terminate_msym = m;
 	    }
 
-	  addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->terminate_msym);
+	  addr = bp_objfile_data->terminate_msym.value_address ();
 	  b = create_internal_breakpoint (objfile->arch (), addr,
 					  bp_std_terminate_master,
 					  &internal_breakpoint_ops);
@@ -3547,7 +3547,7 @@ create_exception_master_breakpoint_hook (objfile *objfile)
       bp_objfile_data->exception_msym = debug_hook;
     }
 
-  addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->exception_msym);
+  addr = bp_objfile_data->exception_msym.value_address ();
   addr = gdbarch_convert_from_func_ptr_addr
     (gdbarch, addr, current_inferior ()->top_target ());
   b = create_internal_breakpoint (gdbarch, addr, bp_exception_master,
@@ -4913,8 +4913,7 @@ watchpoint_check (bpstat *bs)
 
 	  function = get_frame_function (fr);
 	  if (function == NULL
-	      || !contained_in (b->exp_valid_block,
-				SYMBOL_BLOCK_VALUE (function)))
+	      || !contained_in (b->exp_valid_block, function->value_block ()))
 	    within_current_scope = 0;
 	}
 
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index d0d9e89e93c1..759b562cdd00 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -163,7 +163,7 @@ bsd_uthread_lookup_address (const char *name, struct objfile *objfile)
 
   sym = lookup_minimal_symbol (name, NULL, objfile);
   if (sym.minsym)
-    return BMSYMBOL_VALUE_ADDRESS (sym);
+    return sym.value_address ();
 
   return 0;
 }
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 9a9d3cf74d9b..0df355151f45 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -251,7 +251,7 @@ buildsym_compunit::finish_block_internal
     {
       struct type *ftype = symbol->type ();
       struct mdict_iterator miter;
-      SYMBOL_BLOCK_VALUE (symbol) = block;
+      symbol->set_value_block (block);
       BLOCK_FUNCTION (block) = symbol;
 
       if (ftype->num_fields () <= 0)
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 4ed661e587b1..4fa3f8d2fc48 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -1075,7 +1075,7 @@ exp     :       FALSEKEYWORD
 block	:	BLOCKNAME
 			{
 			  if ($1.sym.symbol)
-			    $$ = SYMBOL_BLOCK_VALUE ($1.sym.symbol);
+			    $$ = $1.sym.symbol->value_block ();
 			  else
 			    error (_("No file or function \"%s\"."),
 				   copy_name ($1.stoken).c_str ());
@@ -1096,7 +1096,7 @@ block	:	block COLONCOLON name
 			  if (!tem || tem->aclass () != LOC_BLOCK)
 			    error (_("No function \"%s\" in specified context."),
 				   copy.c_str ());
-			  $$ = SYMBOL_BLOCK_VALUE (tem); }
+			  $$ = tem->value_block (); }
 	;
 
 variable:	name_not_typename ENTRY
@@ -1239,7 +1239,7 @@ variable:	name_not_typename
 			      if (alias_target != NULL)
 				{
 				  block_symbol bsym { alias_target,
-				    SYMBOL_BLOCK_VALUE (alias_target) };
+				    alias_target->value_block () };
 				  pstate->push_new<var_value_operation> (bsym);
 				}
 			      else
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index 93e7cfd42542..bd445588ca08 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -182,7 +182,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
       /* If 'symbol_print' is set, we did the work above.  */
       if (!options->symbol_print
 	  && (msymbol.minsym != NULL)
-	  && (vt_address == BMSYMBOL_VALUE_ADDRESS (msymbol)))
+	  && (vt_address == msymbol.value_address ()))
 	{
 	  if (want_space)
 	    gdb_puts (" ", stream);
diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c
index 16c1e044794f..1f11606cdfff 100644
--- a/gdb/coff-pe-read.c
+++ b/gdb/coff-pe-read.c
@@ -244,7 +244,7 @@ add_pe_forwarded_sym (minimal_symbol_reader &reader,
 			      " \"%s\" in dll \"%s\", pointing to \"%s\"\n"),
 		sym_name, dll_name, forward_qualified_name);
 
-  vma = BMSYMBOL_VALUE_ADDRESS (msymbol);
+  vma = msymbol.value_address ();
   msymtype = MSYMBOL_TYPE (msymbol.minsym);
   section = msymbol.minsym->section_index ();
 
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 253ba9c095f8..24dd9b960113 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -1026,7 +1026,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
 
 		sym = process_coff_symbol
 		  (cs, &main_aux, objfile);
-		SYMBOL_VALUE (sym) = tmpaddr + offset;
+		sym->set_value_longest (tmpaddr + offset);
 		sym->set_section_index (sec);
 	      }
 	  }
@@ -1506,29 +1506,21 @@ patch_opaque_types (struct symtab *s)
 		  && strcmp (name + 1, sym->linkage_name () + 1) == 0)
 		{
 		  if (prev)
-		    {
-		      SYMBOL_VALUE_CHAIN (prev) = SYMBOL_VALUE_CHAIN (sym);
-		    }
+		    prev->set_value_chain (sym->value_chain ());
 		  else
-		    {
-		      opaque_type_chain[hash] = SYMBOL_VALUE_CHAIN (sym);
-		    }
+		    opaque_type_chain[hash] = sym->value_chain ();
 
 		  patch_type (sym->type (), real_sym->type ());
 
 		  if (prev)
-		    {
-		      sym = SYMBOL_VALUE_CHAIN (prev);
-		    }
+		    sym = prev->value_chain ();
 		  else
-		    {
-		      sym = opaque_type_chain[hash];
-		    }
+		    sym = opaque_type_chain[hash];
 		}
 	      else
 		{
 		  prev = sym;
-		  sym = SYMBOL_VALUE_CHAIN (sym);
+		  sym->set_value_chain (sym);
 		}
 	    }
 	}
@@ -1538,7 +1530,7 @@ patch_opaque_types (struct symtab *s)
 static int
 coff_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
 {
-  return gdbarch_sdb_reg_to_regnum (gdbarch, SYMBOL_VALUE (sym));
+  return gdbarch_sdb_reg_to_regnum (gdbarch, sym->value_longest ());
 }
 
 static const struct symbol_register_ops coff_register_funcs = {
@@ -1564,13 +1556,14 @@ process_coff_symbol (struct coff_symbol *cs,
   sym->compute_and_set_names (name, true, objfile->per_bfd);
 
   /* default assumptions */
-  SYMBOL_VALUE (sym) = cs->c_value;
+  sym->set_value_longest (cs->c_value);
   sym->set_domain (VAR_DOMAIN);
   sym->set_section_index (cs_to_section (cs, objfile));
 
   if (ISFCN (cs->c_type))
     {
-      SYMBOL_VALUE (sym) += objfile->text_section_offset ();
+      sym->set_value_longest
+	(sym->value_longest () + objfile->text_section_offset ());
       sym->set_type
 	(lookup_function_type (decode_function_type (cs, cs->c_type,
 						     aux, objfile)));
@@ -1600,9 +1593,8 @@ process_coff_symbol (struct coff_symbol *cs,
 	case C_THUMBEXTFUNC:
 	case C_EXT:
 	  sym->set_aclass_index (LOC_STATIC);
-	  SET_SYMBOL_VALUE_ADDRESS (sym,
-				    (CORE_ADDR) cs->c_value
-				    + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
+	  sym->set_value_address ((CORE_ADDR) cs->c_value
+				  + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
 	  add_symbol_to_list (sym, get_global_symbols ());
 	  break;
 
@@ -1610,9 +1602,8 @@ process_coff_symbol (struct coff_symbol *cs,
 	case C_THUMBSTATFUNC:
 	case C_STAT:
 	  sym->set_aclass_index (LOC_STATIC);
-	  SET_SYMBOL_VALUE_ADDRESS (sym,
-				    (CORE_ADDR) cs->c_value
-				    + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
+	  sym->set_value_address ((CORE_ADDR) cs->c_value
+				  + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
 	  if (within_function)
 	    {
 	      /* Static symbol of local scope.  */
@@ -1630,7 +1621,7 @@ process_coff_symbol (struct coff_symbol *cs,
 #endif
 	case C_REG:
 	  sym->set_aclass_index (coff_register_index);
-	  SYMBOL_VALUE (sym) = cs->c_value;
+	  sym->set_value_longest (cs->c_value);
 	  add_symbol_to_list (sym, get_local_symbols ());
 	  break;
 
@@ -1647,7 +1638,7 @@ process_coff_symbol (struct coff_symbol *cs,
 	case C_REGPARM:
 	  sym->set_aclass_index (coff_register_index);
 	  sym->set_is_argument (1);
-	  SYMBOL_VALUE (sym) = cs->c_value;
+	  sym->set_value_longest (cs->c_value);
 	  add_symbol_to_list (sym, get_local_symbols ());
 	  break;
 
@@ -1698,7 +1689,7 @@ process_coff_symbol (struct coff_symbol *cs,
 	    {
 	      int i = hashname (sym->linkage_name ());
 
-	      SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i];
+	      sym->set_value_chain (opaque_type_chain[i]);
 	      opaque_type_chain[i] = sym;
 	    }
 	  add_symbol_to_list (sym, get_file_symbols ());
@@ -2100,7 +2091,7 @@ coff_read_enum_type (int index, int length, int lastsym,
 	  sym->set_linkage_name (name);
 	  sym->set_aclass_index (LOC_CONST);
 	  sym->set_domain (VAR_DOMAIN);
-	  SYMBOL_VALUE (sym) = ms->c_value;
+	  sym->set_value_longest (ms->c_value);
 	  add_symbol_to_list (sym, symlist);
 	  nsyms++;
 	  break;
@@ -2145,8 +2136,8 @@ coff_read_enum_type (int index, int length, int lastsym,
 
 	  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)
+	  type->field (n).set_loc_enumval (xsym->value_longest ());
+	  if (xsym->value_longest () < 0)
 	    unsigned_enum = 0;
 	  TYPE_FIELD_BITSIZE (type, n) = 0;
 	}
diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c
index d422c466b5f5..a50e84d117ac 100644
--- a/gdb/compile/compile-c-symbols.c
+++ b/gdb/compile/compile-c-symbols.c
@@ -88,12 +88,12 @@ convert_one_symbol (compile_c_instance *context,
 
 	case LOC_LABEL:
 	  kind = GCC_C_SYMBOL_LABEL;
-	  addr = SYMBOL_VALUE_ADDRESS (sym.symbol);
+	  addr = sym.symbol->value_address ();
 	  break;
 
 	case LOC_BLOCK:
 	  kind = GCC_C_SYMBOL_FUNCTION;
-	  addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym.symbol));
+	  addr = BLOCK_ENTRY_PC (sym.symbol->value_block ());
 	  if (is_global && sym.symbol->type ()->is_gnu_ifunc ())
 	    addr = gnu_ifunc_resolve_addr (target_gdbarch (), addr);
 	  break;
@@ -106,7 +106,7 @@ convert_one_symbol (compile_c_instance *context,
 	    }
 	  context->plugin ().build_constant
 	    (sym_type, sym.symbol->natural_name (),
-	     SYMBOL_VALUE (sym.symbol),
+	     sym.symbol->value_longest (),
 	     filename, line);
 	  return;
 
@@ -179,7 +179,7 @@ convert_one_symbol (compile_c_instance *context,
 
 	case LOC_STATIC:
 	  kind = GCC_C_SYMBOL_VARIABLE;
-	  addr = SYMBOL_VALUE_ADDRESS (sym.symbol);
+	  addr = sym.symbol->value_address ();
 	  break;
 
 	case LOC_FINAL_VALUE:
@@ -270,7 +270,7 @@ convert_symbol_bmsym (compile_c_instance *context,
   gcc_decl decl;
   CORE_ADDR addr;
 
-  addr = MSYMBOL_VALUE_ADDRESS (objfile, msym);
+  addr = msym->value_address (objfile);
 
   /* Conversion copied from write_exp_msymbol.  */
   switch (MSYMBOL_TYPE (msym))
@@ -404,7 +404,7 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
 	    gdb_printf (gdb_stdlog,
 			"gcc_symbol_address \"%s\": full symbol\n",
 			identifier);
-	  result = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym));
+	  result = BLOCK_ENTRY_PC (sym->value_block ());
 	  if (sym->type ()->is_gnu_ifunc ())
 	    result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
 	  found = 1;
@@ -421,7 +421,7 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
 			    "gcc_symbol_address \"%s\": minimal "
 			    "symbol\n",
 			    identifier);
-	      result = BMSYMBOL_VALUE_ADDRESS (msym);
+	      result = msym.value_address ();
 	      if (MSYMBOL_TYPE (msym.minsym) == mst_text_gnu_ifunc)
 		result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
 	      found = 1;
diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplus-symbols.c
index 3657c8453e10..b68184c55f96 100644
--- a/gdb/compile/compile-cplus-symbols.c
+++ b/gdb/compile/compile-cplus-symbols.c
@@ -81,13 +81,13 @@ convert_one_symbol (compile_cplus_instance *instance,
 
 	case LOC_LABEL:
 	  kind = GCC_CP_SYMBOL_LABEL;
-	  addr = SYMBOL_VALUE_ADDRESS (sym.symbol);
+	  addr = sym.symbol->value_address ();
 	  break;
 
 	case LOC_BLOCK:
 	  {
 	    kind = GCC_CP_SYMBOL_FUNCTION;
-	    addr = BLOCK_START (SYMBOL_BLOCK_VALUE (sym.symbol));
+	    addr = BLOCK_START (sym.symbol->value_block ());
 	    if (is_global && sym.symbol->type ()->is_gnu_ifunc ())
 	      addr = gnu_ifunc_resolve_addr (target_gdbarch (), addr);
 	  }
@@ -101,7 +101,7 @@ convert_one_symbol (compile_cplus_instance *instance,
 	    }
 	  instance->plugin ().build_constant
 	    (sym_type, sym.symbol->natural_name (),
-	     SYMBOL_VALUE (sym.symbol), filename, line);
+	     sym.symbol->value_longest (), filename, line);
 	  return;
 
 	case LOC_CONST_BYTES:
@@ -173,7 +173,7 @@ convert_one_symbol (compile_cplus_instance *instance,
 
 	case LOC_STATIC:
 	  kind = GCC_CP_SYMBOL_VARIABLE;
-	  addr = SYMBOL_VALUE_ADDRESS (sym.symbol);
+	  addr = sym.symbol->value_address ();
 	  break;
 
 	case LOC_FINAL_VALUE:
@@ -281,7 +281,7 @@ convert_symbol_bmsym (compile_cplus_instance *instance,
   gcc_type sym_type;
   CORE_ADDR addr;
 
-  addr = MSYMBOL_VALUE_ADDRESS (objfile, msym);
+  addr = msym->value_address (objfile);
 
   /* Conversion copied from write_exp_msymbol.  */
   switch (MSYMBOL_TYPE (msym))
@@ -441,7 +441,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
 	    gdb_printf (gdb_stdlog,
 			"gcc_symbol_address \"%s\": full symbol\n",
 			identifier);
-	  result = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
+	  result = BLOCK_START (sym->value_block ());
 	  if (sym->type ()->is_gnu_ifunc ())
 	    result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
 	  found = 1;
@@ -458,7 +458,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
 			    "gcc_symbol_address \"%s\": minimal "
 			    "symbol\n",
 			    identifier);
-	      result = BMSYMBOL_VALUE_ADDRESS (msym);
+	      result = msym.value_address ();
 	      if (MSYMBOL_TYPE (msym.minsym) == mst_text_gnu_ifunc)
 		result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
 	      found = 1;
diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c
index 616f2c23980f..cea30304aa24 100644
--- a/gdb/compile/compile-cplus-types.c
+++ b/gdb/compile/compile-cplus-types.c
@@ -628,7 +628,7 @@ compile_cplus_convert_struct_or_union_members
 		const char *filename = symbol_symtab (sym.symbol)->filename;
 		unsigned int line = sym.symbol->line ();
 
-		physaddr = SYMBOL_VALUE_ADDRESS (sym.symbol);
+		physaddr = sym.symbol->value_address ();
 		instance->plugin ().build_decl
 		  ("field physname", field_name,
 		   (GCC_CP_SYMBOL_VARIABLE| get_field_access_flag (type, i)),
@@ -766,7 +766,7 @@ compile_cplus_convert_struct_or_union_methods (compile_cplus_instance *instance,
 
 	  const char *filename = symbol_symtab (sym.symbol)->filename;
 	  unsigned int line = sym.symbol->line ();
-	  CORE_ADDR address = BLOCK_START (SYMBOL_BLOCK_VALUE (sym.symbol));
+	  CORE_ADDR address = BLOCK_START (sym.symbol->value_block ());
 	  const char *kind;
 
 	  if (TYPE_FN_FIELD_STATIC_P (methods, j))
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index 7364a4ae8b24..bfb40c9625cd 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -771,7 +771,7 @@ compile_object_load (const compile_file_names &file_names,
 	case mst_text:
 	case mst_bss:
 	case mst_data:
-	  sym->value = BMSYMBOL_VALUE_ADDRESS (bmsym);
+	  sym->value = bmsym.value_address ();
 	  if (compile_debug)
 	    gdb_printf (gdb_stdlog,
 			"ELF mst_text symbol \"%s\" relocated to %s\n",
@@ -780,7 +780,7 @@ compile_object_load (const compile_file_names &file_names,
 	  break;
 	case mst_text_gnu_ifunc:
 	  sym->value = gnu_ifunc_resolve_addr (target_gdbarch (),
-					       BMSYMBOL_VALUE_ADDRESS (bmsym));
+					       bmsym.value_address ());
 	  if (compile_debug)
 	    gdb_printf (gdb_stdlog,
 			"ELF mst_text_gnu_ifunc symbol \"%s\" "
diff --git a/gdb/compile/compile-object-run.c b/gdb/compile/compile-object-run.c
index bce0f82a1ee2..d5742a5880de 100644
--- a/gdb/compile/compile-object-run.c
+++ b/gdb/compile/compile-object-run.c
@@ -145,7 +145,7 @@ compile_object_run (compile_module_up &&module)
 
       gdb_assert (func_type->code () == TYPE_CODE_FUNC);
       func_val = value_from_pointer (lookup_pointer_type (func_type),
-				   BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (func_sym)));
+				   BLOCK_ENTRY_PC (func_sym->value_block ()));
 
       vargs = XALLOCAVEC (struct value *, func_type->num_fields ());
       if (func_type->num_fields () >= 1)
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 3ac19fa001dd..b0fa33705ee1 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -281,7 +281,7 @@ cp_search_static_and_baseclasses (const char *name,
   if ((scope_type->code () == TYPE_CODE_FUNC
        || scope_type->code () == TYPE_CODE_METHOD)
       && domain == VAR_DOMAIN)
-    return lookup_symbol (nested, SYMBOL_BLOCK_VALUE (scope_sym.symbol),
+    return lookup_symbol (nested, scope_sym.symbol->value_block (),
 			  VAR_DOMAIN, NULL);
 
   /* Look for a symbol named NESTED in this class/namespace.
diff --git a/gdb/ctfread.c b/gdb/ctfread.c
index 87147a16bdf4..828f300d29d5 100644
--- a/gdb/ctfread.c
+++ b/gdb/ctfread.c
@@ -329,7 +329,7 @@ set_symbol_address (struct objfile *of, struct symbol *sym, const char *name)
   msym = lookup_minimal_symbol (name, nullptr, of);
   if (msym.minsym != NULL)
     {
-      SET_SYMBOL_VALUE_ADDRESS (sym, BMSYMBOL_VALUE_ADDRESS (msym));
+      sym->set_value_address (msym.value_address ());
       sym->set_aclass_index (LOC_STATIC);
       sym->set_section_index (msym.minsym->section_index ());
     }
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 49bcebd2a815..a536a087c7f3 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1655,7 +1655,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
 					  pst ? pst->filename : NULL,
 					  objfile);
 		  if (minsym.minsym != NULL)
-		    nlist.n_value = MSYMBOL_VALUE_RAW_ADDRESS (minsym.minsym);
+		    nlist.n_value = minsym.minsym->value_raw_address ();
 		}
 	      if (pst && textlow_not_set
 		  && gdbarch_sofun_address_maybe_missing (gdbarch))
@@ -1711,7 +1711,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
 					  pst ? pst->filename : NULL,
 					  objfile);
 		  if (minsym.minsym != NULL)
-		    nlist.n_value = MSYMBOL_VALUE_RAW_ADDRESS (minsym.minsym);
+		    nlist.n_value = minsym.minsym->value_raw_address ();
 		}
 	      if (pst && textlow_not_set
 		  && gdbarch_sofun_address_maybe_missing (gdbarch))
@@ -2024,7 +2024,7 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
 	}
 
       if (minsym.minsym)
-	pst->set_text_high (MSYMBOL_VALUE_RAW_ADDRESS (minsym.minsym)
+	pst->set_text_high (minsym.minsym->value_raw_address ()
 			    + MSYMBOL_SIZE (minsym.minsym));
 
       last_function_name = NULL;
@@ -2791,7 +2791,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
 		    = find_stab_function (name, get_last_source_file (),
 					  objfile);
 		  if (minsym.minsym != NULL)
-		    valu = BMSYMBOL_VALUE_ADDRESS (minsym);
+		    valu = minsym.value_address ();
 		}
 
 	      /* These addresses are absolute.  */
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index bb9778d9edde..ea45475810ec 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -453,7 +453,7 @@ dwarf2_find_location_expression (struct dwarf2_loclist_baton *baton,
 	  if (pc_block)
 	    pc_func = block_linkage_function (pc_block);
 
-	  if (pc_func && pc == BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (pc_func)))
+	  if (pc_func && pc == BLOCK_ENTRY_PC (pc_func->value_block ()))
 	    {
 	      *locexpr_length = length;
 	      return loc_ptr;
@@ -711,7 +711,7 @@ call_site_target::iterate_over_addresses
 			  : msym.minsym->print_name ()));
 			
 	  }
-	callback (BMSYMBOL_VALUE_ADDRESS (msym));
+	callback (msym.value_address ());
       }
       break;
 
@@ -753,7 +753,7 @@ func_addr_to_tail_call_list (struct gdbarch *gdbarch, CORE_ADDR addr)
   struct symbol *sym = find_pc_function (addr);
   struct type *type;
 
-  if (sym == NULL || BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)) != addr)
+  if (sym == NULL || BLOCK_ENTRY_PC (sym->value_block ()) != addr)
     throw_error (NO_ENTRY_VALUE_ERROR,
 		 _("DW_TAG_call_site resolving failed to find function "
 		   "name for address %s"),
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index d8268de8031c..ac5408f25734 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -7951,7 +7951,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
       psymbol.domain = VAR_DOMAIN;
       psymbol.aclass = LOC_BLOCK;
       psymbol.ginfo.set_section_index (SECT_OFF_TEXT (objfile));
-      psymbol.ginfo.value.address = addr;
+      psymbol.ginfo.set_value_address (addr);
 
       if (pdi->main_subprogram && actual_name != NULL)
 	set_objfile_main_name (objfile, actual_name, cu->per_cu->lang);
@@ -7996,7 +7996,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
 	      psymbol.domain = VAR_DOMAIN;
 	      psymbol.aclass = LOC_STATIC;
 	      psymbol.ginfo.set_section_index (SECT_OFF_TEXT (objfile));
-	      psymbol.ginfo.value.address = addr;
+	      psymbol.ginfo.set_value_address (addr);
 	      where = psymbol_placement::GLOBAL;
 	    }
 	}
@@ -8013,7 +8013,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
 	  psymbol.aclass = LOC_STATIC;
 	  psymbol.ginfo.set_section_index (SECT_OFF_TEXT (objfile));
 	  if (has_loc)
-	    psymbol.ginfo.value.address = addr;
+	    psymbol.ginfo.set_value_address (addr);
 	  where = psymbol_placement::STATIC;
 	}
       break;
@@ -17025,7 +17025,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
 	}
 
       sym = new_symbol (die, objfile_type (objfile)->builtin_void, cu);
-      SYMBOL_VALUE_COMMON_BLOCK (sym) = common_block;
+      sym->set_value_common_block (common_block);
     }
 }
 
@@ -21706,19 +21706,16 @@ var_decode_location (struct attribute *attr, struct symbol *sym,
 	  unsigned int dummy;
 
 	  if (block->data[0] == DW_OP_addr)
-	    SET_SYMBOL_VALUE_ADDRESS
-	      (sym, cu->header.read_address (objfile->obfd,
-					     block->data + 1,
-					     &dummy));
+	    sym->set_value_address
+	      (cu->header.read_address (objfile->obfd, block->data + 1,
+					&dummy));
 	  else
-	    SET_SYMBOL_VALUE_ADDRESS
-	      (sym, read_addr_index_from_leb128 (cu, block->data + 1,
-						 &dummy));
+	    sym->set_value_address
+	      (read_addr_index_from_leb128 (cu, block->data + 1, &dummy));
 	  sym->set_aclass_index (LOC_STATIC);
 	  fixup_symbol_section (sym, objfile);
-	  SET_SYMBOL_VALUE_ADDRESS
-	    (sym,
-	     SYMBOL_VALUE_ADDRESS (sym)
+	  sym->set_value_address
+	    (sym->value_address ()
 	     + objfile->section_offsets[sym->section_index ()]);
 	  return;
 	}
@@ -21841,7 +21838,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
 
 	      addr = attr->as_address ();
 	      addr = gdbarch_adjust_dwarf2_addr (gdbarch, addr + baseaddr);
-	      SET_SYMBOL_VALUE_ADDRESS (sym, addr);
+	      sym->set_value_address (addr);
 	      sym->set_aclass_index (LOC_LABEL);
 	    }
 	  else
@@ -21927,7 +21924,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
 		attr2 = NULL;
 
 	      if (sym->aclass () == LOC_STATIC
-		  && SYMBOL_VALUE_ADDRESS (sym) == 0
+		  && sym->value_address () == 0
 		  && !per_objfile->per_bfd->has_section_at_zero)
 		{
 		  /* When a static variable is eliminated by the linker,
@@ -22332,13 +22329,13 @@ dwarf2_const_value (const struct attribute *attr, struct symbol *sym,
       sym->set_aclass_index (dwarf2_locexpr_index);
     }
   else if (bytes != NULL)
-     {
-      SYMBOL_VALUE_BYTES (sym) = bytes;
+    {
+      sym->set_value_bytes (bytes);
       sym->set_aclass_index (LOC_CONST_BYTES);
     }
   else
     {
-      SYMBOL_VALUE (sym) = value;
+      sym->set_value_longest (value);
       sym->set_aclass_index (LOC_CONST);
     }
 }
diff --git a/gdb/elfread.c b/gdb/elfread.c
index fb40032c5051..3f1f87650f21 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -703,7 +703,7 @@ elf_gnu_ifunc_record_cache (const char *name, CORE_ADDR addr)
   msym = lookup_minimal_symbol_by_pc (addr);
   if (msym.minsym == NULL)
     return 0;
-  if (BMSYMBOL_VALUE_ADDRESS (msym) != addr)
+  if (msym.value_address () != addr)
     return 0;
   objfile = msym.objfile;
 
@@ -830,7 +830,7 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p)
 	continue;
       if (MSYMBOL_TYPE (msym.minsym) != mst_slot_got_plt)
 	continue;
-      pointer_address = BMSYMBOL_VALUE_ADDRESS (msym);
+      pointer_address = msym.value_address ();
 
       plt = bfd_get_section_by_name (obfd, ".plt");
       if (plt == NULL)
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index aea01bb7dbc1..4f95b224d732 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -611,7 +611,7 @@ info_common_command_for_block (const struct block *block, const char *comname,
   ALL_BLOCK_SYMBOLS (block, iter, sym)
     if (sym->domain () == COMMON_BLOCK_DOMAIN)
       {
-	const struct common_block *common = SYMBOL_VALUE_COMMON_BLOCK (sym);
+	const struct common_block *common = sym->value_common_block ();
 	size_t index;
 
 	gdb_assert (sym->aclass () == LOC_COMMON_BLOCK);
diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
index 1b7e36ef8cc7..b241e855bd6f 100644
--- a/gdb/fbsd-tdep.c
+++ b/gdb/fbsd-tdep.c
@@ -1939,7 +1939,7 @@ fbsd_read_integer_by_name (struct gdbarch *gdbarch, const char *name)
     error (_("Unable to resolve symbol '%s'"), name);
 
   gdb_byte buf[4];
-  if (target_read_memory (BMSYMBOL_VALUE_ADDRESS (ms), buf, sizeof buf) != 0)
+  if (target_read_memory (ms.value_address (), buf, sizeof buf) != 0)
     error (_("Unable to read value of '%s'"), name);
 
   return extract_signed_integer (buf, gdbarch_byte_order (gdbarch));
@@ -2048,7 +2048,7 @@ CORE_ADDR
 fbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   struct bound_minimal_symbol msym = lookup_bound_minimal_symbol ("_rtld_bind");
-  if (msym.minsym != nullptr && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
+  if (msym.minsym != nullptr && msym.value_address () == pc)
     return frame_unwind_caller_pc (get_current_frame ());
 
   return 0;
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 6660b0067957..ec21c82532b9 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -627,8 +627,7 @@ language_defn::read_var_value (struct symbol *var,
       /* Put the constant back in target format. */
       v = allocate_value (type);
       store_signed_integer (value_contents_raw (v).data (), TYPE_LENGTH (type),
-			    type_byte_order (type),
-			    (LONGEST) SYMBOL_VALUE (var));
+			    type_byte_order (type), var->value_longest ());
       VALUE_LVAL (v) = not_lval;
       return v;
 
@@ -638,13 +637,13 @@ language_defn::read_var_value (struct symbol *var,
       if (overlay_debugging)
 	{
 	  struct objfile *var_objfile = symbol_objfile (var);
-	  addr = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
+	  addr = symbol_overlayed_address (var->value_address (),
 					   var->obj_section (var_objfile));
 	  store_typed_address (value_contents_raw (v).data (), type, addr);
 	}
       else
 	store_typed_address (value_contents_raw (v).data (), type,
-			      SYMBOL_VALUE_ADDRESS (var));
+			      var->value_address ());
       VALUE_LVAL (v) = not_lval;
       return v;
 
@@ -655,7 +654,7 @@ language_defn::read_var_value (struct symbol *var,
 	  type = resolve_dynamic_type (type, {}, /* Unused address.  */ 0);
 	}
       v = allocate_value (type);
-      memcpy (value_contents_raw (v).data (), SYMBOL_VALUE_BYTES (var),
+      memcpy (value_contents_raw (v).data (), var->value_bytes (),
 	      TYPE_LENGTH (type));
       VALUE_LVAL (v) = not_lval;
       return v;
@@ -663,10 +662,10 @@ language_defn::read_var_value (struct symbol *var,
     case LOC_STATIC:
       if (overlay_debugging)
 	addr
-	  = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
+	  = symbol_overlayed_address (var->value_address (),
 				      var->obj_section (symbol_objfile (var)));
       else
-	addr = SYMBOL_VALUE_ADDRESS (var);
+	addr = var->value_address ();
       break;
 
     case LOC_ARG:
@@ -674,7 +673,7 @@ language_defn::read_var_value (struct symbol *var,
       if (!addr)
 	error (_("Unknown argument list address for `%s'."),
 	       var->print_name ());
-      addr += SYMBOL_VALUE (var);
+      addr += var->value_longest ();
       break;
 
     case LOC_REF_ARG:
@@ -686,7 +685,7 @@ language_defn::read_var_value (struct symbol *var,
 	if (!argref)
 	  error (_("Unknown argument list address for `%s'."),
 		 var->print_name ());
-	argref += SYMBOL_VALUE (var);
+	argref += var->value_longest ();
 	ref = value_at (lookup_pointer_type (type), argref);
 	addr = value_as_address (ref);
 	break;
@@ -694,7 +693,7 @@ language_defn::read_var_value (struct symbol *var,
 
     case LOC_LOCAL:
       addr = get_frame_locals_address (frame);
-      addr += SYMBOL_VALUE (var);
+      addr += var->value_longest ();
       break;
 
     case LOC_TYPEDEF:
@@ -705,10 +704,10 @@ language_defn::read_var_value (struct symbol *var,
     case LOC_BLOCK:
       if (overlay_debugging)
 	addr = symbol_overlayed_address
-	  (BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (var)),
+	  (BLOCK_ENTRY_PC (var->value_block ()),
 	   var->obj_section (symbol_objfile (var)));
       else
-	addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (var));
+	addr = BLOCK_ENTRY_PC (var->value_block ());
       break;
 
     case LOC_REGISTER:
@@ -778,9 +777,9 @@ language_defn::read_var_value (struct symbol *var,
 	   a TLS variable. */
 	if (obj_section == NULL
 	    || (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
-	   addr = MSYMBOL_VALUE_RAW_ADDRESS (msym);
+	   addr = msym->value_raw_address ();
 	else
-	   addr = BMSYMBOL_VALUE_ADDRESS (lookup_data.result);
+	   addr = lookup_data.result.value_address ();
 	if (overlay_debugging)
 	  addr = symbol_overlayed_address (addr, obj_section);
 	/* Determine address of TLS variable. */
diff --git a/gdb/frame.c b/gdb/frame.c
index 2b296ed6b961..2e574a2f009c 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -2430,12 +2430,12 @@ inside_main_func (frame_info *this_frame)
       if (bs.symbol == nullptr)
 	return false;
 
-      const struct block *block = SYMBOL_BLOCK_VALUE (bs.symbol);
+      const struct block *block = bs.symbol->value_block ();
       gdb_assert (block != nullptr);
       sym_addr = BLOCK_START (block);
     }
   else
-    sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
+    sym_addr = msymbol.value_address ();
 
   /* Convert any function descriptor addresses into the actual function
      code address.  */
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 1f291d9117d3..2328791a540b 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -1384,7 +1384,7 @@ frv_frame_this_id (struct frame_info *this_frame,
 
   /* Check if the stack is empty.  */
   msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL);
-  if (msym_stack.minsym && info->base == BMSYMBOL_VALUE_ADDRESS (msym_stack))
+  if (msym_stack.minsym && info->base == msym_stack.value_address ())
     return;
 
   /* Hopefully the prologue analysis either correctly determined the
diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c
index 34703cc3e125..f77e313e0dda 100644
--- a/gdb/ft32-tdep.c
+++ b/gdb/ft32-tdep.c
@@ -200,7 +200,7 @@ ft32_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
 		regnum);
       msymbol = lookup_minimal_symbol (prolog_symbol, NULL, NULL);
       if (msymbol.minsym)
-	prologs[regnum] = BMSYMBOL_VALUE_ADDRESS (msymbol);
+	prologs[regnum] = msymbol.value_address ();
       else
 	prologs[regnum] = 0;
     }
diff --git a/gdb/glibc-tdep.c b/gdb/glibc-tdep.c
index 19b69fb94dc7..7f6c12bc402f 100644
--- a/gdb/glibc-tdep.c
+++ b/gdb/glibc-tdep.c
@@ -66,7 +66,7 @@ glibc_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
       if (! fixup.minsym)
 	fixup = lookup_minimal_symbol ("fixup", NULL, resolver.objfile);
 
-      if (fixup.minsym && BMSYMBOL_VALUE_ADDRESS (fixup) == pc)
+      if (fixup.minsym && fixup.value_address () == pc)
 	return frame_unwind_caller_pc (get_current_frame ());
     }
 
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index baf015b9813d..7aac0ca4f9c2 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -1146,7 +1146,7 @@ gnuv3_get_typeid (struct value *value)
       if (minsym.minsym == NULL)
 	error (_("could not find typeinfo symbol for '%s'"), name);
 
-      result = value_at_lazy (typeinfo_type, BMSYMBOL_VALUE_ADDRESS (minsym));
+      result = value_at_lazy (typeinfo_type, minsym.value_address ());
     }
 
   return result;
@@ -1235,7 +1235,7 @@ gnuv3_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc)
   if (fn_sym.minsym == NULL)
     return 0;
 
-  method_stop_pc = BMSYMBOL_VALUE_ADDRESS (fn_sym);
+  method_stop_pc = fn_sym.value_address ();
 
   /* Some targets have minimal symbols pointing to function descriptors
      (powerpc 64 for example).  Make sure to retrieve the address
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 576678ae9b20..f9ececbb04fc 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -197,7 +197,7 @@ hppa_symbol_address(const char *sym)
 
   minsym = lookup_minimal_symbol (sym, NULL, NULL);
   if (minsym.minsym)
-    return BMSYMBOL_VALUE_ADDRESS (minsym);
+    return minsym.value_address ();
   else
     return (CORE_ADDR)-1;
 }
@@ -2528,7 +2528,7 @@ hppa_lookup_stub_minimal_symbol (const char *name,
 	    {
 	      struct unwind_table_entry *u;
 
-	      u = find_unwind_entry (MSYMBOL_VALUE (msym));
+	      u = find_unwind_entry (msym->value_longest ());
 	      if (u != NULL && u->stub_unwind.stub_type == stub_type)
 		{
 		  result.objfile = objfile;
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 719bd6888a8c..84eb6e5d79bc 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -979,7 +979,7 @@ prepare_one_step (thread_info *tp, struct step_command_fsm *sm)
 	      symbol *sym = inline_skipped_symbol (tp);
 	      if (sym->aclass () == LOC_BLOCK)
 		{
-		  const block *block = SYMBOL_BLOCK_VALUE (sym);
+		  const block *block = sym->value_block ();
 		  if (BLOCK_END (block) < tp->control.step_range_end)
 		    tp->control.step_range_end = BLOCK_END (block);
 		}
@@ -1336,7 +1336,7 @@ until_next_command (int from_tty)
       if (msymbol.minsym == NULL)
 	error (_("Execution is not within a known function."));
 
-      tp->control.step_range_start = BMSYMBOL_VALUE_ADDRESS (msymbol);
+      tp->control.step_range_start = msymbol.value_address ();
       /* The upper-bound of step_range is exclusive.  In order to make PC
 	 within the range, set the step_range_end with PC + 1.  */
       tp->control.step_range_end = pc + 1;
@@ -1345,7 +1345,7 @@ until_next_command (int from_tty)
     {
       sal = find_pc_line (pc, 0);
 
-      tp->control.step_range_start = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (func));
+      tp->control.step_range_start = BLOCK_ENTRY_PC (func->value_block ());
       tp->control.step_range_end = sal.end;
 
       /* By setting the step_range_end based on the current pc, we are
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 0b88eb8cfdfc..c311240b78cd 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -8090,7 +8090,7 @@ check_exception_resume (struct execution_control_state *ecs,
 	 cases such as throwing an exception from inside a signal
 	 handler.  */
 
-      b = SYMBOL_BLOCK_VALUE (func);
+      b = func->value_block ();
       ALL_BLOCK_SYMBOLS (b, iter, sym)
 	{
 	  if (!sym->is_argument ())
diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c
index a9006a6c8a3f..bcdf36cd067e 100644
--- a/gdb/inline-frame.c
+++ b/gdb/inline-frame.c
@@ -181,7 +181,7 @@ inline_frame_this_id (struct frame_info *this_frame,
      in the frame ID (and eventually, to set breakpoints).  */
   func = get_frame_function (this_frame);
   gdb_assert (func != NULL);
-  (*this_id).code_addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (func));
+  (*this_id).code_addr = BLOCK_ENTRY_PC (func->value_block ());
   (*this_id).artificial_depth++;
 }
 
@@ -329,7 +329,7 @@ stopped_by_user_bp_inline_frame (const block *frame_block, bpstat *stop_chain)
 		 to presenting the stop at the innermost inline
 		 function.  */
 	      if (loc->symbol == nullptr
-		  || frame_block == SYMBOL_BLOCK_VALUE (loc->symbol))
+		  || frame_block == loc->symbol->value_block ())
 		return true;
 	    }
 	}
diff --git a/gdb/jit.c b/gdb/jit.c
index 342b0d07114f..ae679a1f0437 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -265,7 +265,7 @@ jit_read_descriptor (gdbarch *gdbarch,
   jiter_objfile_data *objf_data = jiter->jiter_data.get ();
   gdb_assert (objf_data != nullptr);
 
-  CORE_ADDR addr = MSYMBOL_VALUE_ADDRESS (jiter, objf_data->descriptor);
+  CORE_ADDR addr = objf_data->descriptor->value_address (jiter);
 
   jit_debug_printf ("descriptor_addr = %s", paddress (gdbarch, addr));
 
@@ -591,7 +591,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
       block_name->set_aclass_index (LOC_BLOCK);
       symbol_set_symtab (block_name, filetab);
       block_name->set_type (lookup_function_type (block_type));
-      SYMBOL_BLOCK_VALUE (block_name) = new_block;
+      block_name->set_value_block (new_block);
 
       block_name->m_name = obstack_strdup (&objfile->objfile_obstack,
 					   gdb_block_iter.name.get ());
@@ -887,7 +887,7 @@ jit_breakpoint_re_set_internal (struct gdbarch *gdbarch, program_space *pspace)
       bound_minimal_symbol reg_symbol
 	= lookup_minimal_symbol (jit_break_name, nullptr, the_objfile);
       if (reg_symbol.minsym == NULL
-	  || BMSYMBOL_VALUE_ADDRESS (reg_symbol) == 0)
+	  || reg_symbol.value_address () == 0)
 	{
 	  /* No need to repeat the lookup the next time.  */
 	  the_objfile->skip_jit_symbol_lookup = true;
@@ -897,7 +897,7 @@ jit_breakpoint_re_set_internal (struct gdbarch *gdbarch, program_space *pspace)
       bound_minimal_symbol desc_symbol
 	= lookup_minimal_symbol (jit_descriptor_name, NULL, the_objfile);
       if (desc_symbol.minsym == NULL
-	  || BMSYMBOL_VALUE_ADDRESS (desc_symbol) == 0)
+	  || desc_symbol.value_address () == 0)
 	{
 	  /* No need to repeat the lookup the next time.  */
 	  the_objfile->skip_jit_symbol_lookup = true;
@@ -909,9 +909,7 @@ jit_breakpoint_re_set_internal (struct gdbarch *gdbarch, program_space *pspace)
       objf_data->register_code = reg_symbol.minsym;
       objf_data->descriptor = desc_symbol.minsym;
 
-      CORE_ADDR addr = MSYMBOL_VALUE_ADDRESS (the_objfile,
-					      objf_data->register_code);
-
+      CORE_ADDR addr = objf_data->register_code->value_address (the_objfile);
       jit_debug_printf ("breakpoint_addr = %s", paddress (gdbarch, addr));
 
       /* Check if we need to re-create the breakpoint.  */
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 9d4707cbb4e7..3c176bea94e5 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -2224,14 +2224,14 @@ convert_linespec_to_sals (struct linespec_state *state, linespec *ls)
 		   && sym.symbol->aclass () == LOC_BLOCK)
 		{
 		  const CORE_ADDR addr
-		    = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym.symbol));
+		    = BLOCK_ENTRY_PC (sym.symbol->value_block ());
 
 		  for (const auto &elem : ls->minimal_symbols)
 		    {
 		      if (MSYMBOL_TYPE (elem.minsym) == mst_text_gnu_ifunc
 			  || MSYMBOL_TYPE (elem.minsym) == mst_data_gnu_ifunc)
 			{
-			  CORE_ADDR msym_addr = BMSYMBOL_VALUE_ADDRESS (elem);
+			  CORE_ADDR msym_addr = elem.value_address ();
 			  if (MSYMBOL_TYPE (elem.minsym) == mst_data_gnu_ifunc)
 			    {
 			      struct gdbarch *gdbarch
@@ -3986,7 +3986,7 @@ find_label_symbols (struct linespec_state *self,
 	  fn_sym = elt.symbol;
 	  set_current_program_space
 	    (symbol_symtab (fn_sym)->compunit ()->objfile ()->pspace);
-	  block = SYMBOL_BLOCK_VALUE (fn_sym);
+	  block = fn_sym->value_block ();
 
 	  find_label_symbols_in_block (block, name, fn_sym, completion_mode,
 				       &result, label_funcs_ret);
@@ -4166,7 +4166,7 @@ minsym_found (struct linespec_state *self, struct objfile *objfile,
       if (is_function)
 	sal.pc = func_addr;
       else
-	sal.pc = MSYMBOL_VALUE_ADDRESS (objfile, msymbol);
+	sal.pc = msymbol->value_address (objfile);
       sal.pspace = current_program_space;
     }
 
@@ -4377,13 +4377,13 @@ symbol_to_sal (struct symtab_and_line *result,
     }
   else
     {
-      if (sym->aclass () == LOC_LABEL && SYMBOL_VALUE_ADDRESS (sym) != 0)
+      if (sym->aclass () == LOC_LABEL && sym->value_address () != 0)
 	{
 	  *result = {};
 	  result->symtab = symbol_symtab (sym);
 	  result->symbol = sym;
 	  result->line = sym->line ();
-	  result->pc = SYMBOL_VALUE_ADDRESS (sym);
+	  result->pc = sym->value_address ();
 	  result->pspace = result->symtab->compunit ()->objfile ()->pspace;
 	  result->explicit_pc = 1;
 	  return 1;
@@ -4399,7 +4399,7 @@ symbol_to_sal (struct symtab_and_line *result,
 	  result->symtab = symbol_symtab (sym);
 	  result->symbol = sym;
 	  result->line = sym->line ();
-	  result->pc = SYMBOL_VALUE_ADDRESS (sym);
+	  result->pc = sym->value_address ();
 	  result->pspace = result->symtab->compunit ()->objfile ()->pspace;
 	  return 1;
 	}
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 2837233ac6a9..11da82a1abc7 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -474,7 +474,7 @@ inferior_has_bug (const char *ver_symbol, int ver_major_min, int ver_minor_min)
   if (version_msym.minsym == NULL)
     return 0;
 
-  version_addr = BMSYMBOL_VALUE_ADDRESS (version_msym);
+  version_addr = version_msym.value_address ();
   gdb::unique_xmalloc_ptr<char> version
     = target_read_string (version_addr, 32, &got);
   if (version != nullptr
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index 02e3cf1b4e7b..85bac11b8fb6 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -490,7 +490,7 @@ exp	:	STRING
 
 /* This will be used for extensions later.  Like adding modules.  */
 block	:	fblock	
-			{ $$ = SYMBOL_BLOCK_VALUE($1); }
+			{ $$ = $1->value_block (); }
 	;
 
 fblock	:	BLOCKNAME
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index 55ef5a551f8b..4971be796cd3 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -2216,7 +2216,7 @@ m32c_return_value (struct gdbarch *gdbarch,
 	    error (_("The return value is stored in memory at 'mem0', "
 		     "but GDB cannot find\n"
 		     "its address."));
-	  read_memory (BMSYMBOL_VALUE_ADDRESS (mem0), readbuf, valtype_len);
+	  read_memory (mem0.value_address (), readbuf, valtype_len);
 	}
     }
 
@@ -2248,7 +2248,7 @@ m32c_return_value (struct gdbarch *gdbarch,
 	    error (_("The return value is stored in memory at 'mem0', "
 		     "but GDB cannot find\n"
 		     " its address."));
-	  write_memory (BMSYMBOL_VALUE_ADDRESS (mem0), writebuf, valtype_len);
+	  write_memory (mem0.value_address (), writebuf, valtype_len);
 	}
     }
 
@@ -2473,7 +2473,7 @@ m32c_m16c_address_to_pointer (struct gdbarch *gdbarch,
       else
 	{
 	  /* The trampoline's address is our pointer.  */
-	  addr = BMSYMBOL_VALUE_ADDRESS (tramp_msym);
+	  addr = tramp_msym.value_address ();
 	}
     }
 
@@ -2525,7 +2525,7 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch,
 	      /* If we do have such a symbol, return its value as the
 		 function's true address.  */
 	      if (func_msym.minsym)
-		ptr = BMSYMBOL_VALUE_ADDRESS (func_msym);
+		ptr = func_msym.value_address ();
 	    }
 	}
       else
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index 9c276fb7593c..3ad4c8de6bf2 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -811,7 +811,7 @@ m32r_frame_this_id (struct frame_info *this_frame,
 
   /* Check if the stack is empty.  */
   msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL);
-  if (msym_stack.minsym && info->base == BMSYMBOL_VALUE_ADDRESS (msym_stack))
+  if (msym_stack.minsym && info->base == msym_stack.value_address ())
     return;
 
   /* Hopefully the prologue analysis either correctly determined the
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 5c1f20415c8c..e82b18a848fc 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -215,7 +215,7 @@ m68hc11_get_register_info (struct m68hc11_soft_reg *reg, const char *name)
   msymbol = lookup_minimal_symbol (name, NULL, NULL);
   if (msymbol.minsym)
     {
-      reg->addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
+      reg->addr = msymbol.value_address ();
       reg->name = xstrdup (name);
 
       /* Keep track of the address range for soft registers.  */
diff --git a/gdb/machoread.c b/gdb/machoread.c
index 14a7428a9793..90f25b3c1912 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -404,7 +404,7 @@ macho_resolve_oso_sym_with_minsym (struct objfile *main_objfile, asymbol *sym)
       return 0;
     }
   else
-    return BMSYMBOL_VALUE_ADDRESS (msym);
+    return msym.value_address ();
 }
 
 /* Add oso file OSO/ABFD as a symbol file.  */
diff --git a/gdb/maint.c b/gdb/maint.c
index 8cebd6ab5af3..3f3dad5bd794 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -588,7 +588,7 @@ maintenance_translate_address (const char *arg, int from_tty)
     {
       const char *symbol_name = sym.minsym->print_name ();
       const char *symbol_offset
-	= pulongest (address - BMSYMBOL_VALUE_ADDRESS (sym));
+	= pulongest (address - sym.value_address ());
 
       sect = sym.obj_section ();
       if (sect != NULL)
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 67630b793327..6dcac13d2c5b 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -533,7 +533,7 @@ reg_value_complaint (int regnum, int num_regs, const char *sym)
 static int
 mdebug_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
 {
-  int regno = gdbarch_ecoff_reg_to_regnum (gdbarch, SYMBOL_VALUE (sym));
+  int regno = gdbarch_ecoff_reg_to_regnum (gdbarch, sym->value_longest ());
 
   if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
     {
@@ -631,7 +631,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
       b = BLOCKVECTOR_BLOCK (top_stack->cur_st->compunit ()->blockvector (),
 			     GLOBAL_BLOCK);
       s = new_symbol (name);
-      SET_SYMBOL_VALUE_ADDRESS (s, (CORE_ADDR) sh->value);
+      s->set_value_address (sh->value);
       add_data_symbol (sh, ax, bigend, s, LOC_STATIC, b, objfile, name);
       break;
 
@@ -644,18 +644,18 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
 	     address is not in the symbol; we need to fix it later in
 	     scan_file_globals.  */
 	  int bucket = hashname (s->linkage_name ());
-	  SYMBOL_VALUE_CHAIN (s) = global_sym_chain[bucket];
+	  s->set_value_chain (global_sym_chain[bucket]);
 	  global_sym_chain[bucket] = s;
 	}
       else
-	SET_SYMBOL_VALUE_ADDRESS (s, (CORE_ADDR) sh->value);
+	s->set_value_address (sh->value);
       add_data_symbol (sh, ax, bigend, s, LOC_STATIC, b, objfile, name);
       break;
 
     case stLocal:		/* Local variable, goes into current block.  */
       b = top_stack->cur_block;
       s = new_symbol (name);
-      SYMBOL_VALUE (s) = svalue;
+      s->set_value_longest (svalue);
       if (sh->sc == scRegister)
 	add_data_symbol (sh, ax, bigend, s, mdebug_register_index,
 			 b, objfile, name);
@@ -696,7 +696,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
 	  s->set_aclass_index (LOC_ARG);
 	  break;
 	}
-      SYMBOL_VALUE (s) = svalue;
+      s->set_value_longest (svalue);
       s->set_type (parse_type (cur_fd, ax, sh->index, 0, bigend, name));
       add_symbol (s, top_stack->cur_st, top_stack->cur_block);
       break;
@@ -705,7 +705,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
       s = new_symbol (name);
       s->set_domain (VAR_DOMAIN);	/* So that it can be used */
       s->set_aclass_index (LOC_LABEL);	/* but not misused.  */
-      SET_SYMBOL_VALUE_ADDRESS (s, (CORE_ADDR) sh->value);
+      s->set_value_address (sh->value);
       s->set_type (objfile_type (objfile)->builtin_int);
       add_symbol (s, top_stack->cur_st, top_stack->cur_block);
       break;
@@ -796,7 +796,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
 
       /* Create and enter a new lexical context.  */
       b = new_block (FUNCTION_BLOCK, s->language ());
-      SYMBOL_BLOCK_VALUE (s) = b;
+      s->set_value_block (b);
       BLOCK_FUNCTION (b) = s;
       BLOCK_START (b) = BLOCK_END (b) = sh->value;
       BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
@@ -1068,8 +1068,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
 		enum_sym->set_aclass_index (LOC_CONST);
 		enum_sym->set_type (t);
 		enum_sym->set_domain (VAR_DOMAIN);
-		SYMBOL_VALUE (enum_sym) = tsym.value;
-		if (SYMBOL_VALUE (enum_sym) < 0)
+		enum_sym->set_value_longest (tsym.value);
+		if (enum_sym->value_longest () < 0)
 		  unsigned_enum = 0;
 		add_symbol (enum_sym, top_stack->cur_st, top_stack->cur_block);
 
@@ -1099,7 +1099,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
 	s = new_symbol (name);
 	s->set_domain (STRUCT_DOMAIN);
 	s->set_aclass_index (LOC_TYPEDEF);
-	SYMBOL_VALUE (s) = 0;
+	s->set_value_longest (0);
 	s->set_type (t);
 	add_symbol (s, top_stack->cur_st, top_stack->cur_block);
 	break;
@@ -1159,7 +1159,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
 	  s->set_type (objfile_type (mdebugread_objfile)->builtin_void);
 	  e = OBSTACK_ZALLOC (&mdebugread_objfile->objfile_obstack,
 			      mdebug_extra_func_info);
-	  SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;
+	  s->set_value_bytes ((gdb_byte *) e);
 	  e->numargs = top_stack->numargs;
 	  e->pdr.framereg = -1;
 	  add_symbol (s, top_stack->cur_st, top_stack->cur_block);
@@ -1297,7 +1297,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
       s = new_symbol (name);
       s->set_domain (VAR_DOMAIN);
       s->set_aclass_index (LOC_TYPEDEF);
-      SYMBOL_BLOCK_VALUE (s) = top_stack->cur_block;
+      s->set_value_block (top_stack->cur_block);
       s->set_type (t);
       add_symbol (s, top_stack->cur_st, top_stack->cur_block);
 
@@ -1977,7 +1977,7 @@ parse_procedure (PDR *pr, struct compunit_symtab *search_symtab,
 
   if (s != 0)
     {
-      b = SYMBOL_BLOCK_VALUE (s);
+      b = s->value_block ();
     }
   else
     {
@@ -2012,7 +2012,7 @@ parse_procedure (PDR *pr, struct compunit_symtab *search_symtab,
     {
       struct mdebug_extra_func_info *e;
       
-      e = (struct mdebug_extra_func_info *) SYMBOL_VALUE_BYTES (i);
+      e = (struct mdebug_extra_func_info *) i->value_bytes ();
       e->pdr = *pr;
 
       /* GDB expects the absolute function start address for the
@@ -3990,7 +3990,7 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
 		  s->set_domain (LABEL_DOMAIN);
 		  s->set_aclass_index (LOC_CONST);
 		  s->set_type (objfile_type (objfile)->builtin_void);
-		  SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;
+		  s->set_value_bytes ((gdb_byte *) e);
 		  e->pdr.framereg = -1;
 		  add_symbol_to_list (s, get_local_symbols ());
 		}
diff --git a/gdb/mi/mi-symbol-cmds.c b/gdb/mi/mi-symbol-cmds.c
index 5d6d34129291..60321f767962 100644
--- a/gdb/mi/mi-symbol-cmds.c
+++ b/gdb/mi/mi-symbol-cmds.c
@@ -100,7 +100,7 @@ output_nondebug_symbol (ui_out *uiout,
   ui_out_emit_tuple tuple_emitter (uiout, NULL);
 
   uiout->field_core_addr ("address", gdbarch,
-			  BMSYMBOL_VALUE_ADDRESS (msymbol));
+			  msymbol.value_address ());
   uiout->field_string ("name", msymbol.minsym->print_name ());
 }
 
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index a24930ba9425..e93cbed86216 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -113,7 +113,7 @@ bool
 msymbol_is_function (struct objfile *objfile, minimal_symbol *minsym,
 		     CORE_ADDR *func_address_p)
 {
-  CORE_ADDR msym_addr = MSYMBOL_VALUE_ADDRESS (objfile, minsym);
+  CORE_ADDR msym_addr = minsym->value_address (objfile);
 
   switch (minsym->type)
     {
@@ -498,7 +498,7 @@ find_minimal_symbol_address (const char *name, CORE_ADDR *addr,
     = lookup_minimal_symbol (name, NULL, objfile);
 
   if (sym.minsym != NULL)
-    *addr = BMSYMBOL_VALUE_ADDRESS (sym);
+    *addr = sym.value_address ();
 
   return sym.minsym == NULL;
 }
@@ -665,7 +665,7 @@ lookup_minimal_symbol_by_pc_name (CORE_ADDR pc, const char *name,
 	       msymbol != NULL;
 	       msymbol = msymbol->hash_next)
 	    {
-	      if (MSYMBOL_VALUE_ADDRESS (objfile, msymbol) == pc
+	      if (msymbol->value_address (objfile) == pc
 		  && strcmp (msymbol->linkage_name (), name) == 0)
 		return msymbol;
 	    }
@@ -799,14 +799,14 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 	     Warning: this code is trickier than it would appear at first.  */
 
 	  if (frob_address (objfile, &pc)
-	      && pc >= MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[lo]))
+	      && pc >= msymbol[lo].value_raw_address ())
 	    {
-	      while (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi]) > pc)
+	      while (msymbol[hi].value_raw_address () > pc)
 		{
 		  /* pc is still strictly less than highest address.  */
 		  /* Note "new" will always be >= lo.  */
 		  newobj = (lo + hi) / 2;
-		  if ((MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[newobj]) >= pc)
+		  if ((msymbol[newobj].value_raw_address () >= pc)
 		      || (lo == newobj))
 		    {
 		      hi = newobj;
@@ -821,8 +821,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 		 hi to point to the last one.  That way we can find the
 		 right symbol if it has an index greater than hi.  */
 	      while (hi < objfile->per_bfd->minimal_symbol_count - 1
-		     && (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
-			 == MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi + 1])))
+		     && (msymbol[hi].value_raw_address ()
+			 == msymbol[hi + 1].value_raw_address ()))
 		hi++;
 
 	      /* Skip various undesirable symbols.  */
@@ -870,8 +870,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 		      && MSYMBOL_TYPE (&msymbol[hi - 1]) == want_type
 		      && (MSYMBOL_SIZE (&msymbol[hi])
 			  == MSYMBOL_SIZE (&msymbol[hi - 1]))
-		      && (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
-			  == MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi - 1]))
+		      && (msymbol[hi].value_raw_address ()
+			  == msymbol[hi - 1].value_raw_address ())
 		      && (msymbol[hi].obj_section (objfile)
 			  == msymbol[hi - 1].obj_section (objfile)))
 		    {
@@ -900,9 +900,9 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 		     the cancellable variants, but both have sizes.  */
 		  if (hi > 0
 		      && MSYMBOL_SIZE (&msymbol[hi]) != 0
-		      && pc >= (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
+		      && pc >= (msymbol[hi].value_raw_address ()
 				+ MSYMBOL_SIZE (&msymbol[hi]))
-		      && pc < (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi - 1])
+		      && pc < (msymbol[hi - 1].value_raw_address ()
 			       + MSYMBOL_SIZE (&msymbol[hi - 1])))
 		    {
 		      hi--;
@@ -932,7 +932,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 
 	      if (hi >= 0
 		  && MSYMBOL_SIZE (&msymbol[hi]) != 0
-		  && pc >= (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
+		  && pc >= (msymbol[hi].value_raw_address ()
 			    + MSYMBOL_SIZE (&msymbol[hi])))
 		{
 		  if (best_zero_sized != -1)
@@ -944,9 +944,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 		      if (previous != nullptr)
 			{
 			  if (previous->minsym == nullptr
-			      || (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
-				  > MSYMBOL_VALUE_RAW_ADDRESS
-					(previous->minsym)))
+			      || (msymbol[hi].value_raw_address ()
+				  > previous->minsym->value_raw_address ()))
 			    {
 			      previous->minsym = &msymbol[hi];
 			      previous->objfile = objfile;
@@ -963,8 +962,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 
 	      if (hi >= 0
 		  && ((best_symbol == NULL) ||
-		      (MSYMBOL_VALUE_RAW_ADDRESS (best_symbol) <
-		       MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi]))))
+		      (best_symbol->value_raw_address () <
+		       msymbol[hi].value_raw_address ())))
 		{
 		  best_symbol = &msymbol[hi];
 		  best_objfile = objfile;
@@ -1209,7 +1208,7 @@ minimal_symbol_reader::record_full (gdb::string_view name,
   else
     msymbol->m_name = name.data ();
 
-  SET_MSYMBOL_VALUE_ADDRESS (msymbol, address);
+  msymbol->set_value_address (address);
   msymbol->set_section_index (section);
 
   MSYMBOL_TYPE (msymbol) = ms_type;
@@ -1233,11 +1232,11 @@ static inline bool
 minimal_symbol_is_less_than (const minimal_symbol &fn1,
 			     const minimal_symbol &fn2)
 {
-  if (MSYMBOL_VALUE_RAW_ADDRESS (&fn1) < MSYMBOL_VALUE_RAW_ADDRESS (&fn2))
+  if ((&fn1)->value_raw_address () < (&fn2)->value_raw_address ())
     {
       return true;		/* addr 1 is less than addr 2.  */
     }
-  else if (MSYMBOL_VALUE_RAW_ADDRESS (&fn1) > MSYMBOL_VALUE_RAW_ADDRESS (&fn2))
+  else if ((&fn1)->value_raw_address () > (&fn2)->value_raw_address ())
     {
       return false;		/* addr 1 is greater than addr 2.  */
     }
@@ -1297,8 +1296,8 @@ compact_minimal_symbols (struct minimal_symbol *msymbol, int mcount,
       copyfrom = copyto = msymbol;
       while (copyfrom < msymbol + mcount - 1)
 	{
-	  if (MSYMBOL_VALUE_RAW_ADDRESS (copyfrom)
-	      == MSYMBOL_VALUE_RAW_ADDRESS ((copyfrom + 1))
+	  if (copyfrom->value_raw_address ()
+	      == (copyfrom + 1)->value_raw_address ()
 	      && (copyfrom->section_index ()
 		  == (copyfrom + 1)->section_index ())
 	      && strcmp (copyfrom->linkage_name (),
@@ -1596,7 +1595,7 @@ minimal_symbol_upper_bound (struct bound_minimal_symbol minsym)
      of the section, as the end of the function.  */
 
   if (MSYMBOL_SIZE (minsym.minsym) != 0)
-    return BMSYMBOL_VALUE_ADDRESS (minsym) + MSYMBOL_SIZE (minsym.minsym);
+    return minsym.value_address () + MSYMBOL_SIZE (minsym.minsym);
 
   /* Step over other symbols at this same address, and symbols in
      other sections, to find the next symbol in this section with a
@@ -1609,17 +1608,17 @@ minimal_symbol_upper_bound (struct bound_minimal_symbol minsym)
   section = msymbol->section_index ();
   for (iter = msymbol + 1; iter != past_the_end; ++iter)
     {
-      if ((MSYMBOL_VALUE_RAW_ADDRESS (iter)
-	   != MSYMBOL_VALUE_RAW_ADDRESS (msymbol))
+      if ((iter->value_raw_address ()
+	   != msymbol->value_raw_address ())
 	  && iter->section_index () == section)
 	break;
     }
 
   obj_section = minsym.obj_section ();
   if (iter != past_the_end
-      && (MSYMBOL_VALUE_ADDRESS (minsym.objfile, iter)
+      && (iter->value_address (minsym.objfile)
 	  < obj_section->endaddr ()))
-    result = MSYMBOL_VALUE_ADDRESS (minsym.objfile, iter);
+    result = iter->value_address (minsym.objfile);
   else
     /* We got the start address from the last msymbol in the objfile.
        So the end address is the end of the section.  */
diff --git a/gdb/minsyms.h b/gdb/minsyms.h
index 519702494ed5..cf2c3c1f85fa 100644
--- a/gdb/minsyms.h
+++ b/gdb/minsyms.h
@@ -36,6 +36,11 @@ struct bound_minimal_symbol
 
   bound_minimal_symbol () = default;
 
+  CORE_ADDR value_address () const
+  {
+    return this->minsym->value_address (this->objfile);
+  }
+
   /* The minimal symbol that was found, or NULL if no minimal symbol
      was found.  */
 
diff --git a/gdb/mips-fbsd-tdep.c b/gdb/mips-fbsd-tdep.c
index e7eeecb2174f..05043d93e745 100644
--- a/gdb/mips-fbsd-tdep.c
+++ b/gdb/mips-fbsd-tdep.c
@@ -470,7 +470,7 @@ mips_fbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   struct bound_minimal_symbol msym
     = lookup_bound_minimal_symbol ("_mips_rtld_bind");
-  if (msym.minsym != nullptr && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
+  if (msym.minsym != nullptr && msym.value_address () == pc)
     return frame_unwind_caller_pc (get_current_frame ());
 
   return fbsd_skip_solib_resolver (gdbarch, pc);
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 3f4c1b321b3f..d8f90ccf8812 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -701,7 +701,7 @@ mips_linux_skip_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
 
   resolver = lookup_minimal_symbol ("__dl_runtime_resolve", NULL, NULL);
 
-  if (resolver.minsym && BMSYMBOL_VALUE_ADDRESS (resolver) == pc)
+  if (resolver.minsym && resolver.value_address () == pc)
     return frame_unwind_caller_pc (get_current_frame ());
 
   return glibc_skip_solib_resolver (gdbarch, pc);
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 9157e9fa1434..78e7f5ccf871 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -436,12 +436,12 @@ mips_elf_make_msymbol_special (asymbol * sym, struct minimal_symbol *msym)
   if (ELF_ST_IS_MICROMIPS (st_other))
     {
       MSYMBOL_TARGET_FLAG_MICROMIPS (msym) = 1;
-      SET_MSYMBOL_VALUE_ADDRESS (msym, MSYMBOL_VALUE_RAW_ADDRESS (msym) | 1);
+      msym->set_value_address (msym->value_raw_address () | 1);
     }
   else if (ELF_ST_IS_MIPS16 (st_other))
     {
       MSYMBOL_TARGET_FLAG_MIPS16 (msym) = 1;
-      SET_MSYMBOL_VALUE_ADDRESS (msym, MSYMBOL_VALUE_RAW_ADDRESS (msym) | 1);
+      msym->set_value_address (msym->value_raw_address () | 1);
     }
 }
 
@@ -486,7 +486,7 @@ mips_make_symbol_special (struct symbol *sym, struct objfile *objfile)
   if (sym->aclass () == LOC_BLOCK)
     {
       /* We are in symbol reading so it is OK to cast away constness.  */
-      struct block *block = (struct block *) SYMBOL_BLOCK_VALUE (sym);
+      struct block *block = (struct block *) sym->value_block ();
       CORE_ADDR compact_block_start;
       struct bound_minimal_symbol msym;
 
@@ -7830,7 +7830,7 @@ mips_skip_pic_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
      which jumps to foo.  */
   msym = lookup_minimal_symbol_by_pc (pc);
   if (msym.minsym == NULL
-      || BMSYMBOL_VALUE_ADDRESS (msym) != pc
+      || msym.value_address () != pc
       || msym.minsym->linkage_name () == NULL
       || !startswith (msym.minsym->linkage_name (), ".pic."))
     return 0;
diff --git a/gdb/netbsd-tdep.c b/gdb/netbsd-tdep.c
index 38b8a195358e..fbedb77f46e7 100644
--- a/gdb/netbsd-tdep.c
+++ b/gdb/netbsd-tdep.c
@@ -367,7 +367,7 @@ nbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
   struct bound_minimal_symbol msym;
 
   msym = lookup_minimal_symbol ("_rtld_bind_start", NULL, NULL);
-  if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
+  if (msym.minsym && msym.value_address () == pc)
     return frame_unwind_caller_pc (get_current_frame ());
   else
     return find_solib_trampoline_target (get_current_frame (), pc);
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index ed13097f7a85..00c362c5c9c8 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -1249,7 +1249,7 @@ find_objc_msgsend (void)
 	  continue; 
 	}
 
-      methcalls[i].begin = BMSYMBOL_VALUE_ADDRESS (func);
+      methcalls[i].begin = func.value_address ();
       methcalls[i].end = minimal_symbol_upper_bound (func);
     }
 }
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index ddd94da42a6f..0c71e0bd6a9f 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -619,11 +619,8 @@ relocate_one_symbol (struct symbol *sym, struct objfile *objfile,
   if ((sym->aclass () == LOC_LABEL
        || sym->aclass () == LOC_STATIC)
       && sym->section_index () >= 0)
-    {
-      SET_SYMBOL_VALUE_ADDRESS (sym,
-				SYMBOL_VALUE_ADDRESS (sym)
-				+ delta[sym->section_index ()]);
-    }
+    sym->set_value_address (sym->value_address ()
+			    + delta[sym->section_index ()]);
 }
 
 /* Relocate OBJFILE to NEW_OFFSETS.  There should be OBJFILE->NUM_SECTIONS
diff --git a/gdb/obsd-tdep.c b/gdb/obsd-tdep.c
index f9b967ac47d7..eed327bf7a92 100644
--- a/gdb/obsd-tdep.c
+++ b/gdb/obsd-tdep.c
@@ -31,7 +31,7 @@ obsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
   struct bound_minimal_symbol msym;
 
   msym = lookup_minimal_symbol("_dl_bind", NULL, NULL);
-  if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
+  if (msym.minsym && msym.value_address () == pc)
     return frame_unwind_caller_pc (get_current_frame ());
   else
     return find_solib_trampoline_target (get_current_frame (), pc);
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 3d1ea722d81d..ffa82f6e42c3 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -612,7 +612,7 @@ exp	:	THIS
 block	:	BLOCKNAME
 			{
 			  if ($1.sym.symbol != 0)
-			      $$ = SYMBOL_BLOCK_VALUE ($1.sym.symbol);
+			      $$ = $1.sym.symbol->value_block ();
 			  else
 			    {
 			      std::string copy = copy_name ($1.stoken);
@@ -639,7 +639,7 @@ block	:	block COLONCOLON name
 			  if (!tem || tem->aclass () != LOC_BLOCK)
 			    error (_("No function \"%s\" in specified context."),
 				   copy.c_str ());
-			  $$ = SYMBOL_BLOCK_VALUE (tem); }
+			  $$ = tem->value_block (); }
 	;
 
 variable:	block COLONCOLON name
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 427520fa6a07..43c286d64727 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -228,7 +228,7 @@ pascal_language::value_print_inner (struct value *val,
 	  /* If 'symbol_print' is set, we did the work above.  */
 	  if (!options->symbol_print
 	      && (msymbol.minsym != NULL)
-	      && (vt_address == BMSYMBOL_VALUE_ADDRESS (msymbol)))
+	      && (vt_address == msymbol.value_address ()))
 	    {
 	      if (want_space)
 		gdb_puts (" ", stream);
diff --git a/gdb/parse.c b/gdb/parse.c
index 6d1b3d9d9238..2389dbf0b0f5 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -115,11 +115,11 @@ find_minsym_type_and_address (minimal_symbol *msymbol,
     {
       /* Addresses of TLS symbols are really offsets into a
 	 per-objfile/per-thread storage block.  */
-      addr = MSYMBOL_VALUE_RAW_ADDRESS (bound_msym.minsym);
+      addr = bound_msym.minsym->value_raw_address ();
     }
   else if (msymbol_is_function (objfile, msymbol, &addr))
     {
-      if (addr != BMSYMBOL_VALUE_ADDRESS (bound_msym))
+      if (addr != bound_msym.value_address ())
 	{
 	  /* This means we resolved a function descriptor, and we now
 	     have an address for a code/text symbol instead of a data
@@ -132,7 +132,7 @@ find_minsym_type_and_address (minimal_symbol *msymbol,
 	}
     }
   else
-    addr = BMSYMBOL_VALUE_ADDRESS (bound_msym);
+    addr = bound_msym.value_address ();
 
   if (overlay_debugging)
     addr = symbol_overlayed_address (addr, section);
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index ece7e7639232..a11f3672393b 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1662,9 +1662,9 @@ ppc_elfv2_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR pc)
   if (MSYMBOL_TARGET_FLAG_1 (fun.minsym))
     local_entry_offset = 8;
 
-  if (BMSYMBOL_VALUE_ADDRESS (fun) <= pc
-      && pc < BMSYMBOL_VALUE_ADDRESS (fun) + local_entry_offset)
-    return BMSYMBOL_VALUE_ADDRESS (fun) + local_entry_offset;
+  if (fun.value_address () <= pc
+      && pc < fun.value_address () + local_entry_offset)
+    return fun.value_address () + local_entry_offset;
 
   return pc;
 }
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index 9a3b02f028d3..6c2fd1bfc998 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -1059,7 +1059,7 @@ convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr)
   if (fn.minsym == NULL)
     return 0;
   /* Found a descriptor.  */
-  (*desc_addr) = BMSYMBOL_VALUE_ADDRESS (fn);
+  (*desc_addr) = fn.value_address ();
   return 1;
 }
 
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 3c78edf7cce0..e870b35cf387 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);
diff --git a/gdb/proc-service.c b/gdb/proc-service.c
index e21ea05872a1..dd3d7c9201e6 100644
--- a/gdb/proc-service.c
+++ b/gdb/proc-service.c
@@ -111,7 +111,7 @@ ps_pglobal_lookup (struct ps_prochandle *ph, const char *obj,
   if (ms.minsym == NULL)
     return PS_NOSYM;
 
-  *sym_addr = core_addr_to_ps_addr (BMSYMBOL_VALUE_ADDRESS (ms));
+  *sym_addr = core_addr_to_ps_addr (ms.value_address ());
   return PS_OK;
 }
 
diff --git a/gdb/psympriv.h b/gdb/psympriv.h
index eeaf076bf136..9964c102403e 100644
--- a/gdb/psympriv.h
+++ b/gdb/psympriv.h
@@ -46,14 +46,14 @@ struct partial_symbol
   /* Return the unrelocated address of this partial symbol.  */
   CORE_ADDR unrelocated_address () const
   {
-    return ginfo.value.address;
+    return ginfo.value_address ();
   }
 
   /* Return the address of this partial symbol, relocated according to
      the offsets provided in OBJFILE.  */
   CORE_ADDR address (const struct objfile *objfile) const
   {
-    return (ginfo.value.address
+    return (ginfo.value_address ()
 	    + objfile->section_offsets[ginfo.section_index ()]);
   }
 
@@ -61,7 +61,7 @@ struct partial_symbol
      unrelocated.  */
   void set_unrelocated_address (CORE_ADDR addr)
   {
-    ginfo.value.address = addr;
+    ginfo.set_value_address (addr);
   }
 
   /* Note that partial_symbol does not derive from general_symbol_info
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index a26ecd0b4e5e..5d9949bca1d9 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -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 (),
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index cbc3508756e6..aae6e397327f 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -361,7 +361,7 @@ get_running_thread_id (int cpu)
     return 0;
 
   object_size = TYPE_LENGTH (builtin_type_void_data_ptr);
-  object_addr = (BMSYMBOL_VALUE_ADDRESS (object_msym)
+  object_addr = (object_msym.value_address ()
 		 + (cpu - 1) * object_size);
   buf_size = object_size;
   buf = (gdb_byte *) alloca (buf_size);
diff --git a/gdb/remote.c b/gdb/remote.c
index b002f041734c..75d6bf3919d0 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -5155,7 +5155,7 @@ remote_target::remote_check_symbols ()
       else
 	{
 	  int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
-	  CORE_ADDR sym_addr = BMSYMBOL_VALUE_ADDRESS (sym);
+	  CORE_ADDR sym_addr = sym.value_address ();
 
 	  /* If this is a function address, return the start of code
 	     instead of any data function descriptor.  */
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 2a05026f3d7f..18754f4f93b4 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -767,7 +767,7 @@ ps_pglobal_lookup (struct ps_prochandle *ph, const char *ld_object_name,
   if (!ms.minsym)
     return PS_NOSYM;
 
-  *ld_symbol_addr = BMSYMBOL_VALUE_ADDRESS (ms);
+  *ld_symbol_addr = ms.value_address ();
   return PS_OK;
 }
 
diff --git a/gdb/sol2-tdep.c b/gdb/sol2-tdep.c
index e456c6c9a41a..a7bf8836269f 100644
--- a/gdb/sol2-tdep.c
+++ b/gdb/sol2-tdep.c
@@ -67,7 +67,7 @@ sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
   struct bound_minimal_symbol msym;
 
   msym = lookup_minimal_symbol("elf_bndr", NULL, NULL);
-  if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
+  if (msym.minsym && msym.value_address () == pc)
     return frame_unwind_caller_pc (get_current_frame ());
 
   return 0;
diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c
index a0735eafcc6a..0b03f9446086 100644
--- a/gdb/solib-dsbt.c
+++ b/gdb/solib-dsbt.c
@@ -459,7 +459,7 @@ lm_base (void)
 
   if (got_sym.minsym != 0)
     {
-      addr = BMSYMBOL_VALUE_ADDRESS (got_sym);
+      addr = got_sym.value_address ();
       if (solib_dsbt_debug)
 	gdb_printf (gdb_stdlog,
 		    "lm_base: get addr %x by _GLOBAL_OFFSET_TABLE_.\n",
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index 925ec717c8e2..a6d6fe070882 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -296,7 +296,7 @@ lm_base (void)
       return 0;
     }
 
-  addr = BMSYMBOL_VALUE_ADDRESS (got_sym) + 8;
+  addr = got_sym.value_address () + 8;
 
   if (solib_frv_debug)
     gdb_printf (gdb_stdlog,
@@ -900,7 +900,7 @@ main_got (void)
   if (got_sym.minsym == 0)
     return 0;
 
-  return BMSYMBOL_VALUE_ADDRESS (got_sym);
+  return got_sym.value_address ();
 }
 
 /* Find the global pointer for the given function address ADDR.  */
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index ca98a812f365..2f3e79d200f2 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -713,7 +713,7 @@ elf_locate_base (void)
   msymbol = lookup_minimal_symbol ("_r_debug", NULL,
 				   current_program_space->symfile_object_file);
   if (msymbol.minsym != NULL)
-    return BMSYMBOL_VALUE_ADDRESS (msymbol);
+    return msymbol.value_address ();
 
   /* DT_DEBUG entry not found.  */
   return 0;
@@ -2369,9 +2369,9 @@ enable_break (struct svr4_info *info, int from_tty)
     {
       msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, objf);
       if ((msymbol.minsym != NULL)
-	  && (BMSYMBOL_VALUE_ADDRESS (msymbol) != 0))
+	  && (msymbol.value_address () != 0))
 	{
-	  sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
+	  sym_addr = msymbol.value_address ();
 	  sym_addr = gdbarch_convert_from_func_ptr_addr
 	    (target_gdbarch (), sym_addr, current_inferior ()->top_target ());
 	  svr4_create_solib_event_breakpoints (info, target_gdbarch (),
@@ -2386,9 +2386,9 @@ enable_break (struct svr4_info *info, int from_tty)
 	{
 	  msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, objf);
 	  if ((msymbol.minsym != NULL)
-	      && (BMSYMBOL_VALUE_ADDRESS (msymbol) != 0))
+	      && (msymbol.value_address () != 0))
 	    {
-	      sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
+	      sym_addr = msymbol.value_address ();
 	      sym_addr = gdbarch_convert_from_func_ptr_addr
 		(target_gdbarch (), sym_addr,
 		 current_inferior ()->top_target ());
diff --git a/gdb/solib.c b/gdb/solib.c
index c64ef8c23b75..0fbf5bc988dd 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1551,9 +1551,9 @@ gdb_bfd_lookup_symbol_from_symtab (bfd *abfd,
 		{
 		  struct minimal_symbol msym {};
 
-		  SET_MSYMBOL_VALUE_ADDRESS (&msym, symaddr);
+		  msym.set_value_address (symaddr);
 		  gdbarch_elf_make_msymbol_special (gdbarch, sym, &msym);
-		  symaddr = MSYMBOL_VALUE_RAW_ADDRESS (&msym);
+		  symaddr = msym.value_raw_address ();
 		}
 
 	      /* BFD symbols are section relative.  */
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 5e85c34303c9..3f173da71d59 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -623,7 +623,7 @@ symbol_reference_defined (const char **string)
 static int
 stab_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
 {
-  int regno = gdbarch_stab_reg_to_regnum (gdbarch, SYMBOL_VALUE (sym));
+  int regno = gdbarch_stab_reg_to_regnum (gdbarch, sym->value_longest ());
 
   if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
     {
@@ -805,7 +805,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 	    target_float_from_string (dbl_valu, dbl_type, std::string (p));
 
 	    sym->set_type (dbl_type);
-	    SYMBOL_VALUE_BYTES (sym) = dbl_valu;
+	    sym->set_value_bytes (dbl_valu);
 	    sym->set_aclass_index (LOC_CONST_BYTES);
 	  }
 	  break;
@@ -819,7 +819,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 	       unsigned as well as signed constants.  */
 
 	    sym->set_type (objfile_type (objfile)->builtin_long);
-	    SYMBOL_VALUE (sym) = atoi (p);
+	    sym->set_value_longest (atoi (p));
 	    sym->set_aclass_index (LOC_CONST);
 	  }
 	  break;
@@ -827,7 +827,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 	case 'c':
 	  {
 	    sym->set_type (objfile_type (objfile)->builtin_char);
-	    SYMBOL_VALUE (sym) = atoi (p);
+	    sym->set_value_longest (atoi (p));
 	    sym->set_aclass_index (LOC_CONST);
 	  }
 	  break;
@@ -888,7 +888,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 	    memcpy (string_value, string_local, ind + 1);
 	    p++;
 
-	    SYMBOL_VALUE_BYTES (sym) = string_value;
+	    sym->set_value_bytes (string_value);
 	    sym->set_aclass_index (LOC_CONST_BYTES);
 	  }
 	  break;
@@ -915,7 +915,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 	       correct.  Ideally, we should be using whatever we have
 	       available for parsing unsigned and long long values,
 	       however.  */
-	    SYMBOL_VALUE (sym) = atoi (p);
+	    sym->set_value_longest (atoi (p));
 	  }
 	  break;
 	default:
@@ -933,7 +933,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
       sym->set_type (read_type (&p, objfile));
       sym->set_aclass_index (LOC_LABEL);
       sym->set_domain (VAR_DOMAIN);
-      SET_SYMBOL_VALUE_ADDRESS (sym, valu);
+      sym->set_value_address (valu);
       add_symbol_to_list (sym, get_local_symbols ());
       break;
 
@@ -1032,7 +1032,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
       if (sym->linkage_name () && sym->linkage_name ()[0] != '#')
 	{
 	  i = hashname (sym->linkage_name ());
-	  SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
+	  sym->set_value_chain (global_sym_chain[i]);
 	  global_sym_chain[i] = sym;
 	}
       add_symbol_to_list (sym, get_global_symbols ());
@@ -1045,7 +1045,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
     case 'l':
       sym->set_type (read_type (&p, objfile));
       sym->set_aclass_index (LOC_LOCAL);
-      SYMBOL_VALUE (sym) = valu;
+      sym->set_value_longest (valu);
       sym->set_domain (VAR_DOMAIN);
       add_symbol_to_list (sym, get_local_symbols ());
       break;
@@ -1065,7 +1065,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 	sym->set_type (read_type (&p, objfile));
 
       sym->set_aclass_index (LOC_ARG);
-      SYMBOL_VALUE (sym) = valu;
+      sym->set_value_longest (valu);
       sym->set_domain (VAR_DOMAIN);
       sym->set_is_argument (1);
       add_symbol_to_list (sym, get_local_symbols ());
@@ -1115,7 +1115,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
       sym->set_type (read_type (&p, objfile));
       sym->set_aclass_index (stab_register_index);
       sym->set_is_argument (1);
-      SYMBOL_VALUE (sym) = valu;
+      sym->set_value_longest (valu);
       sym->set_domain (VAR_DOMAIN);
       add_symbol_to_list (sym, get_local_symbols ());
       break;
@@ -1124,7 +1124,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
       /* Register variable (either global or local).  */
       sym->set_type (read_type (&p, objfile));
       sym->set_aclass_index (stab_register_index);
-      SYMBOL_VALUE (sym) = valu;
+      sym->set_value_longest (valu);
       sym->set_domain (VAR_DOMAIN);
       if (within_function)
 	{
@@ -1164,7 +1164,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 		  /* Use the type from the LOC_REGISTER; that is the type
 		     that is actually in that register.  */
 		  prev_sym->set_type (sym->type ());
-		  SYMBOL_VALUE (prev_sym) = SYMBOL_VALUE (sym);
+		  prev_sym->set_value_longest (sym->value_longest ());
 		  sym = prev_sym;
 		  break;
 		}
@@ -1179,7 +1179,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
       /* Static symbol at top level of file.  */
       sym->set_type (read_type (&p, objfile));
       sym->set_aclass_index (LOC_STATIC);
-      SET_SYMBOL_VALUE_ADDRESS (sym, valu);
+      sym->set_value_address (valu);
       sym->set_domain (VAR_DOMAIN);
       add_symbol_to_list (sym, get_file_symbols ());
       break;
@@ -1210,7 +1210,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 	return NULL;
 
       sym->set_aclass_index (LOC_TYPEDEF);
-      SYMBOL_VALUE (sym) = valu;
+      sym->set_value_longest (valu);
       sym->set_domain (VAR_DOMAIN);
       /* C++ vagaries: we may have a type which is derived from
 	 a base type which did not have its name defined when the
@@ -1287,7 +1287,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 
 	  *struct_sym = *sym;
 	  struct_sym->set_aclass_index (LOC_TYPEDEF);
-	  SYMBOL_VALUE (struct_sym) = valu;
+	  struct_sym->set_value_longest (valu);
 	  struct_sym->set_domain (STRUCT_DOMAIN);
 	  if (sym->type ()->name () == 0)
 	    sym->type ()->set_name
@@ -1314,7 +1314,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 	return NULL;
 
       sym->set_aclass_index (LOC_TYPEDEF);
-      SYMBOL_VALUE (sym) = valu;
+      sym->set_value_longest (valu);
       sym->set_domain (STRUCT_DOMAIN);
       if (sym->type ()->name () == 0)
 	sym->type ()->set_name
@@ -1329,7 +1329,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 
 	  *typedef_sym = *sym;
 	  typedef_sym->set_aclass_index (LOC_TYPEDEF);
-	  SYMBOL_VALUE (typedef_sym) = valu;
+	  typedef_sym->set_value_longest (valu);
 	  typedef_sym->set_domain (VAR_DOMAIN);
 	  if (sym->type ()->name () == 0)
 	    sym->type ()->set_name
@@ -1343,7 +1343,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
       /* Static symbol of local scope.  */
       sym->set_type (read_type (&p, objfile));
       sym->set_aclass_index (LOC_STATIC);
-      SET_SYMBOL_VALUE_ADDRESS (sym, valu);
+      sym->set_value_address (valu);
       sym->set_domain (VAR_DOMAIN);
       add_symbol_to_list (sym, get_local_symbols ());
       break;
@@ -1353,7 +1353,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
       sym->set_type (read_type (&p, objfile));
       sym->set_aclass_index (LOC_REF_ARG);
       sym->set_is_argument (1);
-      SYMBOL_VALUE (sym) = valu;
+      sym->set_value_longest (valu);
       sym->set_domain (VAR_DOMAIN);
       add_symbol_to_list (sym, get_local_symbols ());
       break;
@@ -1363,7 +1363,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
       sym->set_type (read_type (&p, objfile));
       sym->set_aclass_index (stab_regparm_index);
       sym->set_is_argument (1);
-      SYMBOL_VALUE (sym) = valu;
+      sym->set_value_longest (valu);
       sym->set_domain (VAR_DOMAIN);
       add_symbol_to_list (sym, get_local_symbols ());
       break;
@@ -1375,7 +1375,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 	 "x:3" (local symbol) instead.  */
       sym->set_type (read_type (&p, objfile));
       sym->set_aclass_index (LOC_LOCAL);
-      SYMBOL_VALUE (sym) = valu;
+      sym->set_value_longest (valu);
       sym->set_domain (VAR_DOMAIN);
       add_symbol_to_list (sym, get_local_symbols ());
       break;
@@ -1383,7 +1383,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
     default:
       sym->set_type (error_type (&p, objfile));
       sym->set_aclass_index (LOC_CONST);
-      SYMBOL_VALUE (sym) = 0;
+      sym->set_value_longest (0);
       sym->set_domain (VAR_DOMAIN);
       add_symbol_to_list (sym, get_file_symbols ());
       break;
@@ -3594,7 +3594,7 @@ read_enum_type (const char **pp, struct type *type,
 			 &objfile->objfile_obstack);
       sym->set_aclass_index (LOC_CONST);
       sym->set_domain (VAR_DOMAIN);
-      SYMBOL_VALUE (sym) = n;
+      sym->set_value_longest (n);
       if (n < 0)
 	unsigned_enum = 0;
       add_symbol_to_list (sym, symlist);
@@ -3637,7 +3637,7 @@ read_enum_type (const char **pp, struct type *type,
 
 	  xsym->set_type (type);
 	  type->field (n).set_name (xsym->linkage_name ());
-	  type->field (n).set_loc_enumval (SYMBOL_VALUE (xsym));
+	  type->field (n).set_loc_enumval (xsym->value_longest ());
 	  TYPE_FIELD_BITSIZE (type, n) = 0;
 	}
       if (syms == osyms)
@@ -4287,7 +4287,7 @@ common_block_end (struct objfile *objfile)
      Does it matter?  */
 
   i = hashname (sym->linkage_name ());
-  SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
+  sym->set_value_chain (global_sym_chain[i]);
   global_sym_chain[i] = sym;
   common_block_name = NULL;
 }
@@ -4306,9 +4306,8 @@ fix_common_block (struct symbol *sym, CORE_ADDR valu)
       int j;
 
       for (j = next->nsyms - 1; j >= 0; j--)
-	SET_SYMBOL_VALUE_ADDRESS (next->symbol[j],
-				  SYMBOL_VALUE_ADDRESS (next->symbol[j])
-				  + valu);
+	next->symbol[j]->set_value_address
+	  (next->symbol[j]->value_address () + valu);
     }
 }
 \f
@@ -4564,11 +4563,11 @@ scan_file_globals (struct objfile *objfile)
 		     assign the value we have to it.  */
 		  if (prev)
 		    {
-		      SYMBOL_VALUE_CHAIN (prev) = SYMBOL_VALUE_CHAIN (sym);
+		      prev->set_value_chain (sym->value_chain ());
 		    }
 		  else
 		    {
-		      global_sym_chain[hash] = SYMBOL_VALUE_CHAIN (sym);
+		      global_sym_chain[hash] = sym->value_chain ();
 		    }
 
 		  /* Check to see whether we need to fix up a common block.  */
@@ -4577,23 +4576,17 @@ scan_file_globals (struct objfile *objfile)
 		  if (sym)
 		    {
 		      if (sym->aclass () == LOC_BLOCK)
-			{
-			  fix_common_block (sym,
-					    MSYMBOL_VALUE_ADDRESS (resolve_objfile,
-								   msymbol));
-			}
+			fix_common_block
+			  (sym, msymbol->value_address (resolve_objfile));
 		      else
-			{
-			  SET_SYMBOL_VALUE_ADDRESS
-			    (sym, MSYMBOL_VALUE_ADDRESS (resolve_objfile,
-							 msymbol));
-			}
+			sym->set_value_address
+			  (msymbol->value_address (resolve_objfile));
 		      sym->set_section_index (msymbol->section_index ());
 		    }
 
 		  if (prev)
 		    {
-		      sym = SYMBOL_VALUE_CHAIN (prev);
+		      sym = prev->value_chain ();
 		    }
 		  else
 		    {
@@ -4603,7 +4596,7 @@ scan_file_globals (struct objfile *objfile)
 	      else
 		{
 		  prev = sym;
-		  sym = SYMBOL_VALUE_CHAIN (sym);
+		  sym = sym->value_chain ();
 		}
 	    }
 	}
@@ -4620,11 +4613,11 @@ scan_file_globals (struct objfile *objfile)
       while (sym)
 	{
 	  prev = sym;
-	  sym = SYMBOL_VALUE_CHAIN (sym);
+	  sym = sym->value_chain ();
 
 	  /* Change the symbol address from the misleading chain value
 	     to address zero.  */
-	  SET_SYMBOL_VALUE_ADDRESS (prev, 0);
+	  prev->set_value_address (0);
 
 	  /* Complain about unresolved common block symbols.  */
 	  if (prev->aclass () == LOC_STATIC)
diff --git a/gdb/stack.c b/gdb/stack.c
index 1ccad83a2dda..1229ee6b4921 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -750,7 +750,7 @@ print_frame_args (const frame_print_options &fp_opts,
 
   if (func)
     {
-      const struct block *b = SYMBOL_BLOCK_VALUE (func);
+      const struct block *b = func->value_block ();
       struct block_iterator iter;
       struct symbol *sym;
 
@@ -778,7 +778,7 @@ print_frame_args (const frame_print_options &fp_opts,
 	    case LOC_ARG:
 	    case LOC_REF_ARG:
 	      {
-		long current_offset = SYMBOL_VALUE (sym);
+		long current_offset = sym->value_longest ();
 		int arg_size = TYPE_LENGTH (sym->type ());
 
 		/* Compute address of next argument by adding the size of
@@ -2554,7 +2554,7 @@ print_frame_arg_vars (struct frame_info *frame,
   cb_data.stream = stream;
   cb_data.values_printed = 0;
 
-  iterate_over_block_arg_vars (SYMBOL_BLOCK_VALUE (func), cb_data);
+  iterate_over_block_arg_vars (func->value_block (), cb_data);
 
   /* do_print_variable_and_value invalidates FRAME.  */
   frame = NULL;
diff --git a/gdb/symfile.c b/gdb/symfile.c
index dcd217c0a51c..6f546f5b0591 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3450,11 +3450,11 @@ simple_read_overlay_table (void)
   word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
   byte_order = gdbarch_byte_order (gdbarch);
 
-  cache_novlys = read_memory_integer (BMSYMBOL_VALUE_ADDRESS (novlys_msym),
+  cache_novlys = read_memory_integer (novlys_msym.value_address (),
 				      4, byte_order);
   cache_ovly_table
     = (unsigned int (*)[4]) xmalloc (cache_novlys * sizeof (*cache_ovly_table));
-  cache_ovly_table_base = BMSYMBOL_VALUE_ADDRESS (ovly_table_msym);
+  cache_ovly_table_base = ovly_table_msym.value_address ();
   read_target_long_array (cache_ovly_table_base,
 			  (unsigned int *) cache_ovly_table,
 			  cache_novlys * 4, word_size, byte_order);
@@ -3524,7 +3524,7 @@ simple_overlay_update (struct obj_section *osect)
 		   "find `_ovly_table' array\n"
 		   "in inferior.  Use `overlay manual' mode."));
 	
-	if (cache_ovly_table_base == BMSYMBOL_VALUE_ADDRESS (minsym))
+	if (cache_ovly_table_base == minsym.value_address ())
 	  /* Then go ahead and try to look up this single section in
 	     the cache.  */
 	  if (simple_overlay_update_1 (osect))
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 1779816348fc..1bc5f9f0bd95 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -201,7 +201,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
 
       /* Use the relocated address as shown in the symbol here -- do
 	 not try to respect copy relocations.  */
-      CORE_ADDR addr = (msymbol->value.address
+      CORE_ADDR addr = (msymbol->value_raw_address ()
 			+ objfile->section_offsets[msymbol->section_index ()]);
       gdb_puts (paddress (gdbarch, addr), outfile);
       gdb_printf (outfile, " %s", msymbol->linkage_name ());
@@ -511,7 +511,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
   if (symbol->domain () == LABEL_DOMAIN)
     {
       gdb_printf (outfile, "label %s at ", symbol->print_name ());
-      gdb_puts (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
+      gdb_puts (paddress (gdbarch, symbol->value_address ()),
 		outfile);
       if (section)
 	gdb_printf (outfile, " section %s\n",
@@ -562,8 +562,8 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
 	{
 	case LOC_CONST:
 	  gdb_printf (outfile, "const %s (%s)",
-		      plongest (SYMBOL_VALUE (symbol)),
-		      hex_string (SYMBOL_VALUE (symbol)));
+		      plongest (symbol->value_longest ()),
+		      hex_string (symbol->value_longest ()));
 	  break;
 
 	case LOC_CONST_BYTES:
@@ -575,14 +575,13 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
 			pulongest (TYPE_LENGTH (type)));
 	    for (i = 0; i < TYPE_LENGTH (type); i++)
 	      gdb_printf (outfile, " %02x",
-			  (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]);
+			  (unsigned) symbol->value_bytes ()[i]);
 	  }
 	  break;
 
 	case LOC_STATIC:
 	  gdb_printf (outfile, "static at ");
-	  gdb_puts (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
-		    outfile);
+	  gdb_puts (paddress (gdbarch, symbol->value_address ()), outfile);
 	  if (section)
 	    gdb_printf (outfile, " section %s",
 			bfd_section_name (section->the_bfd_section));
@@ -591,30 +590,30 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
 	case LOC_REGISTER:
 	  if (symbol->is_argument ())
 	    gdb_printf (outfile, "parameter register %s",
-			plongest (SYMBOL_VALUE (symbol)));
+			plongest (symbol->value_longest ()));
 	  else
 	    gdb_printf (outfile, "register %s",
-			plongest (SYMBOL_VALUE (symbol)));
+			plongest (symbol->value_longest ()));
 	  break;
 
 	case LOC_ARG:
 	  gdb_printf (outfile, "arg at offset %s",
-		      hex_string (SYMBOL_VALUE (symbol)));
+		      hex_string (symbol->value_longest ()));
 	  break;
 
 	case LOC_REF_ARG:
 	  gdb_printf (outfile, "reference arg at %s",
-		      hex_string (SYMBOL_VALUE (symbol)));
+		      hex_string (symbol->value_longest ()));
 	  break;
 
 	case LOC_REGPARM_ADDR:
 	  gdb_printf (outfile, "address parameter register %s",
-		      plongest (SYMBOL_VALUE (symbol)));
+		      plongest (symbol->value_longest ()));
 	  break;
 
 	case LOC_LOCAL:
 	  gdb_printf (outfile, "local at offset %s",
-		      hex_string (SYMBOL_VALUE (symbol)));
+		      hex_string (symbol->value_longest ()));
 	  break;
 
 	case LOC_TYPEDEF:
@@ -622,8 +621,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
 
 	case LOC_LABEL:
 	  gdb_printf (outfile, "label at ");
-	  gdb_puts (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
-		    outfile);
+	  gdb_puts (paddress (gdbarch, symbol->value_address ()), outfile);
 	  if (section)
 	    gdb_printf (outfile, " section %s",
 			bfd_section_name (section->the_bfd_section));
@@ -632,9 +630,9 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
 	case LOC_BLOCK:
 	  gdb_printf
 	    (outfile, "block object %s, %s..%s",
-	     host_address_to_string (SYMBOL_BLOCK_VALUE (symbol)),
-	     paddress (gdbarch, BLOCK_START (SYMBOL_BLOCK_VALUE (symbol))),
-	     paddress (gdbarch, BLOCK_END (SYMBOL_BLOCK_VALUE (symbol))));
+	     host_address_to_string (symbol->value_block ()),
+	     paddress (gdbarch, BLOCK_START (symbol->value_block ())),
+	     paddress (gdbarch, BLOCK_END (symbol->value_block ())));
 	  if (section)
 	    gdb_printf (outfile, " section %s",
 			bfd_section_name (section->the_bfd_section));
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 3cc2d4f8648c..d15eec8b6b49 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -414,6 +414,19 @@ compunit_language (const struct compunit_symtab *cust)
   return symtab->language ();
 }
 
+/* The relocated address of the minimal symbol, using the section
+   offsets from OBJFILE.  */
+
+CORE_ADDR
+minimal_symbol::value_address (objfile *objfile) const
+{
+  if (this->maybe_copied)
+    return get_msymbol_address (objfile, this);
+  else
+    return (this->value_raw_address ()
+	    + objfile->section_offsets[this->section_index ()]);
+}
+
 /* See symtab.h.  */
 
 bool
@@ -1805,10 +1818,10 @@ fixup_symbol_section (struct symbol *sym, struct objfile *objfile)
     {
     case LOC_STATIC:
     case LOC_LABEL:
-      addr = SYMBOL_VALUE_ADDRESS (sym);
+      addr = sym->value_address ();
       break;
     case LOC_BLOCK:
-      addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym));
+      addr = BLOCK_ENTRY_PC (sym->value_block ());
       break;
 
     default:
@@ -3083,7 +3096,7 @@ find_symbol_at_address (CORE_ADDR address)
 	  ALL_BLOCK_SYMBOLS (b, iter, sym)
 	    {
 	      if (sym->aclass () == LOC_STATIC
-		  && SYMBOL_VALUE_ADDRESS (sym) == addr)
+		  && sym->value_address () == addr)
 		return sym;
 	    }
 	}
@@ -3245,8 +3258,8 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
 	     msymbol->linkage_name ()); */
 	  ;
 	/* fall through */
-	else if (BMSYMBOL_VALUE_ADDRESS (mfunsym)
-		 == BMSYMBOL_VALUE_ADDRESS (msymbol))
+	else if (mfunsym.value_address ()
+		 == msymbol.value_address ())
 	  /* Avoid infinite recursion */
 	  /* See above comment about why warning is commented out.  */
 	  /* warning ("In stub for %s; unable to find real function/line info",
@@ -3258,12 +3271,12 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
 	    /* Detect an obvious case of infinite recursion.  If this
 	       should occur, we'd like to know about it, so error out,
 	       fatally.  */
-	    if (BMSYMBOL_VALUE_ADDRESS (mfunsym) == pc)
+	    if (mfunsym.value_address () == pc)
 	      internal_error (__FILE__, __LINE__,
 		_("Infinite recursion detected in find_pc_sect_line;"
 		  "please file a bug report"));
 
-	    return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
+	    return find_pc_line (mfunsym.value_address (), 0);
 	  }
       }
 
@@ -3766,7 +3779,7 @@ find_function_start_sal (symbol *sym, bool funfirstline)
 {
   fixup_symbol_section (sym, NULL);
   symtab_and_line sal
-    = find_function_start_sal_1 (BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)),
+    = find_function_start_sal_1 (BLOCK_ENTRY_PC (sym->value_block ()),
 				 sym->obj_section (symbol_objfile (sym)),
 				 funfirstline);
   sal.symbol = sym;
@@ -3895,7 +3908,7 @@ skip_prologue_sal (struct symtab_and_line *sal)
       fixup_symbol_section (sym, NULL);
 
       objfile = symbol_objfile (sym);
-      pc = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym));
+      pc = BLOCK_ENTRY_PC (sym->value_block ());
       section = sym->obj_section (objfile);
       name = sym->linkage_name ();
     }
@@ -3908,7 +3921,7 @@ skip_prologue_sal (struct symtab_and_line *sal)
 	return;
 
       objfile = msymbol.objfile;
-      pc = BMSYMBOL_VALUE_ADDRESS (msymbol);
+      pc = msymbol.value_address ();
       section = msymbol.minsym->obj_section (objfile);
       name = msymbol.minsym->linkage_name ();
     }
@@ -3971,8 +3984,8 @@ skip_prologue_sal (struct symtab_and_line *sal)
       /* Check if gdbarch_skip_prologue left us in mid-line, and the next
 	 line is still part of the same function.  */
       if (skip && start_sal.pc != pc
-	  && (sym ? (BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)) <= start_sal.end
-		     && start_sal.end < BLOCK_END (SYMBOL_BLOCK_VALUE (sym)))
+	  && (sym ? (BLOCK_ENTRY_PC (sym->value_block ()) <= start_sal.end
+		     && start_sal.end < BLOCK_END (sym->value_block ()))
 	      : (lookup_minimal_symbol_by_pc_section (start_sal.end, section).minsym
 		 == lookup_minimal_symbol_by_pc_section (pc, section).minsym)))
 	{
@@ -4169,7 +4182,7 @@ find_function_alias_target (bound_minimal_symbol msymbol)
   symbol *sym = find_pc_function (func_addr);
   if (sym != NULL
       && sym->aclass () == LOC_BLOCK
-      && BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)) == func_addr)
+      && BLOCK_ENTRY_PC (sym->value_block ()) == func_addr)
     return sym;
 
   return NULL;
@@ -4822,8 +4835,7 @@ global_symbol_searcher::expand_symtabs
 		     the symbols tables are expanded.  */
 		  if (kind == FUNCTIONS_DOMAIN
 		      ? (find_pc_compunit_symtab
-			 (MSYMBOL_VALUE_ADDRESS (objfile, msymbol))
-			 == NULL)
+			 (msymbol->value_address (objfile)) == NULL)
 		      : (lookup_symbol_in_objfile_from_linkage_name
 			 (objfile, msymbol->linkage_name (),
 			  VAR_DOMAIN)
@@ -4945,8 +4957,7 @@ global_symbol_searcher::add_matching_msymbols
 		 symbol might be found via find_pc_symtab.  */
 	      if (kind != FUNCTIONS_DOMAIN
 		  || (find_pc_compunit_symtab
-		      (MSYMBOL_VALUE_ADDRESS (objfile, msymbol))
-		      == NULL))
+		      (msymbol->value_address (objfile)) == NULL))
 		{
 		  if (lookup_symbol_in_objfile_from_linkage_name
 		      (objfile, msymbol->linkage_name (),
@@ -5168,11 +5179,11 @@ print_msymbol_info (struct bound_minimal_symbol msymbol)
   char *tmp;
 
   if (gdbarch_addr_bit (gdbarch) <= 32)
-    tmp = hex_string_custom (BMSYMBOL_VALUE_ADDRESS (msymbol)
+    tmp = hex_string_custom (msymbol.value_address ()
 			     & (CORE_ADDR) 0xffffffff,
 			     8);
   else
-    tmp = hex_string_custom (BMSYMBOL_VALUE_ADDRESS (msymbol),
+    tmp = hex_string_custom (msymbol.value_address (),
 			     16);
 
   ui_file_style sym_style = (msymbol.minsym->text_p ()
@@ -5780,7 +5791,7 @@ find_gnu_ifunc (const symbol *sym)
 				symbol_name_match_type::SEARCH_NAME);
   struct objfile *objfile = symbol_objfile (sym);
 
-  CORE_ADDR address = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym));
+  CORE_ADDR address = BLOCK_ENTRY_PC (sym->value_block ());
   minimal_symbol *ifunc = NULL;
 
   iterate_over_minimal_symbols (objfile, lookup_name,
@@ -5789,7 +5800,7 @@ find_gnu_ifunc (const symbol *sym)
       if (MSYMBOL_TYPE (minsym) == mst_text_gnu_ifunc
 	  || MSYMBOL_TYPE (minsym) == mst_data_gnu_ifunc)
 	{
-	  CORE_ADDR msym_addr = MSYMBOL_VALUE_ADDRESS (objfile, minsym);
+	  CORE_ADDR msym_addr = minsym->value_address (objfile);
 	  if (MSYMBOL_TYPE (minsym) == mst_data_gnu_ifunc)
 	    {
 	      struct gdbarch *gdbarch = objfile->arch ();
@@ -6634,9 +6645,9 @@ get_symbol_address (const struct symbol *sym)
       bound_minimal_symbol minsym
 	= lookup_minimal_symbol_linkage (linkage_name, objfile);
       if (minsym.minsym != nullptr)
-	return BMSYMBOL_VALUE_ADDRESS (minsym);
+	return minsym.value_address ();
     }
-  return sym->value.address;
+  return sym->m_value.address;
 }
 
 /* See symtab.h.  */
@@ -6657,10 +6668,10 @@ get_msymbol_address (struct objfile *objf, const struct minimal_symbol *minsym)
 	  bound_minimal_symbol found
 	    = lookup_minimal_symbol_linkage (linkage_name, objfile);
 	  if (found.minsym != nullptr)
-	    return BMSYMBOL_VALUE_ADDRESS (found);
+	    return found.value_address ();
 	}
     }
-  return (minsym->value.address
+  return (minsym->m_value.address
 	  + objf->section_offsets[minsym->section_index ()]);
 }
 
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 0df5e2375640..390ee9d0d67d 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -475,6 +475,16 @@ struct general_symbol_info
 			      gdb::optional<hashval_t> hash
 				= gdb::optional<hashval_t> ());
 
+  CORE_ADDR value_address () const
+  {
+    return m_value.address;
+  }
+
+  void set_value_address (CORE_ADDR address)
+  {
+    m_value.address = address;
+  }
+
   /* Name of the symbol.  This is a required field.  Storage for the
      name is allocated on the objfile_obstack for the associated
      objfile.  For languages like C++ that make a distinction between
@@ -507,7 +517,7 @@ struct general_symbol_info
 
     struct symbol *chain;
   }
-  value;
+  m_value;
 
   /* Since one and only one language can apply, wrap the language specific
      information inside a union.  */
@@ -573,19 +583,6 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *);
 
 extern CORE_ADDR get_symbol_address (const struct symbol *sym);
 
-/* Note that these macros only work with symbol, not partial_symbol.  */
-
-#define SYMBOL_VALUE(symbol)		(symbol)->value.ivalue
-#define SYMBOL_VALUE_ADDRESS(symbol)			      \
-  (((symbol)->maybe_copied) ? get_symbol_address (symbol)     \
-   : ((symbol)->value.address))
-#define SET_SYMBOL_VALUE_ADDRESS(symbol, new_value)	\
-  ((symbol)->value.address = (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
-
 /* Try to determine the demangled name for a symbol, based on the
    language of that symbol.  If the language is set to language_auto,
    it will attempt to find any demangling algorithm that works and
@@ -664,6 +661,15 @@ enum minimal_symbol_type
 #define MINSYM_TYPE_BITS 4
 gdb_static_assert (nr_minsym_types <= (1 << MINSYM_TYPE_BITS));
 
+/* Return the address of MINSYM, which comes from OBJF.  The
+   MAYBE_COPIED flag must be set on MINSYM.  If MINSYM appears in the
+   main program's minimal symbols, then that minsym's address is
+   returned; otherwise, MINSYM's address is returned.  This should
+   generally only be used via the MSYMBOL_VALUE_ADDRESS macro.  */
+
+extern CORE_ADDR get_msymbol_address (struct objfile *objf,
+				      const struct minimal_symbol *minsym);
+
 /* Define a simple structure used to hold some very basic information about
    all defined global symbols (text, data, bss, abs, etc).  The only required
    information is the general_symbol_info.
@@ -678,6 +684,21 @@ gdb_static_assert (nr_minsym_types <= (1 << MINSYM_TYPE_BITS));
 
 struct minimal_symbol : public general_symbol_info
 {
+  LONGEST value_longest () const
+  {
+    return m_value.ivalue;
+  }
+
+  /* The relocated address of the minimal symbol, using the section
+     offsets from OBJFILE.  */
+  CORE_ADDR value_address (objfile *objfile) const;
+
+  /* The unrelocated address of the minimal symbol.  */
+  CORE_ADDR value_raw_address () const
+  {
+    return m_value.address;
+  }
+
   /* Size of this symbol.  dbx_end_psymtab in dbxread.c uses this
      information to calculate the end of the partial symtab based on the
      address of the last symbol plus the size of the last symbol.  */
@@ -735,15 +756,6 @@ struct minimal_symbol : public general_symbol_info
   bool text_p () const;
 };
 
-/* Return the address of MINSYM, which comes from OBJF.  The
-   MAYBE_COPIED flag must be set on MINSYM.  If MINSYM appears in the
-   main program's minimal symbols, then that minsym's address is
-   returned; otherwise, MINSYM's address is returned.  This should
-   generally only be used via the MSYMBOL_VALUE_ADDRESS macro.  */
-
-extern CORE_ADDR get_msymbol_address (struct objfile *objf,
-				      const struct minimal_symbol *minsym);
-
 #define MSYMBOL_TARGET_FLAG_1(msymbol)  (msymbol)->target_flag_1
 #define MSYMBOL_TARGET_FLAG_2(msymbol)  (msymbol)->target_flag_2
 #define MSYMBOL_SIZE(msymbol)		((msymbol)->size + 0)
@@ -756,23 +768,6 @@ extern CORE_ADDR get_msymbol_address (struct objfile *objf,
 #define MSYMBOL_HAS_SIZE(msymbol)	((msymbol)->has_size + 0)
 #define MSYMBOL_TYPE(msymbol)		(msymbol)->type
 
-#define MSYMBOL_VALUE(symbol)		(symbol)->value.ivalue
-/* The unrelocated address of the minimal symbol.  */
-#define MSYMBOL_VALUE_RAW_ADDRESS(symbol) ((symbol)->value.address + 0)
-/* The relocated address of the minimal symbol, using the section
-   offsets from OBJFILE.  */
-#define MSYMBOL_VALUE_ADDRESS(objfile, symbol)				\
-  (((symbol)->maybe_copied) ? get_msymbol_address (objfile, symbol)	\
-   : ((symbol)->value.address						\
-      + (objfile)->section_offsets[(symbol)->section_index ()]))
-/* For a bound minsym, we can easily compute the address directly.  */
-#define BMSYMBOL_VALUE_ADDRESS(symbol) \
-  MSYMBOL_VALUE_ADDRESS ((symbol).objfile, (symbol).minsym)
-#define SET_MSYMBOL_VALUE_ADDRESS(symbol, new_value)	\
-  ((symbol)->value.address = (new_value))
-#define MSYMBOL_VALUE_BYTES(symbol)	(symbol)->value.bytes
-#define MSYMBOL_BLOCK_VALUE(symbol)	(symbol)->value.block
-
 #include "minsyms.h"
 
 \f
@@ -1124,7 +1119,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
       /* We can't use an initializer list for members of a base class, and
 	 general_symbol_info needs to stay a POD type.  */
       m_name = nullptr;
-      value.ivalue = 0;
+      m_value.ivalue = 0;
       language_specific.obstack = nullptr;
       m_language = language_unknown;
       ada_mangled = 0;
@@ -1222,6 +1217,69 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
     m_line = line;
   }
 
+  LONGEST value_longest () const
+  {
+    return m_value.ivalue;
+  }
+
+  void set_value_longest (LONGEST value)
+  {
+    m_value.ivalue = value;
+  }
+
+  CORE_ADDR value_address () const
+  {
+    if (this->maybe_copied)
+      return get_symbol_address (this);
+    else
+      return m_value.address;
+  }
+
+  void set_value_address (CORE_ADDR address)
+  {
+    m_value.address = address;
+  }
+
+  const gdb_byte *value_bytes () const
+  {
+    return m_value.bytes;
+  }
+
+  void set_value_bytes (const gdb_byte *bytes)
+  {
+    m_value.bytes = bytes;
+  }
+
+  const common_block *value_common_block () const
+  {
+    return m_value.common_block;
+  }
+
+  void set_value_common_block (const common_block *common_block)
+  {
+    m_value.common_block = common_block;
+  }
+
+  const block *value_block () const
+  {
+    return m_value.block;
+  }
+
+  void set_value_block (const block *block)
+  {
+    m_value.block = block;
+  }
+
+  symbol *value_chain () const
+  {
+    return m_value.chain;
+  }
+
+  void set_value_chain (symbol *sym)
+  {
+    m_value.chain = sym;
+  }
+
   /* Data type of value */
 
   struct type *m_type = nullptr;
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index b45763ec02b8..5a4048f9078c 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -696,7 +696,7 @@ validate_actionline (const char *line, struct breakpoint *b)
 		      error (_("constant `%s' (value %s) "
 			       "will not be collected."),
 			     sym->print_name (),
-			     plongest (SYMBOL_VALUE (sym)));
+			     plongest (sym->value_longest ()));
 		    }
 		  else if (sym->aclass () == LOC_OPTIMIZED_OUT)
 		    {
@@ -931,10 +931,10 @@ collection_list::collect_symbol (struct symbol *sym,
       break;
     case LOC_CONST:
       gdb_printf ("constant %s (value %s) will not be collected.\n",
-		  sym->print_name (), plongest (SYMBOL_VALUE (sym)));
+		  sym->print_name (), plongest (sym->value_longest ()));
       break;
     case LOC_STATIC:
-      offset = SYMBOL_VALUE_ADDRESS (sym);
+      offset = sym->value_address ();
       if (info_verbose)
 	{
 	  gdb_printf ("LOC_STATIC %s: collect %ld bytes at %s.\n",
@@ -965,7 +965,7 @@ collection_list::collect_symbol (struct symbol *sym,
       break;
     case LOC_ARG:
       reg = frame_regno;
-      offset = frame_offset + SYMBOL_VALUE (sym);
+      offset = frame_offset + sym->value_longest ();
       if (info_verbose)
 	{
 	  gdb_printf ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
@@ -975,7 +975,7 @@ collection_list::collect_symbol (struct symbol *sym,
       add_memrange (gdbarch, reg, offset, len, scope);
       break;
     case LOC_REGPARM_ADDR:
-      reg = SYMBOL_VALUE (sym);
+      reg = sym->value_longest ();
       offset = 0;
       if (info_verbose)
 	{
@@ -987,7 +987,7 @@ collection_list::collect_symbol (struct symbol *sym,
       break;
     case LOC_LOCAL:
       reg = frame_regno;
-      offset = frame_offset + SYMBOL_VALUE (sym);
+      offset = frame_offset + sym->value_longest ();
       if (info_verbose)
 	{
 	  gdb_printf ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
@@ -2526,20 +2526,18 @@ info_scope_command (const char *args_in, int from_tty)
 		  continue;
 		case LOC_CONST:
 		  gdb_printf ("a constant with value %s (%s)",
-			      plongest (SYMBOL_VALUE (sym)),
-			      hex_string (SYMBOL_VALUE (sym)));
+			      plongest (sym->value_longest ()),
+			      hex_string (sym->value_longest ()));
 		  break;
 		case LOC_CONST_BYTES:
 		  gdb_printf ("constant bytes: ");
 		  if (sym->type ())
 		    for (j = 0; j < TYPE_LENGTH (sym->type ()); j++)
-		      gdb_printf (" %02x",
-				  (unsigned) SYMBOL_VALUE_BYTES (sym)[j]);
+		      gdb_printf (" %02x", (unsigned) sym->value_bytes ()[j]);
 		  break;
 		case LOC_STATIC:
 		  gdb_printf ("in static storage at address ");
-		  gdb_printf ("%s", paddress (gdbarch,
-					      SYMBOL_VALUE_ADDRESS (sym)));
+		  gdb_printf ("%s", paddress (gdbarch, sym->value_address ()));
 		  break;
 		case LOC_REGISTER:
 		  /* GDBARCH is the architecture associated with the objfile
@@ -2561,15 +2559,15 @@ info_scope_command (const char *args_in, int from_tty)
 		  break;
 		case LOC_ARG:
 		  gdb_printf ("an argument at stack/frame offset %s",
-			      plongest (SYMBOL_VALUE (sym)));
+			      plongest (sym->value_longest ()));
 		  break;
 		case LOC_LOCAL:
 		  gdb_printf ("a local variable at frame offset %s",
-			      plongest (SYMBOL_VALUE (sym)));
+			      plongest (sym->value_longest ()));
 		  break;
 		case LOC_REF_ARG:
 		  gdb_printf ("a reference argument at offset %s",
-			      plongest (SYMBOL_VALUE (sym)));
+			      plongest (sym->value_longest ()));
 		  break;
 		case LOC_REGPARM_ADDR:
 		  /* Note comment at LOC_REGISTER.  */
@@ -2583,13 +2581,13 @@ info_scope_command (const char *args_in, int from_tty)
 		  continue;
 		case LOC_LABEL:
 		  gdb_printf ("a label at address ");
-		  gdb_printf ("%s", paddress (gdbarch,
-					      SYMBOL_VALUE_ADDRESS (sym)));
+		  gdb_printf ("%s", paddress (gdbarch, sym->value_address ()));
 		  break;
 		case LOC_BLOCK:
 		  gdb_printf ("a function at address ");
 		  gdb_printf ("%s",
-			      paddress (gdbarch, BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym))));
+			      paddress (gdbarch,
+					BLOCK_ENTRY_PC (sym->value_block ())));
 		  break;
 		case LOC_UNRESOLVED:
 		  msym = lookup_minimal_symbol (sym->linkage_name (),
@@ -2600,8 +2598,7 @@ info_scope_command (const char *args_in, int from_tty)
 		    {
 		      gdb_printf ("static storage at address ");
 		      gdb_printf ("%s",
-				  paddress (gdbarch,
-					    BMSYMBOL_VALUE_ADDRESS (msym)));
+				  paddress (gdbarch, msym.value_address ()));
 		    }
 		  break;
 		case LOC_OPTIMIZED_OUT:
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index 70f7429d32b4..2cb9c75ca8da 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -168,9 +168,9 @@ tui_find_backward_disassembly_start_address (CORE_ADDR addr)
 					      lookup_msym_prefer::TEXT,
 					      &msym_prev);
   if (msym.minsym != nullptr)
-    return BMSYMBOL_VALUE_ADDRESS (msym);
+    return msym.value_address ();
   else if (msym_prev.minsym != nullptr)
-    return BMSYMBOL_VALUE_ADDRESS (msym_prev);
+    return msym_prev.value_address ();
 
   /* Find the section that ADDR is in, and look for the start of the
      section.  */
@@ -404,7 +404,7 @@ tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
 	  struct bound_minimal_symbol main_symbol
 	    = lookup_minimal_symbol (main_name (), nullptr, nullptr);
 	  if (main_symbol.minsym != nullptr)
-	    addr = BMSYMBOL_VALUE_ADDRESS (main_symbol);
+	    addr = main_symbol.value_address ();
 	}
     }
   else				/* The target is executing.  */
diff --git a/gdb/valops.c b/gdb/valops.c
index 67209ce6cd8c..42a1213b0c55 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -146,7 +146,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p)
 	  type = lookup_pointer_type (builtin_type (gdbarch)->builtin_char);
 	  type = lookup_function_type (type);
 	  type = lookup_pointer_type (type);
-	  maddr = BMSYMBOL_VALUE_ADDRESS (msymbol);
+	  maddr = msymbol.value_address ();
 
 	  if (objf_p)
 	    *objf_p = objfile;
diff --git a/gdb/value.c b/gdb/value.c
index 24f1151c03f0..08cccf711b22 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -2986,7 +2986,7 @@ value_static_field (struct type *type, int fieldno)
 	  if (!msym.minsym)
 	    retval = allocate_optimized_out_value (field_type);
 	  else
-	    retval = value_at_lazy (field_type, BMSYMBOL_VALUE_ADDRESS (msym));
+	    retval = value_at_lazy (field_type, msym.value_address ());
 	}
       else
 	retval = value_of_variable (sym.symbol, sym.block);
@@ -3184,7 +3184,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f,
   VALUE_LVAL (v) = lval_memory;
   if (sym)
     {
-      set_value_address (v, BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)));
+      set_value_address (v, BLOCK_ENTRY_PC (sym->value_block ()));
     }
   else
     {
@@ -3195,7 +3195,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f,
 
       set_value_address (v,
 	gdbarch_convert_from_func_ptr_addr
-	   (gdbarch, BMSYMBOL_VALUE_ADDRESS (msym),
+	   (gdbarch, msym.value_address (),
 	    current_inferior ()->top_target ()));
     }
 
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index e45fa275c095..c5d2d0a492f8 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -1563,7 +1563,7 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
     ++name;
 
   /* default assumptions */
-  SET_SYMBOL_VALUE_ADDRESS (sym, cs->c_value + off);
+  sym->set_value_address (cs->c_value + off);
   sym->set_domain (VAR_DOMAIN);
   sym->set_section_index (secnum_to_section (cs->c_secnum, objfile));
 
@@ -1660,9 +1660,8 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
 			       cs->c_name, 0, 0, objfile);
 	  if (sym != NULL)
 	    {
-	      SET_SYMBOL_VALUE_ADDRESS (sym,
-					SYMBOL_VALUE_ADDRESS (sym)
-					+ static_block_base);
+	      sym->set_value_address
+		(sym->value_address () + static_block_base);
 	      sym->set_section_index (static_block_section);
 	    }
 	  return sym;
diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c
index a252574c94e2..c2d906d14025 100644
--- a/gdb/z80-tdep.c
+++ b/gdb/z80-tdep.c
@@ -360,7 +360,7 @@ z80_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
       msymbol = lookup_minimal_symbol ("__sdcc_enter_ix", NULL, NULL);
       if (msymbol.minsym)
 	{
-	  value = BMSYMBOL_VALUE_ADDRESS (msymbol);
+	  value = msymbol.value_address ();
 	  if (value == extract_unsigned_integer (&prologue[pos+1], addr_len, byte_order))
 	    {
 	      pos += 1 + addr_len;
@@ -625,7 +625,7 @@ z80_frame_unwind_cache (struct frame_info *this_frame,
 		  msymbol = lookup_minimal_symbol (names[i], NULL, NULL);
 		  if (!msymbol.minsym)
 		    continue;
-		  if (addr == BMSYMBOL_VALUE_ADDRESS (msymbol))
+		  if (addr == msymbol.value_address ())
 		    break;
 		}
 	      if (i >= 0)
@@ -722,7 +722,7 @@ z80_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
       struct bound_minimal_symbol bh;
       bh = lookup_minimal_symbol ("_break_handler", NULL, NULL);
       if (bh.minsym)
-	addr = BMSYMBOL_VALUE_ADDRESS (bh);
+	addr = bh.value_address ();
       else
 	{
 	  warning(_("Unable to determine inferior's software breakpoint type: "
@@ -927,14 +927,13 @@ z80_read_overlay_region_table ()
   word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
   byte_order = gdbarch_byte_order (gdbarch);
 
-  cache_novly_regions = read_memory_integer (
-				BMSYMBOL_VALUE_ADDRESS (novly_regions_msym),
-				4, byte_order);
+  cache_novly_regions = read_memory_integer (novly_regions_msym.value_address (),
+                                             4, byte_order);
   cache_ovly_region_table
     = (unsigned int (*)[3]) xmalloc (cache_novly_regions *
 					sizeof (*cache_ovly_region_table));
   cache_ovly_region_table_base
-    = BMSYMBOL_VALUE_ADDRESS (ovly_region_table_msym);
+    = ovly_region_table_msym.value_address ();
   read_target_long_array (cache_ovly_region_table_base,
 			  (unsigned int *) cache_ovly_region_table,
 			  cache_novly_regions * 3, word_size, byte_order);

base-commit: f190d13c78ba4b98d272cbb4e9a8f19b49b575de
-- 
2.35.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/4] gdb: remove MSYMBOL_TYPE macro
  2022-04-10 12:51 [PATCH 1/4] gdb: remove symbol value macros Simon Marchi
@ 2022-04-10 12:51 ` Simon Marchi
  2022-04-12 15:54   ` Tom Tromey
  2022-04-10 12:51 ` [PATCH 3/4] gdb: remove minimal symbol size macros Simon Marchi
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Simon Marchi @ 2022-04-10 12:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@efficios.com>

Add a getter and a setter for a minimal symbol's type.  Remove the
corresponding macro and adjust all callers.

Change-Id: I89900df5ffa5687133fe1a16b2e0d4684e67a77d
---
 gdb/ada-lang.c                      |  6 ++--
 gdb/breakpoint.c                    |  8 +++---
 gdb/c-exp.y                         |  4 +--
 gdb/coff-pe-read.c                  |  2 +-
 gdb/coffread.c                      |  6 ++--
 gdb/compile/compile-c-symbols.c     |  4 +--
 gdb/compile/compile-cplus-symbols.c |  4 +--
 gdb/compile/compile-object-load.c   |  2 +-
 gdb/elfread.c                       |  2 +-
 gdb/linespec.c                      | 14 +++++-----
 gdb/minsyms.c                       | 43 ++++++++++++++---------------
 gdb/parse.c                         |  4 +--
 gdb/printcmd.c                      | 14 +++++-----
 gdb/stabsread.c                     |  2 +-
 gdb/symmisc.c                       |  2 +-
 gdb/symtab.c                        | 34 +++++++++++------------
 gdb/symtab.h                        | 13 +++++++--
 17 files changed, 86 insertions(+), 78 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 29f2a4b255a9..ffe35500d685 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -4898,7 +4898,7 @@ ada_lookup_simple_minsym (const char *name)
       for (minimal_symbol *msymbol : objfile->msymbols ())
 	{
 	  if (match_name (msymbol->linkage_name (), lookup_name, NULL)
-	      && MSYMBOL_TYPE (msymbol) != mst_solib_trampoline)
+	      && msymbol->type () != mst_solib_trampoline)
 	    {
 	      result.minsym = msymbol;
 	      result.objfile = objfile;
@@ -11717,7 +11717,7 @@ ada_has_this_exception_support (const struct exception_support_info *einfo)
       struct bound_minimal_symbol msym
 	= lookup_minimal_symbol (einfo->catch_exception_sym, NULL, NULL);
 
-      if (msym.minsym && MSYMBOL_TYPE (msym.minsym) != mst_solib_trampoline)
+      if (msym.minsym && msym.minsym->type () != mst_solib_trampoline)
 	error (_("Your Ada runtime appears to be missing some debugging "
 		 "information.\nCannot insert Ada exception catchpoint "
 		 "in this configuration."));
@@ -11740,7 +11740,7 @@ ada_has_this_exception_support (const struct exception_support_info *einfo)
       struct bound_minimal_symbol msym
 	= lookup_minimal_symbol (einfo->catch_handlers_sym, NULL, NULL);
 
-      if (msym.minsym && MSYMBOL_TYPE (msym.minsym) != mst_solib_trampoline)
+      if (msym.minsym && msym.minsym->type () != mst_solib_trampoline)
 	error (_("Your Ada runtime appears to be missing some debugging "
 		 "information.\nCannot insert Ada exception catchpoint "
 		 "in this configuration."));
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index af7eb6cc1133..1a227e5d120a 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3439,8 +3439,8 @@ create_std_terminate_master_breakpoint (void)
 	      struct bound_minimal_symbol m;
 
 	      m = lookup_minimal_symbol (func_name, NULL, objfile);
-	      if (m.minsym == NULL || (MSYMBOL_TYPE (m.minsym) != mst_text
-				       && MSYMBOL_TYPE (m.minsym) != mst_file_text))
+	      if (m.minsym == NULL || (m.minsym->type () != mst_text
+				       && m.minsym->type () != mst_file_text))
 		{
 		  /* Prevent future lookups in this objfile.  */
 		  bp_objfile_data->terminate_msym.minsym = &msym_not_found;
@@ -7175,8 +7175,8 @@ set_breakpoint_location_function (struct bp_location *loc)
       const char *function_name;
 
       if (loc->msymbol != NULL
-	  && (MSYMBOL_TYPE (loc->msymbol) == mst_text_gnu_ifunc
-	      || MSYMBOL_TYPE (loc->msymbol) == mst_data_gnu_ifunc))
+	  && (loc->msymbol->type () == mst_text_gnu_ifunc
+	      || loc->msymbol->type () == mst_data_gnu_ifunc))
 	{
 	  struct breakpoint *b = loc->owner;
 
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 4fa3f8d2fc48..d852b1e8a360 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -1232,8 +1232,8 @@ variable:	name_not_typename
 				 is important for example for "p
 				 *__errno_location()".  */
 			      symbol *alias_target
-				= ((msymbol.minsym->type != mst_text_gnu_ifunc
-				    && msymbol.minsym->type != mst_data_gnu_ifunc)
+				= ((msymbol.minsym->type () != mst_text_gnu_ifunc
+				    && msymbol.minsym->type () != mst_data_gnu_ifunc)
 				   ? find_function_alias_target (msymbol)
 				   : NULL);
 			      if (alias_target != NULL)
diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c
index 1f11606cdfff..3ae2a7ffb13e 100644
--- a/gdb/coff-pe-read.c
+++ b/gdb/coff-pe-read.c
@@ -245,7 +245,7 @@ add_pe_forwarded_sym (minimal_symbol_reader &reader,
 		sym_name, dll_name, forward_qualified_name);
 
   vma = msymbol.value_address ();
-  msymtype = MSYMBOL_TYPE (msymbol.minsym);
+  msymtype = msymbol.minsym->type ();
   section = msymbol.minsym->section_index ();
 
   /* Generate a (hopefully unique) qualified name using the first part
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 24dd9b960113..f5ef12854405 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -647,7 +647,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
 	     or "_imp_", get rid of the prefix, and search the minimal
 	     symbol in OBJFILE.  Note that 'maintenance print msymbols'
 	     shows that type of these "_imp_XXXX" symbols is mst_data.  */
-	  if (MSYMBOL_TYPE (msym) == mst_data)
+	  if (msym->type () == mst_data)
 	    {
 	      const char *name1 = NULL;
 
@@ -669,8 +669,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
 		     respectively in OBJFILE.  Set the type of symbol "foo"
 		     as 'mst_solib_trampoline'.  */
 		  if (found.minsym != NULL
-		      && MSYMBOL_TYPE (found.minsym) == mst_text)
-		    MSYMBOL_TYPE (found.minsym) = mst_solib_trampoline;
+		      && found.minsym->type () == mst_text)
+		    found.minsym->set_type (mst_solib_trampoline);
 		}
 	    }
 	}
diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c
index a50e84d117ac..642c0be5db32 100644
--- a/gdb/compile/compile-c-symbols.c
+++ b/gdb/compile/compile-c-symbols.c
@@ -273,7 +273,7 @@ convert_symbol_bmsym (compile_c_instance *context,
   addr = msym->value_address (objfile);
 
   /* Conversion copied from write_exp_msymbol.  */
-  switch (MSYMBOL_TYPE (msym))
+  switch (msym->type ())
     {
     case mst_text:
     case mst_file_text:
@@ -422,7 +422,7 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
 			    "symbol\n",
 			    identifier);
 	      result = msym.value_address ();
-	      if (MSYMBOL_TYPE (msym.minsym) == mst_text_gnu_ifunc)
+	      if (msym.minsym->type () == mst_text_gnu_ifunc)
 		result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
 	      found = 1;
 	    }
diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplus-symbols.c
index b68184c55f96..7ad9ea91132d 100644
--- a/gdb/compile/compile-cplus-symbols.c
+++ b/gdb/compile/compile-cplus-symbols.c
@@ -284,7 +284,7 @@ convert_symbol_bmsym (compile_cplus_instance *instance,
   addr = msym->value_address (objfile);
 
   /* Conversion copied from write_exp_msymbol.  */
-  switch (MSYMBOL_TYPE (msym))
+  switch (msym->type ())
     {
     case mst_text:
     case mst_file_text:
@@ -459,7 +459,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
 			    "symbol\n",
 			    identifier);
 	      result = msym.value_address ();
-	      if (MSYMBOL_TYPE (msym.minsym) == mst_text_gnu_ifunc)
+	      if (msym.minsym->type () == mst_text_gnu_ifunc)
 		result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
 	      found = 1;
 	    }
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index bfb40c9625cd..dee7882e7e36 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -766,7 +766,7 @@ compile_object_load (const compile_file_names &file_names,
 
       bmsym = lookup_minimal_symbol (sym->name, NULL, NULL);
       switch (bmsym.minsym == NULL
-	      ? mst_unknown : MSYMBOL_TYPE (bmsym.minsym))
+	      ? mst_unknown : bmsym.minsym->type ())
 	{
 	case mst_text:
 	case mst_bss:
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 3f1f87650f21..6df206b19db1 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -828,7 +828,7 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p)
       msym = lookup_minimal_symbol (name_got_plt, NULL, objfile);
       if (msym.minsym == NULL)
 	continue;
-      if (MSYMBOL_TYPE (msym.minsym) != mst_slot_got_plt)
+      if (msym.minsym->type () != mst_slot_got_plt)
 	continue;
       pointer_address = msym.value_address ();
 
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 3c176bea94e5..ba89bd09b560 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -2228,11 +2228,11 @@ convert_linespec_to_sals (struct linespec_state *state, linespec *ls)
 
 		  for (const auto &elem : ls->minimal_symbols)
 		    {
-		      if (MSYMBOL_TYPE (elem.minsym) == mst_text_gnu_ifunc
-			  || MSYMBOL_TYPE (elem.minsym) == mst_data_gnu_ifunc)
+		      if (elem.minsym->type () == mst_text_gnu_ifunc
+			  || elem.minsym->type () == mst_data_gnu_ifunc)
 			{
 			  CORE_ADDR msym_addr = elem.value_address ();
-			  if (MSYMBOL_TYPE (elem.minsym) == mst_data_gnu_ifunc)
+			  if (elem.minsym->type () == mst_data_gnu_ifunc)
 			    {
 			      struct gdbarch *gdbarch
 				= elem.objfile->arch ();
@@ -4146,8 +4146,8 @@ minsym_found (struct linespec_state *self, struct objfile *objfile,
     {
       const char *msym_name = msymbol->linkage_name ();
 
-      if (MSYMBOL_TYPE (msymbol) == mst_text_gnu_ifunc
-	  || MSYMBOL_TYPE (msymbol) == mst_data_gnu_ifunc)
+      if (msymbol->type () == mst_text_gnu_ifunc
+	  || msymbol->type () == mst_data_gnu_ifunc)
 	want_start_sal = gnu_ifunc_resolve_name (msym_name, &func_addr);
       else
 	want_start_sal = true;
@@ -4284,7 +4284,7 @@ search_minsyms_for_name (struct collect_info *info,
   for (const bound_minimal_symbol &item : minsyms)
     {
       bool skip = false;
-      if (MSYMBOL_TYPE (item.minsym) == mst_solib_trampoline)
+      if (item.minsym->type () == mst_solib_trampoline)
 	{
 	  for (const bound_minimal_symbol &item2 : minsyms)
 	    {
@@ -4293,7 +4293,7 @@ search_minsyms_for_name (struct collect_info *info,
 
 	      /* Trampoline symbols can only jump to exported
 		 symbols.  */
-	      if (msymbol_type_is_static (MSYMBOL_TYPE (item2.minsym)))
+	      if (msymbol_type_is_static (item2.minsym->type ()))
 		continue;
 
 	      if (strcmp (item.minsym->linkage_name (),
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index e93cbed86216..11d357b8096b 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -115,7 +115,7 @@ msymbol_is_function (struct objfile *objfile, minimal_symbol *minsym,
 {
   CORE_ADDR msym_addr = minsym->value_address (objfile);
 
-  switch (minsym->type)
+  switch (minsym->type ())
     {
     case mst_slot_got_plt:
     case mst_data:
@@ -253,7 +253,7 @@ found_minimal_symbols::maybe_collect (const char *sfile,
 				      struct objfile *objfile,
 				      minimal_symbol *msymbol)
 {
-  switch (MSYMBOL_TYPE (msymbol))
+  switch (msymbol->type ())
     {
     case mst_file_text:
     case mst_file_data:
@@ -586,8 +586,8 @@ lookup_minimal_symbol_linkage (const char *name, struct objfile *objf)
 	   msymbol = msymbol->hash_next)
 	{
 	  if (strcmp (msymbol->linkage_name (), name) == 0
-	      && (MSYMBOL_TYPE (msymbol) == mst_data
-		  || MSYMBOL_TYPE (msymbol) == mst_bss))
+	      && (msymbol->type () == mst_data
+		  || msymbol->type () == mst_bss))
 	    return {msymbol, objfile};
 	}
     }
@@ -619,11 +619,11 @@ lookup_minimal_symbol_text (const char *name, struct objfile *objf)
 	       msymbol = msymbol->hash_next)
 	    {
 	      if (strcmp (msymbol->linkage_name (), name) == 0 &&
-		  (MSYMBOL_TYPE (msymbol) == mst_text
-		   || MSYMBOL_TYPE (msymbol) == mst_text_gnu_ifunc
-		   || MSYMBOL_TYPE (msymbol) == mst_file_text))
+		  (msymbol->type () == mst_text
+		   || msymbol->type () == mst_text_gnu_ifunc
+		   || msymbol->type () == mst_file_text))
 		{
-		  switch (MSYMBOL_TYPE (msymbol))
+		  switch (msymbol->type ())
 		    {
 		    case mst_file_text:
 		      found_file_symbol.minsym = msymbol;
@@ -840,7 +840,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 		     triggered by a special mst_abs_or_lib or some
 		     such.  */
 
-		  if (MSYMBOL_TYPE (&msymbol[hi]) == mst_abs)
+		  if (msymbol[hi].type () == mst_abs)
 		    {
 		      hi--;
 		      continue;
@@ -866,8 +866,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 		     preceding symbol too.  If they are otherwise
 		     identical prefer that one.  */
 		  if (hi > 0
-		      && MSYMBOL_TYPE (&msymbol[hi]) != want_type
-		      && MSYMBOL_TYPE (&msymbol[hi - 1]) == want_type
+		      && msymbol[hi].type () != want_type
+		      && msymbol[hi - 1].type () == want_type
 		      && (MSYMBOL_SIZE (&msymbol[hi])
 			  == MSYMBOL_SIZE (&msymbol[hi - 1]))
 		      && (msymbol[hi].value_raw_address ()
@@ -993,7 +993,7 @@ in_gnu_ifunc_stub (CORE_ADDR pc)
   bound_minimal_symbol msymbol
     = lookup_minimal_symbol_by_pc_section (pc, NULL,
 					   lookup_msym_prefer::GNU_IFUNC);
-  return msymbol.minsym && MSYMBOL_TYPE (msymbol.minsym) == mst_text_gnu_ifunc;
+  return msymbol.minsym && msymbol.minsym->type () == mst_text_gnu_ifunc;
 }
 
 /* See elf_gnu_ifunc_resolve_addr for its real implementation.  */
@@ -1211,7 +1211,7 @@ minimal_symbol_reader::record_full (gdb::string_view name,
   msymbol->set_value_address (address);
   msymbol->set_section_index (section);
 
-  MSYMBOL_TYPE (msymbol) = ms_type;
+  msymbol->set_type (ms_type);
 
   /* If we already read minimal symbols for this objfile, then don't
      ever allocate a new one.  */
@@ -1303,10 +1303,9 @@ compact_minimal_symbols (struct minimal_symbol *msymbol, int mcount,
 	      && strcmp (copyfrom->linkage_name (),
 			 (copyfrom + 1)->linkage_name ()) == 0)
 	    {
-	      if (MSYMBOL_TYPE ((copyfrom + 1)) == mst_unknown)
-		{
-		  MSYMBOL_TYPE ((copyfrom + 1)) = MSYMBOL_TYPE (copyfrom);
-		}
+	      if ((copyfrom + 1)->type () == mst_unknown)
+		(copyfrom + 1)->set_type (copyfrom->type ());
+
 	      copyfrom++;
 	    }
 	  else
@@ -1530,7 +1529,7 @@ lookup_solib_trampoline_symbol_by_pc (CORE_ADDR pc)
 					   lookup_msym_prefer::TRAMPOLINE);
 
   if (msymbol.minsym != NULL
-      && MSYMBOL_TYPE (msymbol.minsym) == mst_solib_trampoline)
+      && msymbol.minsym->type () == mst_solib_trampoline)
     return msymbol.minsym;
   return NULL;
 }
@@ -1558,10 +1557,10 @@ find_solib_trampoline_target (struct frame_info *frame, CORE_ADDR pc)
 	    {
 	      /* Also handle minimal symbols pointing to function
 		 descriptors.  */
-	      if ((MSYMBOL_TYPE (msymbol) == mst_text
-		   || MSYMBOL_TYPE (msymbol) == mst_text_gnu_ifunc
-		   || MSYMBOL_TYPE (msymbol) == mst_data
-		   || MSYMBOL_TYPE (msymbol) == mst_data_gnu_ifunc)
+	      if ((msymbol->type () == mst_text
+		   || msymbol->type () == mst_text_gnu_ifunc
+		   || msymbol->type () == mst_data
+		   || msymbol->type () == mst_data_gnu_ifunc)
 		  && strcmp (msymbol->linkage_name (),
 			     tsymbol->linkage_name ()) == 0)
 		{
diff --git a/gdb/parse.c b/gdb/parse.c
index 2389dbf0b0f5..73669923890e 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -103,7 +103,7 @@ find_minsym_type_and_address (minimal_symbol *msymbol,
 {
   bound_minimal_symbol bound_msym = {msymbol, objfile};
   struct obj_section *section = msymbol->obj_section (objfile);
-  enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol);
+  enum minimal_symbol_type type = msymbol->type ();
 
   bool is_tls = (section != NULL
 		 && section->the_bfd_section->flags & SEC_THREAD_LOCAL);
@@ -124,7 +124,7 @@ find_minsym_type_and_address (minimal_symbol *msymbol,
 	  /* This means we resolved a function descriptor, and we now
 	     have an address for a code/text symbol instead of a data
 	     symbol.  */
-	  if (MSYMBOL_TYPE (msymbol) == mst_data_gnu_ifunc)
+	  if (msymbol->type () == mst_data_gnu_ifunc)
 	    type = mst_text_gnu_ifunc;
 	  else
 	    type = mst_text;
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index e870b35cf387..19add04d3b38 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -655,9 +655,9 @@ build_address_symbolic (struct gdbarch *gdbarch,
   if (msymbol.minsym != NULL
       && MSYMBOL_HAS_SIZE (msymbol.minsym)
       && MSYMBOL_SIZE (msymbol.minsym) == 0
-      && MSYMBOL_TYPE (msymbol.minsym) != mst_text
-      && MSYMBOL_TYPE (msymbol.minsym) != mst_text_gnu_ifunc
-      && MSYMBOL_TYPE (msymbol.minsym) != mst_file_text)
+      && msymbol.minsym->type () != mst_text
+      && msymbol.minsym->type () != mst_text_gnu_ifunc
+      && msymbol.minsym->type () != mst_file_text)
     msymbol.minsym = NULL;
 
   if (msymbol.minsym != NULL)
@@ -681,10 +681,10 @@ build_address_symbolic (struct gdbarch *gdbarch,
 	     first instruction of a Thumb function as <function>; the
 	     second instruction will be <function+2>, even though the
 	     pointer is <function+3>.  This matches the ISA behavior.  */
-	  if (MSYMBOL_TYPE (msymbol.minsym) == mst_text
-	      || MSYMBOL_TYPE (msymbol.minsym) == mst_text_gnu_ifunc
-	      || MSYMBOL_TYPE (msymbol.minsym) == mst_file_text
-	      || MSYMBOL_TYPE (msymbol.minsym) == mst_solib_trampoline)
+	  if (msymbol.minsym->type () == mst_text
+	      || msymbol.minsym->type () == mst_text_gnu_ifunc
+	      || msymbol.minsym->type () == mst_file_text
+	      || msymbol.minsym->type () == mst_solib_trampoline)
 	    addr = gdbarch_addr_bits_remove (gdbarch, addr);
 
 	  symbol = 0;
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 3f173da71d59..4fe2110a47fd 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -4538,7 +4538,7 @@ scan_file_globals (struct objfile *objfile)
 	  QUIT;
 
 	  /* Skip static symbols.  */
-	  switch (MSYMBOL_TYPE (msymbol))
+	  switch (msymbol->type ())
 	    {
 	    case mst_file_text:
 	    case mst_file_data:
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 1bc5f9f0bd95..18741e4cab56 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -160,7 +160,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
     {
       struct obj_section *section = msymbol->obj_section (objfile);
 
-      switch (MSYMBOL_TYPE (msymbol))
+      switch (msymbol->type ())
 	{
 	case mst_unknown:
 	  ms_type = 'u';
diff --git a/gdb/symtab.c b/gdb/symtab.c
index d15eec8b6b49..a75492603b8e 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -432,11 +432,11 @@ minimal_symbol::value_address (objfile *objfile) const
 bool
 minimal_symbol::data_p () const
 {
-  return type == mst_data
-    || type == mst_bss
-    || type == mst_abs
-    || type == mst_file_data
-    || type == mst_file_bss;
+  return m_type == mst_data
+    || m_type == mst_bss
+    || m_type == mst_abs
+    || m_type == mst_file_data
+    || m_type == mst_file_bss;
 }
 
 /* See symtab.h.  */
@@ -444,12 +444,12 @@ minimal_symbol::data_p () const
 bool
 minimal_symbol::text_p () const
 {
-  return type == mst_text
-    || type == mst_text_gnu_ifunc
-    || type == mst_data_gnu_ifunc
-    || type == mst_slot_got_plt
-    || type == mst_solib_trampoline
-    || type == mst_file_text;
+  return m_type == mst_text
+    || m_type == mst_text_gnu_ifunc
+    || m_type == mst_data_gnu_ifunc
+    || m_type == mst_slot_got_plt
+    || m_type == mst_solib_trampoline
+    || m_type == mst_file_text;
 }
 
 /* See whether FILENAME matches SEARCH_NAME using the rule that we
@@ -3238,7 +3238,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
    */
   msymbol = lookup_minimal_symbol_by_pc (pc);
   if (msymbol.minsym != NULL)
-    if (MSYMBOL_TYPE (msymbol.minsym) == mst_solib_trampoline)
+    if (msymbol.minsym->type () == mst_solib_trampoline)
       {
 	struct bound_minimal_symbol mfunsym
 	  = lookup_minimal_symbol_text (msymbol.minsym->linkage_name (),
@@ -4751,7 +4751,7 @@ bool
 global_symbol_searcher::is_suitable_msymbol
 	(const enum search_domain kind, const minimal_symbol *msymbol)
 {
-  switch (MSYMBOL_TYPE (msymbol))
+  switch (msymbol->type ())
     {
     case mst_data:
     case mst_bss:
@@ -5767,7 +5767,7 @@ symbol_is_function_or_method (symbol *sym)
 bool
 symbol_is_function_or_method (minimal_symbol *msymbol)
 {
-  switch (MSYMBOL_TYPE (msymbol))
+  switch (msymbol->type ())
     {
     case mst_text:
     case mst_text_gnu_ifunc:
@@ -5797,11 +5797,11 @@ find_gnu_ifunc (const symbol *sym)
   iterate_over_minimal_symbols (objfile, lookup_name,
 				[&] (minimal_symbol *minsym)
     {
-      if (MSYMBOL_TYPE (minsym) == mst_text_gnu_ifunc
-	  || MSYMBOL_TYPE (minsym) == mst_data_gnu_ifunc)
+      if (minsym->type () == mst_text_gnu_ifunc
+	  || minsym->type () == mst_data_gnu_ifunc)
 	{
 	  CORE_ADDR msym_addr = minsym->value_address (objfile);
-	  if (MSYMBOL_TYPE (minsym) == mst_data_gnu_ifunc)
+	  if (minsym->type () == mst_data_gnu_ifunc)
 	    {
 	      struct gdbarch *gdbarch = objfile->arch ();
 	      msym_addr = gdbarch_convert_from_func_ptr_addr
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 390ee9d0d67d..d92446d3151d 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -699,6 +699,16 @@ struct minimal_symbol : public general_symbol_info
     return m_value.address;
   }
 
+  minimal_symbol_type type () const
+  {
+    return m_type;
+  }
+
+  void set_type (minimal_symbol_type type)
+  {
+    m_type = type;
+  }
+
   /* Size of this symbol.  dbx_end_psymtab in dbxread.c uses this
      information to calculate the end of the partial symtab based on the
      address of the last symbol plus the size of the last symbol.  */
@@ -710,7 +720,7 @@ struct minimal_symbol : public general_symbol_info
 
   /* Classification type for this minimal symbol.  */
 
-  ENUM_BITFIELD(minimal_symbol_type) type : MINSYM_TYPE_BITS;
+  ENUM_BITFIELD(minimal_symbol_type) m_type : MINSYM_TYPE_BITS;
 
   /* Non-zero if this symbol was created by gdb.
      Such symbols do not appear in the output of "info var|fun".  */
@@ -766,7 +776,6 @@ struct minimal_symbol : public general_symbol_info
       (msymbol)->has_size = 1;			\
     } while (0)
 #define MSYMBOL_HAS_SIZE(msymbol)	((msymbol)->has_size + 0)
-#define MSYMBOL_TYPE(msymbol)		(msymbol)->type
 
 #include "minsyms.h"
 
-- 
2.35.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 3/4] gdb: remove minimal symbol size macros
  2022-04-10 12:51 [PATCH 1/4] gdb: remove symbol value macros Simon Marchi
  2022-04-10 12:51 ` [PATCH 2/4] gdb: remove MSYMBOL_TYPE macro Simon Marchi
@ 2022-04-10 12:51 ` Simon Marchi
  2022-04-12 15:54   ` Tom Tromey
  2022-04-10 12:51 ` [PATCH 4/4] gdb: remove MSYMBOL_TARGET_FLAG_{1,2} macros Simon Marchi
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Simon Marchi @ 2022-04-10 12:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@efficios.com>

Remove MSYMBOL_HAS_SIZE, MSYMBOL_SIZE and SET_MSYMBOL_SIZE, replace them
with equivalent methods.

Change-Id: I6ee1cf82df37e58dff52ea6568ceb4649c7d7538
---
 gdb/auxv.c       |  2 +-
 gdb/csky-tdep.c  |  2 +-
 gdb/dbxread.c    |  2 +-
 gdb/elfread.c    |  8 ++++----
 gdb/minsyms.c    | 21 ++++++++++-----------
 gdb/mips-tdep.c  |  4 ++--
 gdb/ppc64-tdep.c |  2 +-
 gdb/printcmd.c   |  4 ++--
 gdb/symtab.h     | 28 ++++++++++++++++++----------
 9 files changed, 40 insertions(+), 33 deletions(-)

diff --git a/gdb/auxv.c b/gdb/auxv.c
index 190cd69d6bd8..8e175138f5da 100644
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -94,7 +94,7 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
   if (msym.minsym == NULL)
     return TARGET_XFER_E_IO;
 
-  if (MSYMBOL_SIZE (msym.minsym) != ptr_size)
+  if (msym.minsym->size () != ptr_size)
     return TARGET_XFER_E_IO;
 
   /* POINTER_ADDRESS is a location where the `_dl_auxv' variable
diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c
index 3712409dbe83..105f5fccd129 100644
--- a/gdb/csky-tdep.c
+++ b/gdb/csky-tdep.c
@@ -1845,7 +1845,7 @@ csky_frame_unwind_cache (struct frame_info *this_frame)
       struct bound_minimal_symbol msymbol
 	= lookup_minimal_symbol_by_pc (prologue_start);
       if (msymbol.minsym != NULL)
-	func_size = MSYMBOL_SIZE (msymbol.minsym);
+	func_size = msymbol.minsym->size ();
     }
 
   /* If FUNC_SIZE is 0 we may have a special-case use of lr
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index a536a087c7f3..bcf519000bce 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -2025,7 +2025,7 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
 
       if (minsym.minsym)
 	pst->set_text_high (minsym.minsym->value_raw_address ()
-			    + MSYMBOL_SIZE (minsym.minsym));
+			    + minsym.minsym->size ());
 
       last_function_name = NULL;
     }
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 6df206b19db1..b136c605b1ae 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -483,7 +483,7 @@ elf_symtab_read (minimal_symbol_reader &reader,
 	      if (type != ST_SYNTHETIC)
 		{
 		  /* Pass symbol size field in via BFD.  FIXME!!!  */
-		  SET_MSYMBOL_SIZE (msym, elf_sym->internal_elf_sym.st_size);
+		  msym->set_size (elf_sym->internal_elf_sym.st_size);
 		}
 
 	      msym->filename = filesymname;
@@ -522,7 +522,7 @@ elf_symtab_read (minimal_symbol_reader &reader,
 			 symaddr, mst_solib_trampoline, sym->section, objfile);
 		      if (mtramp)
 			{
-			  SET_MSYMBOL_SIZE (mtramp, MSYMBOL_SIZE (msym));
+			  mtramp->set_size (msym->size());
 			  mtramp->created_by_gdb = 1;
 			  mtramp->filename = filesymname;
 			  if (elf_make_msymbol_special_p)
@@ -640,7 +640,7 @@ elf_rel_plt_read (minimal_symbol_reader &reader,
 				    true, address, mst_slot_got_plt,
 				    msym_section, objfile);
       if (msym)
-	SET_MSYMBOL_SIZE (msym, ptr_size);
+	msym->set_size (ptr_size);
     }
 }
 
@@ -836,7 +836,7 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p)
       if (plt == NULL)
 	continue;
 
-      if (MSYMBOL_SIZE (msym.minsym) != ptr_size)
+      if (msym.minsym->size () != ptr_size)
 	continue;
       if (target_read_memory (pointer_address, buf, ptr_size) != 0)
 	continue;
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 11d357b8096b..f1c28907fa6c 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -868,8 +868,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 		  if (hi > 0
 		      && msymbol[hi].type () != want_type
 		      && msymbol[hi - 1].type () == want_type
-		      && (MSYMBOL_SIZE (&msymbol[hi])
-			  == MSYMBOL_SIZE (&msymbol[hi - 1]))
+		      && (msymbol[hi].size () == msymbol[hi - 1].size ())
 		      && (msymbol[hi].value_raw_address ()
 			  == msymbol[hi - 1].value_raw_address ())
 		      && (msymbol[hi].obj_section (objfile)
@@ -885,7 +884,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 		     symbol isn't an object or function (e.g. a
 		     label), or it may just mean that the size was not
 		     specified.  */
-		  if (MSYMBOL_SIZE (&msymbol[hi]) == 0)
+		  if (msymbol[hi].size () == 0)
 		    {
 		      if (best_zero_sized == -1)
 			best_zero_sized = hi;
@@ -899,11 +898,11 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 		     the nocancel variants of system calls are inside
 		     the cancellable variants, but both have sizes.  */
 		  if (hi > 0
-		      && MSYMBOL_SIZE (&msymbol[hi]) != 0
+		      && msymbol[hi].size () != 0
 		      && pc >= (msymbol[hi].value_raw_address ()
-				+ MSYMBOL_SIZE (&msymbol[hi]))
+				+ msymbol[hi].size ())
 		      && pc < (msymbol[hi - 1].value_raw_address ()
-			       + MSYMBOL_SIZE (&msymbol[hi - 1])))
+			       + msymbol[hi - 1].size ()))
 		    {
 		      hi--;
 		      continue;
@@ -920,7 +919,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 		 address).  Also, if we ran off the end, be sure
 		 to back up.  */
 	      if (best_zero_sized != -1
-		  && (hi < 0 || MSYMBOL_SIZE (&msymbol[hi]) == 0))
+		  && (hi < 0 || msymbol[hi].size () == 0))
 		hi = best_zero_sized;
 
 	      /* If the minimal symbol has a non-zero size, and this
@@ -931,9 +930,9 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 		 specified sizes, they do not overlap.  */
 
 	      if (hi >= 0
-		  && MSYMBOL_SIZE (&msymbol[hi]) != 0
+		  && msymbol[hi].size () != 0
 		  && pc >= (msymbol[hi].value_raw_address ()
-			    + MSYMBOL_SIZE (&msymbol[hi])))
+			    + msymbol[hi].size ()))
 		{
 		  if (best_zero_sized != -1)
 		    hi = best_zero_sized;
@@ -1593,8 +1592,8 @@ minimal_symbol_upper_bound (struct bound_minimal_symbol minsym)
      lesser of the next minimal symbol in the same section, or the end
      of the section, as the end of the function.  */
 
-  if (MSYMBOL_SIZE (minsym.minsym) != 0)
-    return minsym.value_address () + MSYMBOL_SIZE (minsym.minsym);
+  if (minsym.minsym->size () != 0)
+    return minsym.value_address () + minsym.minsym->size ();
 
   /* Step over other symbols at this same address, and symbols in
      other sections, to find the next symbol in this section with a
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 78e7f5ccf871..ec95d5454ab8 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -7836,11 +7836,11 @@ mips_skip_pic_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
     return 0;
 
   /* A two-instruction header.  */
-  if (MSYMBOL_SIZE (msym.minsym) == 8)
+  if (msym.minsym->size () == 8)
     return pc + 8;
 
   /* A three-instruction (plus delay slot) trampoline.  */
-  if (MSYMBOL_SIZE (msym.minsym) == 16)
+  if (msym.minsym->size () == 16)
     {
       if (target_read_memory (pc, stub_code, 16) != 0)
 	return 0;
diff --git a/gdb/ppc64-tdep.c b/gdb/ppc64-tdep.c
index 02fcc653b3a1..32931f726918 100644
--- a/gdb/ppc64-tdep.c
+++ b/gdb/ppc64-tdep.c
@@ -798,6 +798,6 @@ ppc64_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
   if ((sym->flags & BSF_SYNTHETIC) != 0 && sym->udata.p != NULL)
     {
       elf_symbol_type *elf_sym = (elf_symbol_type *) sym->udata.p;
-      SET_MSYMBOL_SIZE (msym, elf_sym->internal_elf_sym.st_size);
+      msym->set_size (elf_sym->internal_elf_sym.st_size);
     }
 }
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 19add04d3b38..f4f64b669bcf 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -653,8 +653,8 @@ build_address_symbolic (struct gdbarch *gdbarch,
     }
 
   if (msymbol.minsym != NULL
-      && MSYMBOL_HAS_SIZE (msymbol.minsym)
-      && MSYMBOL_SIZE (msymbol.minsym) == 0
+      && msymbol.minsym->has_size ()
+      && msymbol.minsym->size () == 0
       && msymbol.minsym->type () != mst_text
       && msymbol.minsym->type () != mst_text_gnu_ifunc
       && msymbol.minsym->type () != mst_file_text)
diff --git a/gdb/symtab.h b/gdb/symtab.h
index d92446d3151d..43ea140a64a0 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -709,11 +709,27 @@ struct minimal_symbol : public general_symbol_info
     m_type = type;
   }
 
+  unsigned long size () const
+  {
+    return m_size;
+  }
+
+  void set_size (unsigned long size)
+  {
+    m_size = size;
+    m_has_size = 1;
+  }
+
+  bool has_size () const
+  {
+    return m_has_size;
+  }
+
   /* Size of this symbol.  dbx_end_psymtab in dbxread.c uses this
      information to calculate the end of the partial symtab based on the
      address of the last symbol plus the size of the last symbol.  */
 
-  unsigned long size;
+  unsigned long m_size;
 
   /* Which source file is this symbol in?  Only relevant for mst_file_*.  */
   const char *filename;
@@ -733,7 +749,7 @@ struct minimal_symbol : public general_symbol_info
   /* Nonzero iff the size of the minimal symbol has been set.
      Symbol size information can sometimes not be determined, because
      the object file format may not carry that piece of information.  */
-  unsigned int has_size : 1;
+  unsigned int m_has_size : 1;
 
   /* For data symbols only, if this is set, then the symbol might be
      subject to copy relocation.  In this case, a minimal symbol
@@ -768,14 +784,6 @@ struct minimal_symbol : public general_symbol_info
 
 #define MSYMBOL_TARGET_FLAG_1(msymbol)  (msymbol)->target_flag_1
 #define MSYMBOL_TARGET_FLAG_2(msymbol)  (msymbol)->target_flag_2
-#define MSYMBOL_SIZE(msymbol)		((msymbol)->size + 0)
-#define SET_MSYMBOL_SIZE(msymbol, sz)		\
-  do						\
-    {						\
-      (msymbol)->size = sz;			\
-      (msymbol)->has_size = 1;			\
-    } while (0)
-#define MSYMBOL_HAS_SIZE(msymbol)	((msymbol)->has_size + 0)
 
 #include "minsyms.h"
 
-- 
2.35.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 4/4] gdb: remove MSYMBOL_TARGET_FLAG_{1,2} macros
  2022-04-10 12:51 [PATCH 1/4] gdb: remove symbol value macros Simon Marchi
  2022-04-10 12:51 ` [PATCH 2/4] gdb: remove MSYMBOL_TYPE macro Simon Marchi
  2022-04-10 12:51 ` [PATCH 3/4] gdb: remove minimal symbol size macros Simon Marchi
@ 2022-04-10 12:51 ` Simon Marchi
  2022-04-12 15:55   ` Tom Tromey
  2022-04-10 21:36 ` [PATCH 1/4] gdb: remove symbol value macros Tom Tromey
  2022-04-10 21:36 ` Tom Tromey
  4 siblings, 1 reply; 10+ messages in thread
From: Simon Marchi @ 2022-04-10 12:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@efficios.com>

Replace with equivalent getter/setter macros.

Change-Id: I1042564dd47347337374762bd64ec31b5c573ee2
---
 gdb/arm-tdep.c       |  4 ++--
 gdb/m68hc11-tdep.c   |  8 ++++----
 gdb/mips-tdep.c      |  4 ++--
 gdb/mips-tdep.h      | 13 +++++++++++--
 gdb/ppc-linux-tdep.c |  4 ++--
 gdb/symtab.h         | 27 ++++++++++++++++++++++-----
 6 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 7002bcaa279f..cc7773914d72 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -82,10 +82,10 @@ static bool arm_debug;
    MSYMBOL_IS_SPECIAL   Tests the "special" bit in a minimal symbol.  */
 
 #define MSYMBOL_SET_SPECIAL(msym)				\
-	MSYMBOL_TARGET_FLAG_1 (msym) = 1
+	(msym)->set_target_flag_1 (true)
 
 #define MSYMBOL_IS_SPECIAL(msym)				\
-	MSYMBOL_TARGET_FLAG_1 (msym)
+	(msym)->target_flag_1 ()
 
 struct arm_mapping_symbol
 {
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index e82b18a848fc..98f1367423eb 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -58,16 +58,16 @@
    MSYMBOL_IS_RTI       Tests the "RTC" bit in a minimal symbol.  */
 
 #define MSYMBOL_SET_RTC(msym)                           \
-	MSYMBOL_TARGET_FLAG_1 (msym) = 1
+	(msym)->set_target_flag_1 (true)
 
 #define MSYMBOL_SET_RTI(msym)                           \
-	MSYMBOL_TARGET_FLAG_2 (msym) = 1
+	(msym)->set_target_flag_2 (true)
 
 #define MSYMBOL_IS_RTC(msym)				\
-	MSYMBOL_TARGET_FLAG_1 (msym)
+	(msym)->target_flag_1 ()
 
 #define MSYMBOL_IS_RTI(msym)				\
-	MSYMBOL_TARGET_FLAG_2 (msym)
+	(msym)->target_flag_2 ()
 
 enum insn_return_kind {
   RETURN_RTS,
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index ec95d5454ab8..f31dacd4c7c3 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -435,12 +435,12 @@ mips_elf_make_msymbol_special (asymbol * sym, struct minimal_symbol *msym)
 
   if (ELF_ST_IS_MICROMIPS (st_other))
     {
-      MSYMBOL_TARGET_FLAG_MICROMIPS (msym) = 1;
+      SET_MSYMBOL_TARGET_FLAG_MICROMIPS (msym);
       msym->set_value_address (msym->value_raw_address () | 1);
     }
   else if (ELF_ST_IS_MIPS16 (st_other))
     {
-      MSYMBOL_TARGET_FLAG_MIPS16 (msym) = 1;
+      SET_MSYMBOL_TARGET_FLAG_MIPS16 (msym);
       msym->set_value_address (msym->value_raw_address () | 1);
     }
 }
diff --git a/gdb/mips-tdep.h b/gdb/mips-tdep.h
index f0a74409d9b3..4d2664d42731 100644
--- a/gdb/mips-tdep.h
+++ b/gdb/mips-tdep.h
@@ -50,8 +50,17 @@ enum mips_isa
   };
 
 /* Corresponding MSYMBOL_TARGET_FLAG aliases.  */
-#define MSYMBOL_TARGET_FLAG_MIPS16 MSYMBOL_TARGET_FLAG_1
-#define MSYMBOL_TARGET_FLAG_MICROMIPS MSYMBOL_TARGET_FLAG_2
+#define MSYMBOL_TARGET_FLAG_MIPS16(sym) \
+	(sym)->target_flag_1 ()
+
+#define SET_MSYMBOL_TARGET_FLAG_MIPS16(sym) \
+	(sym)->set_target_flag_1 (true)
+
+#define MSYMBOL_TARGET_FLAG_MICROMIPS(sym) \
+	(sym)->target_flag_2 ()
+
+#define SET_MSYMBOL_TARGET_FLAG_MICROMIPS(sym) \
+	(sym)->set_target_flag_2 (true)
 
 /* Return the MIPS ISA's register size.  Just a short cut to the BFD
    architecture's word size.  */
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index a11f3672393b..4c5f8b7a281c 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1639,7 +1639,7 @@ ppc_elfv2_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
     default:
       break;
     case 8:
-      MSYMBOL_TARGET_FLAG_1 (msym) = 1;
+      msym->set_target_flag_1 (true);
       break;
     }
 }
@@ -1659,7 +1659,7 @@ ppc_elfv2_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR pc)
 
   /* See ppc_elfv2_elf_make_msymbol_special for how local entry point
      offset values are encoded.  */
-  if (MSYMBOL_TARGET_FLAG_1 (fun.minsym))
+  if (fun.minsym->target_flag_1 ())
     local_entry_offset = 8;
 
   if (fun.value_address () <= pc
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 43ea140a64a0..498840143707 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -725,6 +725,26 @@ struct minimal_symbol : public general_symbol_info
     return m_has_size;
   }
 
+  bool target_flag_1 () const
+  {
+    return m_target_flag_1;
+  }
+
+  void set_target_flag_1 (bool target_flag_1)
+  {
+    m_target_flag_1 = target_flag_1;
+  }
+
+  bool target_flag_2 () const
+  {
+    return m_target_flag_2;
+  }
+
+  void set_target_flag_2 (bool target_flag_2)
+  {
+    m_target_flag_2 = target_flag_2;
+  }
+
   /* Size of this symbol.  dbx_end_psymtab in dbxread.c uses this
      information to calculate the end of the partial symtab based on the
      address of the last symbol plus the size of the last symbol.  */
@@ -743,8 +763,8 @@ struct minimal_symbol : public general_symbol_info
   unsigned int created_by_gdb : 1;
 
   /* Two flag bits provided for the use of the target.  */
-  unsigned int target_flag_1 : 1;
-  unsigned int target_flag_2 : 1;
+  unsigned int m_target_flag_1 : 1;
+  unsigned int m_target_flag_2 : 1;
 
   /* Nonzero iff the size of the minimal symbol has been set.
      Symbol size information can sometimes not be determined, because
@@ -782,9 +802,6 @@ struct minimal_symbol : public general_symbol_info
   bool text_p () const;
 };
 
-#define MSYMBOL_TARGET_FLAG_1(msymbol)  (msymbol)->target_flag_1
-#define MSYMBOL_TARGET_FLAG_2(msymbol)  (msymbol)->target_flag_2
-
 #include "minsyms.h"
 
 \f
-- 
2.35.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] gdb: remove symbol value macros
  2022-04-10 12:51 [PATCH 1/4] gdb: remove symbol value macros Simon Marchi
                   ` (2 preceding siblings ...)
  2022-04-10 12:51 ` [PATCH 4/4] gdb: remove MSYMBOL_TARGET_FLAG_{1,2} macros Simon Marchi
@ 2022-04-10 21:36 ` Tom Tromey
  2022-04-10 21:36 ` Tom Tromey
  4 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2022-04-10 21:36 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches; +Cc: Simon Marchi, Simon Marchi

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

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

Funnily enough I wrote an almost identical patch yesterday.
I think it looks great, and you pi

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

Simon> Replace them with equivalent methods on the appropriate objects.

Simon> Change-Id: Iafdab3b8eefc6dc2fd895aa955bf64fafc59ed50
Simon> ---
Simon>  gdb/ada-exp.y                       |   2 +-
Simon>  gdb/ada-lang.c                      |  18 ++--
Simon>  gdb/ada-tasks.c                     |   8 +-
Simon>  gdb/aix-thread.c                    |   4 +-
Simon>  gdb/alpha-mdebug-tdep.c             |   2 +-
Simon>  gdb/arc-linux-tdep.c                |   4 +-
Simon>  gdb/arm-tdep.c                      |   6 +-
Simon>  gdb/auxv.c                          |   2 +-
Simon>  gdb/avr-tdep.c                      |   2 +-
Simon>  gdb/ax-gdb.c                        |  12 +--
Simon>  gdb/blockframe.c                    |  14 +--
Simon>  gdb/breakpoint.c                    |  11 +--
Simon>  gdb/bsd-uthread.c                   |   2 +-
Simon>  gdb/buildsym.c                      |   2 +-
Simon>  gdb/c-exp.y                         |   6 +-
Simon>  gdb/c-valprint.c                    |   2 +-
Simon>  gdb/coff-pe-read.c                  |   2 +-
Simon>  gdb/coffread.c                      |  49 ++++------
Simon>  gdb/compile/compile-c-symbols.c     |  14 +--
Simon>  gdb/compile/compile-cplus-symbols.c |  14 +--
Simon>  gdb/compile/compile-cplus-types.c   |   4 +-
Simon>  gdb/compile/compile-object-load.c   |   4 +-
Simon>  gdb/compile/compile-object-run.c    |   2 +-
Simon>  gdb/cp-namespace.c                  |   2 +-
Simon>  gdb/ctfread.c                       |   2 +-
Simon>  gdb/dbxread.c                       |   8 +-
Simon>  gdb/dwarf2/loc.c                    |   6 +-
Simon>  gdb/dwarf2/read.c                   |  35 ++++---
Simon>  gdb/elfread.c                       |   4 +-
Simon>  gdb/f-valprint.c                    |   2 +-
Simon>  gdb/fbsd-tdep.c                     |   4 +-
Simon>  gdb/findvar.c                       |  27 +++---
Simon>  gdb/frame.c                         |   4 +-
Simon>  gdb/frv-tdep.c                      |   2 +-
Simon>  gdb/ft32-tdep.c                     |   2 +-
Simon>  gdb/glibc-tdep.c                    |   2 +-
Simon>  gdb/gnu-v3-abi.c                    |   4 +-
Simon>  gdb/hppa-tdep.c                     |   4 +-
Simon>  gdb/infcmd.c                        |   6 +-
Simon>  gdb/infrun.c                        |   2 +-
Simon>  gdb/inline-frame.c                  |   4 +-
Simon>  gdb/jit.c                           |  12 +--
Simon>  gdb/linespec.c                      |  14 +--
Simon>  gdb/linux-thread-db.c               |   2 +-
Simon>  gdb/m2-exp.y                        |   2 +-
Simon>  gdb/m32c-tdep.c                     |   8 +-
Simon>  gdb/m32r-tdep.c                     |   2 +-
Simon>  gdb/m68hc11-tdep.c                  |   2 +-
Simon>  gdb/machoread.c                     |   2 +-
Simon>  gdb/maint.c                         |   2 +-
Simon>  gdb/mdebugread.c                    |  32 +++----
Simon>  gdb/mi/mi-symbol-cmds.c             |   2 +-
Simon>  gdb/minsyms.c                       |  55 ++++++-----
Simon>  gdb/minsyms.h                       |   5 +
Simon>  gdb/mips-fbsd-tdep.c                |   2 +-
Simon>  gdb/mips-linux-tdep.c               |   2 +-
Simon>  gdb/mips-tdep.c                     |   8 +-
Simon>  gdb/netbsd-tdep.c                   |   2 +-
Simon>  gdb/objc-lang.c                     |   2 +-
Simon>  gdb/objfiles.c                      |   7 +-
Simon>  gdb/obsd-tdep.c                     |   2 +-
Simon>  gdb/p-exp.y                         |   4 +-
Simon>  gdb/p-valprint.c                    |   2 +-
Simon>  gdb/parse.c                         |   6 +-
Simon>  gdb/ppc-linux-tdep.c                |   6 +-
Simon>  gdb/ppc-sysv-tdep.c                 |   2 +-
Simon>  gdb/printcmd.c                      |  22 ++---
Simon>  gdb/proc-service.c                  |   2 +-
Simon>  gdb/psympriv.h                      |   6 +-
Simon>  gdb/psymtab.c                       |  12 +--
Simon>  gdb/ravenscar-thread.c              |   2 +-
Simon>  gdb/remote.c                        |   2 +-
Simon>  gdb/sol-thread.c                    |   2 +-
Simon>  gdb/sol2-tdep.c                     |   2 +-
Simon>  gdb/solib-dsbt.c                    |   2 +-
Simon>  gdb/solib-frv.c                     |   4 +-
Simon>  gdb/solib-svr4.c                    |  10 +-
Simon>  gdb/solib.c                         |   4 +-
Simon>  gdb/stabsread.c                     |  83 ++++++++---------
Simon>  gdb/stack.c                         |   6 +-
Simon>  gdb/symfile.c                       |   6 +-
Simon>  gdb/symmisc.c                       |  34 ++++---
Simon>  gdb/symtab.c                        |  61 +++++++-----
Simon>  gdb/symtab.h                        | 140 ++++++++++++++++++++--------
Simon>  gdb/tracepoint.c                    |  37 ++++----
Simon>  gdb/tui/tui-disasm.c                |   6 +-
Simon>  gdb/valops.c                        |   2 +-
Simon>  gdb/value.c                         |   6 +-
Simon>  gdb/xcoffread.c                     |   7 +-
Simon>  gdb/z80-tdep.c                      |  13 ++-
Simon>  90 files changed, 501 insertions(+), 461 deletions(-)

Simon> diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
Simon> index a2755d7501ed..60a7c1bf91f5 100644
Simon> --- a/gdb/ada-exp.y
Simon> +++ b/gdb/ada-exp.y
Simon> @@ -1382,7 +1382,7 @@ block_lookup (const struct block *context, const char *raw_name)
Simon>      {
Simon>        if (syms.size () > 1)
Simon>  	warning (_("Function name \"%s\" ambiguous here"), raw_name);
Simon> -      result = SYMBOL_BLOCK_VALUE (syms[0].symbol);
Simon> +      result = syms[0].symbol->value_block ();
Simon>      }
 
Simon>    return result;
Simon> diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
Simon> index d819038e63b6..29f2a4b255a9 100644
Simon> --- a/gdb/ada-lang.c
Simon> +++ b/gdb/ada-lang.c
Simon> @@ -819,7 +819,7 @@ ada_main_name (void)
 
Simon>    if (msym.minsym != NULL)
Simon>      {
Simon> -      CORE_ADDR main_program_name_addr = BMSYMBOL_VALUE_ADDRESS (msym);
Simon> +      CORE_ADDR main_program_name_addr = msym.value_address ();
Simon>        if (main_program_name_addr == 0)
Simon>  	error (_("Invalid address for Ada main program name."));
 
Simon> @@ -4825,7 +4825,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
Simon>  		  && startswith (name1 + len0, "___XV")));
Simon>        }
Simon>      case LOC_CONST:
Simon> -      return SYMBOL_VALUE (sym0) == SYMBOL_VALUE (sym1)
Simon> +      return sym0->value_longest () == sym1->value_longest ()
Simon>  	&& equiv_types (sym0->type (), sym1->type ());
 
Simon>      case LOC_STATIC:
Simon> @@ -4833,7 +4833,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
Simon>  	const char *name0 = sym0->linkage_name ();
Simon>  	const char *name1 = sym1->linkage_name ();
Simon>  	return (strcmp (name0, name1) == 0
Simon> -		&& SYMBOL_VALUE_ADDRESS (sym0) == SYMBOL_VALUE_ADDRESS (sym1));
Simon> +		&& sym0->value_address () == sym1->value_address ());
Simon>        }
 
Simon>      default:
Simon> @@ -5003,7 +5003,7 @@ symbols_are_identical_enums (const std::vector<struct block_symbol> &syms)
 
Simon>    /* Quick check: They should all have the same value.  */
Simon>    for (i = 1; i < syms.size (); i++)
Simon> -    if (SYMBOL_VALUE (syms[i].symbol) != SYMBOL_VALUE (syms[0].symbol))
Simon> +    if (syms[i].symbol->value_longest () != syms[0].symbol->value_longest ())
Simon>        return 0;
 
Simon>    /* Quick check: They should all have the same number of enumerals.  */
Simon> @@ -5077,8 +5077,8 @@ remove_extra_symbols (std::vector<struct block_symbol> *syms)
Simon>  			     (*syms)[j].symbol->linkage_name ()) == 0
Simon>  		  && ((*syms)[i].symbol->aclass ()
Simon>  		      == (*syms)[j].symbol->aclass ())
Simon> -		  && SYMBOL_VALUE_ADDRESS ((*syms)[i].symbol)
Simon> -		  == SYMBOL_VALUE_ADDRESS ((*syms)[j].symbol))
Simon> +		  && (*syms)[i].symbol->value_address ()
Simon> +		  == (*syms)[j].symbol->value_address ())
Simon>  		remove_p = 1;
Simon>  	    }
Simon>  	}
Simon> @@ -12987,7 +12987,7 @@ ada_add_standard_exceptions (compiled_regex *preg,
Simon>  	  if (msymbol.minsym != NULL)
Simon>  	    {
Simon>  	      struct ada_exc_info info
Simon> -		= {name, BMSYMBOL_VALUE_ADDRESS (msymbol)};
Simon> +		= {name, msymbol.value_address ()};
 
exceptions-> push_back (info);
Simon>  	    }
Simon> @@ -13029,7 +13029,7 @@ ada_add_exceptions_from_frame (compiled_regex *preg,
Simon>  	      if (ada_is_exception_sym (sym))
Simon>  		{
Simon>  		  struct ada_exc_info info = {sym->print_name (),
Simon> -					      SYMBOL_VALUE_ADDRESS (sym)};
Simon> +					      sym->value_address ()};
 
exceptions-> push_back (info);
Simon>  		}
Simon> @@ -13105,7 +13105,7 @@ ada_add_global_exceptions (compiled_regex *preg,
Simon>  		    && name_matches_regex (sym->natural_name (), preg))
Simon>  		  {
Simon>  		    struct ada_exc_info info
Simon> -		      = {sym->print_name (), SYMBOL_VALUE_ADDRESS (sym)};
Simon> +		      = {sym->print_name (), sym->value_address ()};
 
exceptions-> push_back (info);
Simon>  		  }
Simon> diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
Simon> index 5622772b013e..0043f2999d9d 100644
Simon> --- a/gdb/ada-tasks.c
Simon> +++ b/gdb/ada-tasks.c
Simon> @@ -574,7 +574,7 @@ ada_get_tcb_types_info (void)
Simon>    unsigned int first_id = 0;
Simon>    if (first_id_sym.minsym != nullptr)
Simon>      {
Simon> -      CORE_ADDR addr = BMSYMBOL_VALUE_ADDRESS (first_id_sym);
Simon> +      CORE_ADDR addr = first_id_sym.value_address ();
Simon>        /* This symbol always has type uint32_t.  */
Simon>        struct type *u32type = builtin_type (target_gdbarch ())->builtin_uint32;
Simon>        first_id = value_as_long (value_at (u32type, addr));
Simon> @@ -896,7 +896,7 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
Simon>    if (msym.minsym != NULL)
Simon>      {
data-> known_tasks_kind = ADA_TASKS_ARRAY;
Simon> -      data->known_tasks_addr = BMSYMBOL_VALUE_ADDRESS (msym);
Simon> +      data->known_tasks_addr = msym.value_address ();
 
Simon>        /* Try to get pointer type and array length from the symtab.  */
Simon>        sym = lookup_symbol_in_language (KNOWN_TASKS_NAME, NULL, VAR_DOMAIN,
Simon> @@ -942,12 +942,12 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
Simon>    if (msym.minsym != NULL)
Simon>      {
data-> known_tasks_kind = ADA_TASKS_LIST;
Simon> -      data->known_tasks_addr = BMSYMBOL_VALUE_ADDRESS (msym);
Simon> +      data->known_tasks_addr = msym.value_address ();
data-> known_tasks_length = 1;
 
Simon>        sym = lookup_symbol_in_language (KNOWN_TASKS_LIST, NULL, VAR_DOMAIN,
Simon>  				       language_c, NULL).symbol;
Simon> -      if (sym != NULL && SYMBOL_VALUE_ADDRESS (sym) != 0)
Simon> +      if (sym != NULL && sym->value_address () != 0)
Simon>  	{
Simon>  	  /* Validate.  */
Simon>  	  struct type *type = check_typedef (sym->type ());
Simon> diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
Simon> index 85be4c15f1c6..4e41cde66945 100644
Simon> --- a/gdb/aix-thread.c
Simon> +++ b/gdb/aix-thread.c
Simon> @@ -360,7 +360,7 @@ pdc_symbol_addrs (pthdb_user_t user, pthdb_symbol_t *symbols, int count)
Simon>  		gdb_printf (gdb_stdlog, " returning PDC_FAILURE\n");
Simon>  	      return PDC_FAILURE;
Simon>  	    }
Simon> -	  symbols[i].addr = BMSYMBOL_VALUE_ADDRESS (ms);
Simon> +	  symbols[i].addr = ms->value_address ();
Simon>  	}
Simon>        if (debug_aix_thread)
Simon>  	gdb_printf (gdb_stdlog, "  symbols[%d].addr = %s\n",
Simon> @@ -969,7 +969,7 @@ pd_enable (void)
Simon>    ms = lookup_minimal_symbol (stub_name, NULL, NULL);
Simon>    if (ms.minsym == NULL)
Simon>      return;
Simon> -  pd_brk_addr = BMSYMBOL_VALUE_ADDRESS (ms);
Simon> +  pd_brk_addr = ms->value_address ();
Simon>    if (!create_thread_event_breakpoint (target_gdbarch (), pd_brk_addr))
Simon>      return;
 
Simon> diff --git a/gdb/alpha-mdebug-tdep.c b/gdb/alpha-mdebug-tdep.c
Simon> index ec11bc45423e..a8b4bcbea4aa 100644
Simon> --- a/gdb/alpha-mdebug-tdep.c
Simon> +++ b/gdb/alpha-mdebug-tdep.c
Simon> @@ -114,7 +114,7 @@ find_proc_desc (CORE_ADDR pc)
 
Simon>    if (sym)
Simon>      {
Simon> -      proc_desc = (struct mdebug_extra_func_info *) SYMBOL_VALUE_BYTES (sym);
Simon> +      proc_desc = (struct mdebug_extra_func_info *) sym->value_bytes ();
 
Simon>        /* Correct incorrect setjmp procedure descriptor from the library
Simon>  	 to make backtrace through setjmp work.  */
Simon> diff --git a/gdb/arc-linux-tdep.c b/gdb/arc-linux-tdep.c
Simon> index 1744b7544cdc..13595f2e8e9b 100644
Simon> --- a/gdb/arc-linux-tdep.c
Simon> +++ b/gdb/arc-linux-tdep.c
Simon> @@ -509,7 +509,7 @@ arc_linux_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
Simon>      {
Simon>        if (resolver.minsym != nullptr)
Simon>  	{
Simon> -	  CORE_ADDR res_addr = BMSYMBOL_VALUE_ADDRESS (resolver);
Simon> +	  CORE_ADDR res_addr = resolver.value_address ();
Simon>  	  arc_linux_debug_printf ("pc = %s, resolver at %s",
Simon>  				  print_core_address (gdbarch, pc),
Simon>  				  print_core_address (gdbarch, res_addr));
Simon> @@ -519,7 +519,7 @@ arc_linux_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
Simon>  				print_core_address (gdbarch, pc));
Simon>      }
 
Simon> -  if (resolver.minsym != nullptr && BMSYMBOL_VALUE_ADDRESS (resolver) == pc)
Simon> +  if (resolver.minsym != nullptr && resolver.value_address () == pc)
Simon>      {
Simon>        /* Find the return address.  */
Simon>        return frame_unwind_caller_pc (get_current_frame ());
Simon> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
Simon> index fbc0a38bff3b..7002bcaa279f 100644
Simon> --- a/gdb/arm-tdep.c
Simon> +++ b/gdb/arm-tdep.c
Simon> @@ -600,7 +600,7 @@ skip_prologue_function (struct gdbarch *gdbarch, CORE_ADDR pc, int is_thumb)
 
Simon>    msym = lookup_minimal_symbol_by_pc (pc);
Simon>    if (msym.minsym != NULL
Simon> -      && BMSYMBOL_VALUE_ADDRESS (msym) == pc
Simon> +      && msym.value_address () == pc
Simon>        && msym.minsym->linkage_name () != NULL)
Simon>      {
Simon>        const char *name = msym.minsym->linkage_name ();
Simon> @@ -8521,7 +8521,7 @@ arm_skip_cmse_entry (CORE_ADDR pc, const char *name, struct objfile *objfile)
Simon>     = lookup_minimal_symbol (target_name, NULL, objfile);
 
Simon>    if (minsym.minsym != nullptr)
Simon> -    return BMSYMBOL_VALUE_ADDRESS (minsym);
Simon> +    return minsym.value_address ();
 
Simon>    return 0;
Simon>  }
Simon> @@ -8610,7 +8610,7 @@ arm_skip_stub (struct frame_info *frame, CORE_ADDR pc)
Simon>        objfile = (sec == NULL) ? NULL : sec->objfile;
Simon>        minsym = lookup_minimal_symbol (target_name, NULL, objfile);
Simon>        if (minsym.minsym != NULL)
Simon> -	return BMSYMBOL_VALUE_ADDRESS (minsym);
Simon> +	return minsym.value_address ();
Simon>        else
Simon>  	return 0;
Simon>      }
Simon> diff --git a/gdb/auxv.c b/gdb/auxv.c
Simon> index 840db0257af6..190cd69d6bd8 100644
Simon> --- a/gdb/auxv.c
Simon> +++ b/gdb/auxv.c
Simon> @@ -101,7 +101,7 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
Simon>       resides.  DATA_ADDRESS is the inferior value present in
Simon>       `_dl_auxv', therefore the real inferior AUXV address.  */
 
Simon> -  pointer_address = BMSYMBOL_VALUE_ADDRESS (msym);
Simon> +  pointer_address = msym.value_address ();
 
Simon>    /* The location of the _dl_auxv symbol may no longer be correct if
Simon>       ld.so runs at a different address than the one present in the
Simon> diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
Simon> index 310c8cf9ca2a..9e73c507b2eb 100644
Simon> --- a/gdb/avr-tdep.c
Simon> +++ b/gdb/avr-tdep.c
Simon> @@ -664,7 +664,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
 
Simon>        /* Resolve offset (in words) from __prologue_saves__ symbol.
Simon>  	 Which is a pushes count in `-mcall-prologues' mode */
Simon> -      num_pushes = AVR_MAX_PUSHES - (i - BMSYMBOL_VALUE_ADDRESS (msymbol)) / 2;
Simon> +      num_pushes = AVR_MAX_PUSHES - (i - msymbol.value_address ()) / 2;
 
Simon>        if (num_pushes > AVR_MAX_PUSHES)
Simon>  	{
Simon> diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
Simon> index be2063f23666..e2e311f9d74a 100644
Simon> --- a/gdb/ax-gdb.c
Simon> +++ b/gdb/ax-gdb.c
Simon> @@ -499,7 +499,7 @@ gen_offset (struct agent_expr *ax, int offset)
Simon>  static void
Simon>  gen_sym_offset (struct agent_expr *ax, struct symbol *var)
Simon>  {
Simon> -  gen_offset (ax, SYMBOL_VALUE (var));
Simon> +  gen_offset (ax, var->value_longest ());
Simon>  }
 
 
Simon> @@ -523,12 +523,12 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
Simon>    switch (var->aclass ())
Simon>      {
Simon>      case LOC_CONST:		/* A constant, like an enum value.  */
Simon> -      ax_const_l (ax, (LONGEST) SYMBOL_VALUE (var));
Simon> +      ax_const_l (ax, (LONGEST) var->value_longest ());
value-> kind = axs_rvalue;
Simon>        break;
 
Simon>      case LOC_LABEL:		/* A goto label, being used as a value.  */
Simon> -      ax_const_l (ax, (LONGEST) SYMBOL_VALUE_ADDRESS (var));
Simon> +      ax_const_l (ax, (LONGEST) var->value_address ());
value-> kind = axs_rvalue;
Simon>        break;
 
Simon> @@ -540,7 +540,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
Simon>        /* Variable at a fixed location in memory.  Easy.  */
Simon>      case LOC_STATIC:
Simon>        /* Push the address of the variable.  */
Simon> -      ax_const_l (ax, SYMBOL_VALUE_ADDRESS (var));
Simon> +      ax_const_l (ax, var->value_address ());
value-> kind = axs_lvalue_memory;
Simon>        break;
 
Simon> @@ -571,7 +571,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
Simon>        break;
 
Simon>      case LOC_BLOCK:
Simon> -      ax_const_l (ax, BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (var)));
Simon> +      ax_const_l (ax, BLOCK_ENTRY_PC (var->value_block ()));
value-> kind = axs_rvalue;
Simon>        break;
 
Simon> @@ -603,7 +603,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
Simon>  	  error (_("Couldn't resolve symbol `%s'."), var->print_name ());
 
Simon>  	/* Push the address of the variable.  */
Simon> -	ax_const_l (ax, BMSYMBOL_VALUE_ADDRESS (msym));
Simon> +	ax_const_l (ax, msym.value_address ());
value-> kind = axs_lvalue_memory;
Simon>        }
Simon>        break;
Simon> diff --git a/gdb/blockframe.c b/gdb/blockframe.c
Simon> index 50c464f44a24..df03901b6e79 100644
Simon> --- a/gdb/blockframe.c
Simon> +++ b/gdb/blockframe.c
Simon> @@ -95,7 +95,7 @@ get_pc_function_start (CORE_ADDR pc)
 
Simon>        if (symbol)
Simon>  	{
Simon> -	  bl = SYMBOL_BLOCK_VALUE (symbol);
Simon> +	  bl = symbol->value_block ();
Simon>  	  return BLOCK_ENTRY_PC (bl);
Simon>  	}
Simon>      }
Simon> @@ -103,7 +103,7 @@ get_pc_function_start (CORE_ADDR pc)
Simon>    msymbol = lookup_minimal_symbol_by_pc (pc);
Simon>    if (msymbol.minsym)
Simon>      {
Simon> -      CORE_ADDR fstart = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +      CORE_ADDR fstart = msymbol.value_address ();
 
Simon>        if (find_pc_section (fstart))
Simon>  	return fstart;
Simon> @@ -254,10 +254,10 @@ find_pc_partial_function_sym (CORE_ADDR pc,
Simon>        f = find_pc_sect_function (mapped_pc, section);
Simon>        if (f != NULL
Simon>  	  && (msymbol.minsym == NULL
Simon> -	      || (BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (f))
Simon> -		  >= BMSYMBOL_VALUE_ADDRESS (msymbol))))
Simon> +	      || (BLOCK_ENTRY_PC (f->value_block ())
Simon> +		  >= msymbol.value_address ())))
Simon>  	{
Simon> -	  const struct block *b = SYMBOL_BLOCK_VALUE (f);
Simon> +	  const struct block *b = f->value_block ();
 
Simon>  	  cache_pc_function_sym = f;
Simon>  	  cache_pc_function_section = section;
Simon> @@ -326,7 +326,7 @@ find_pc_partial_function_sym (CORE_ADDR pc,
Simon>        return false;
Simon>      }
 
Simon> -  cache_pc_function_low = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +  cache_pc_function_low = msymbol.value_address ();
Simon>    cache_pc_function_sym = msymbol.minsym;
Simon>    cache_pc_function_section = section;
Simon>    cache_pc_function_high = minimal_symbol_upper_bound (msymbol);
Simon> @@ -425,7 +425,7 @@ find_function_type (CORE_ADDR pc)
Simon>  {
Simon>    struct symbol *sym = find_pc_function (pc);
 
Simon> -  if (sym != NULL && BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)) == pc)
Simon> +  if (sym != NULL && BLOCK_ENTRY_PC (sym->value_block ()) == pc)
Simon>      return sym->type ();
 
Simon>    return NULL;
Simon> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
Simon> index b21d83d8019a..af7eb6cc1133 100644
Simon> --- a/gdb/breakpoint.c
Simon> +++ b/gdb/breakpoint.c
Simon> @@ -3256,7 +3256,7 @@ create_overlay_event_breakpoint (void)
bp_objfile_data-> overlay_msym = m;
Simon>  	}
 
Simon> -      addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym);
Simon> +      addr = bp_objfile_data->overlay_msym.value_address ();
Simon>        b = create_internal_breakpoint (objfile->arch (), addr,
Simon>  				      bp_overlay_event,
Simon>  				      &internal_breakpoint_ops);
Simon> @@ -3366,7 +3366,7 @@ create_longjmp_master_breakpoint_names (objfile *objfile)
bp_objfile_data-> longjmp_msym[i] = m;
Simon>  	}
 
Simon> -      addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->longjmp_msym[i]);
Simon> +      addr = bp_objfile_data->longjmp_msym[i].value_address ();
Simon>        b = create_internal_breakpoint (gdbarch, addr, bp_longjmp_master,
Simon>  				      &internal_breakpoint_ops);
Simon>        initialize_explicit_location (&explicit_loc);
Simon> @@ -3449,7 +3449,7 @@ create_std_terminate_master_breakpoint (void)
bp_objfile_data-> terminate_msym = m;
Simon>  	    }
 
Simon> -	  addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->terminate_msym);
Simon> +	  addr = bp_objfile_data->terminate_msym.value_address ();
Simon>  	  b = create_internal_breakpoint (objfile->arch (), addr,
Simon>  					  bp_std_terminate_master,
Simon>  					  &internal_breakpoint_ops);
Simon> @@ -3547,7 +3547,7 @@ create_exception_master_breakpoint_hook (objfile *objfile)
bp_objfile_data-> exception_msym = debug_hook;
Simon>      }
 
Simon> -  addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->exception_msym);
Simon> +  addr = bp_objfile_data->exception_msym.value_address ();
Simon>    addr = gdbarch_convert_from_func_ptr_addr
Simon>      (gdbarch, addr, current_inferior ()->top_target ());
Simon>    b = create_internal_breakpoint (gdbarch, addr, bp_exception_master,
Simon> @@ -4913,8 +4913,7 @@ watchpoint_check (bpstat *bs)
 
Simon>  	  function = get_frame_function (fr);
Simon>  	  if (function == NULL
Simon> -	      || !contained_in (b->exp_valid_block,
Simon> -				SYMBOL_BLOCK_VALUE (function)))
Simon> +	      || !contained_in (b->exp_valid_block, function->value_block ()))
Simon>  	    within_current_scope = 0;
Simon>  	}
 
Simon> diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
Simon> index d0d9e89e93c1..759b562cdd00 100644
Simon> --- a/gdb/bsd-uthread.c
Simon> +++ b/gdb/bsd-uthread.c
Simon> @@ -163,7 +163,7 @@ bsd_uthread_lookup_address (const char *name, struct objfile *objfile)
 
Simon>    sym = lookup_minimal_symbol (name, NULL, objfile);
Simon>    if (sym.minsym)
Simon> -    return BMSYMBOL_VALUE_ADDRESS (sym);
Simon> +    return sym.value_address ();
 
Simon>    return 0;
Simon>  }
Simon> diff --git a/gdb/buildsym.c b/gdb/buildsym.c
Simon> index 9a9d3cf74d9b..0df355151f45 100644
Simon> --- a/gdb/buildsym.c
Simon> +++ b/gdb/buildsym.c
Simon> @@ -251,7 +251,7 @@ buildsym_compunit::finish_block_internal
Simon>      {
Simon>        struct type *ftype = symbol->type ();
Simon>        struct mdict_iterator miter;
Simon> -      SYMBOL_BLOCK_VALUE (symbol) = block;
Simon> +      symbol->set_value_block (block);
Simon>        BLOCK_FUNCTION (block) = symbol;
 
Simon>        if (ftype->num_fields () <= 0)
Simon> diff --git a/gdb/c-exp.y b/gdb/c-exp.y
Simon> index 4ed661e587b1..4fa3f8d2fc48 100644
Simon> --- a/gdb/c-exp.y
Simon> +++ b/gdb/c-exp.y
Simon> @@ -1075,7 +1075,7 @@ exp     :       FALSEKEYWORD
Simon>  block	:	BLOCKNAME
Simon>  			{
Simon>  			  if ($1.sym.symbol)
Simon> -			    $$ = SYMBOL_BLOCK_VALUE ($1.sym.symbol);
Simon> +			    $$ = $1.sym.symbol->value_block ();
Simon>  			  else
Simon>  			    error (_("No file or function \"%s\"."),
Simon>  				   copy_name ($1.stoken).c_str ());
Simon> @@ -1096,7 +1096,7 @@ block	:	block COLONCOLON name
Simon>  			  if (!tem || tem->aclass () != LOC_BLOCK)
Simon>  			    error (_("No function \"%s\" in specified context."),
Simon>  				   copy.c_str ());
Simon> -			  $$ = SYMBOL_BLOCK_VALUE (tem); }
Simon> +			  $$ = tem->value_block (); }
Simon>  	;
 
Simon>  variable:	name_not_typename ENTRY
Simon> @@ -1239,7 +1239,7 @@ variable:	name_not_typename
Simon>  			      if (alias_target != NULL)
Simon>  				{
Simon>  				  block_symbol bsym { alias_target,
Simon> -				    SYMBOL_BLOCK_VALUE (alias_target) };
Simon> +				    alias_target->value_block () };
pstate-> push_new<var_value_operation> (bsym);
Simon>  				}
Simon>  			      else
Simon> diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
Simon> index 93e7cfd42542..bd445588ca08 100644
Simon> --- a/gdb/c-valprint.c
Simon> +++ b/gdb/c-valprint.c
Simon> @@ -182,7 +182,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
Simon>        /* If 'symbol_print' is set, we did the work above.  */
Simon>        if (!options->symbol_print
Simon>  	  && (msymbol.minsym != NULL)
Simon> -	  && (vt_address == BMSYMBOL_VALUE_ADDRESS (msymbol)))
Simon> +	  && (vt_address == msymbol.value_address ()))
Simon>  	{
Simon>  	  if (want_space)
Simon>  	    gdb_puts (" ", stream);
Simon> diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c
Simon> index 16c1e044794f..1f11606cdfff 100644
Simon> --- a/gdb/coff-pe-read.c
Simon> +++ b/gdb/coff-pe-read.c
Simon> @@ -244,7 +244,7 @@ add_pe_forwarded_sym (minimal_symbol_reader &reader,
Simon>  			      " \"%s\" in dll \"%s\", pointing to \"%s\"\n"),
Simon>  		sym_name, dll_name, forward_qualified_name);
 
Simon> -  vma = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +  vma = msymbol.value_address ();
Simon>    msymtype = MSYMBOL_TYPE (msymbol.minsym);
Simon>    section = msymbol.minsym->section_index ();
 
Simon> diff --git a/gdb/coffread.c b/gdb/coffread.c
Simon> index 253ba9c095f8..24dd9b960113 100644
Simon> --- a/gdb/coffread.c
Simon> +++ b/gdb/coffread.c
Simon> @@ -1026,7 +1026,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
 
Simon>  		sym = process_coff_symbol
Simon>  		  (cs, &main_aux, objfile);
Simon> -		SYMBOL_VALUE (sym) = tmpaddr + offset;
Simon> +		sym->set_value_longest (tmpaddr + offset);
sym-> set_section_index (sec);
Simon>  	      }
Simon>  	  }
Simon> @@ -1506,29 +1506,21 @@ patch_opaque_types (struct symtab *s)
Simon>  		  && strcmp (name + 1, sym->linkage_name () + 1) == 0)
Simon>  		{
Simon>  		  if (prev)
Simon> -		    {
Simon> -		      SYMBOL_VALUE_CHAIN (prev) = SYMBOL_VALUE_CHAIN (sym);
Simon> -		    }
Simon> +		    prev->set_value_chain (sym->value_chain ());
Simon>  		  else
Simon> -		    {
Simon> -		      opaque_type_chain[hash] = SYMBOL_VALUE_CHAIN (sym);
Simon> -		    }
Simon> +		    opaque_type_chain[hash] = sym->value_chain ();
 
Simon>  		  patch_type (sym->type (), real_sym->type ());
 
Simon>  		  if (prev)
Simon> -		    {
Simon> -		      sym = SYMBOL_VALUE_CHAIN (prev);
Simon> -		    }
Simon> +		    sym = prev->value_chain ();
Simon>  		  else
Simon> -		    {
Simon> -		      sym = opaque_type_chain[hash];
Simon> -		    }
Simon> +		    sym = opaque_type_chain[hash];
Simon>  		}
Simon>  	      else
Simon>  		{
Simon>  		  prev = sym;
Simon> -		  sym = SYMBOL_VALUE_CHAIN (sym);
Simon> +		  sym->set_value_chain (sym);
Simon>  		}
Simon>  	    }
Simon>  	}
Simon> @@ -1538,7 +1530,7 @@ patch_opaque_types (struct symtab *s)
Simon>  static int
Simon>  coff_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
Simon>  {
Simon> -  return gdbarch_sdb_reg_to_regnum (gdbarch, SYMBOL_VALUE (sym));
Simon> +  return gdbarch_sdb_reg_to_regnum (gdbarch, sym->value_longest ());
Simon>  }
 
Simon>  static const struct symbol_register_ops coff_register_funcs = {
Simon> @@ -1564,13 +1556,14 @@ process_coff_symbol (struct coff_symbol *cs,
sym-> compute_and_set_names (name, true, objfile->per_bfd);
 
Simon>    /* default assumptions */
Simon> -  SYMBOL_VALUE (sym) = cs->c_value;
Simon> +  sym->set_value_longest (cs->c_value);
sym-> set_domain (VAR_DOMAIN);
sym-> set_section_index (cs_to_section (cs, objfile));
 
Simon>    if (ISFCN (cs->c_type))
Simon>      {
Simon> -      SYMBOL_VALUE (sym) += objfile->text_section_offset ();
Simon> +      sym->set_value_longest
Simon> +	(sym->value_longest () + objfile->text_section_offset ());
sym-> set_type
Simon>  	(lookup_function_type (decode_function_type (cs, cs->c_type,
Simon>  						     aux, objfile)));
Simon> @@ -1600,9 +1593,8 @@ process_coff_symbol (struct coff_symbol *cs,
Simon>  	case C_THUMBEXTFUNC:
Simon>  	case C_EXT:
sym-> set_aclass_index (LOC_STATIC);
Simon> -	  SET_SYMBOL_VALUE_ADDRESS (sym,
Simon> -				    (CORE_ADDR) cs->c_value
Simon> -				    + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
Simon> +	  sym->set_value_address ((CORE_ADDR) cs->c_value
Simon> +				  + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
Simon>  	  add_symbol_to_list (sym, get_global_symbols ());
Simon>  	  break;
 
Simon> @@ -1610,9 +1602,8 @@ process_coff_symbol (struct coff_symbol *cs,
Simon>  	case C_THUMBSTATFUNC:
Simon>  	case C_STAT:
sym-> set_aclass_index (LOC_STATIC);
Simon> -	  SET_SYMBOL_VALUE_ADDRESS (sym,
Simon> -				    (CORE_ADDR) cs->c_value
Simon> -				    + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
Simon> +	  sym->set_value_address ((CORE_ADDR) cs->c_value
Simon> +				  + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
Simon>  	  if (within_function)
Simon>  	    {
Simon>  	      /* Static symbol of local scope.  */
Simon> @@ -1630,7 +1621,7 @@ process_coff_symbol (struct coff_symbol *cs,
Simon>  #endif
Simon>  	case C_REG:
sym-> set_aclass_index (coff_register_index);
Simon> -	  SYMBOL_VALUE (sym) = cs->c_value;
Simon> +	  sym->set_value_longest (cs->c_value);
Simon>  	  add_symbol_to_list (sym, get_local_symbols ());
Simon>  	  break;
 
Simon> @@ -1647,7 +1638,7 @@ process_coff_symbol (struct coff_symbol *cs,
Simon>  	case C_REGPARM:
sym-> set_aclass_index (coff_register_index);
sym-> set_is_argument (1);
Simon> -	  SYMBOL_VALUE (sym) = cs->c_value;
Simon> +	  sym->set_value_longest (cs->c_value);
Simon>  	  add_symbol_to_list (sym, get_local_symbols ());
Simon>  	  break;
 
Simon> @@ -1698,7 +1689,7 @@ process_coff_symbol (struct coff_symbol *cs,
Simon>  	    {
Simon>  	      int i = hashname (sym->linkage_name ());
 
Simon> -	      SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i];
Simon> +	      sym->set_value_chain (opaque_type_chain[i]);
Simon>  	      opaque_type_chain[i] = sym;
Simon>  	    }
Simon>  	  add_symbol_to_list (sym, get_file_symbols ());
Simon> @@ -2100,7 +2091,7 @@ coff_read_enum_type (int index, int length, int lastsym,
sym-> set_linkage_name (name);
sym-> set_aclass_index (LOC_CONST);
sym-> set_domain (VAR_DOMAIN);
Simon> -	  SYMBOL_VALUE (sym) = ms->c_value;
Simon> +	  sym->set_value_longest (ms->c_value);
Simon>  	  add_symbol_to_list (sym, symlist);
Simon>  	  nsyms++;
Simon>  	  break;
Simon> @@ -2145,8 +2136,8 @@ coff_read_enum_type (int index, int length, int lastsym,
 
xsym-> set_type (type);
type-> field (n).set_name (xsym->linkage_name ());
Simon> -	  type->field (n).set_loc_enumval (SYMBOL_VALUE (xsym));
Simon> -	  if (SYMBOL_VALUE (xsym) < 0)
Simon> +	  type->field (n).set_loc_enumval (xsym->value_longest ());
Simon> +	  if (xsym->value_longest () < 0)
Simon>  	    unsigned_enum = 0;
Simon>  	  TYPE_FIELD_BITSIZE (type, n) = 0;
Simon>  	}
Simon> diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c
Simon> index d422c466b5f5..a50e84d117ac 100644
Simon> --- a/gdb/compile/compile-c-symbols.c
Simon> +++ b/gdb/compile/compile-c-symbols.c
Simon> @@ -88,12 +88,12 @@ convert_one_symbol (compile_c_instance *context,
 
Simon>  	case LOC_LABEL:
Simon>  	  kind = GCC_C_SYMBOL_LABEL;
Simon> -	  addr = SYMBOL_VALUE_ADDRESS (sym.symbol);
Simon> +	  addr = sym.symbol->value_address ();
Simon>  	  break;
 
Simon>  	case LOC_BLOCK:
Simon>  	  kind = GCC_C_SYMBOL_FUNCTION;
Simon> -	  addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym.symbol));
Simon> +	  addr = BLOCK_ENTRY_PC (sym.symbol->value_block ());
Simon>  	  if (is_global && sym.symbol->type ()->is_gnu_ifunc ())
Simon>  	    addr = gnu_ifunc_resolve_addr (target_gdbarch (), addr);
Simon>  	  break;
Simon> @@ -106,7 +106,7 @@ convert_one_symbol (compile_c_instance *context,
Simon>  	    }
context-> plugin ().build_constant
Simon>  	    (sym_type, sym.symbol->natural_name (),
Simon> -	     SYMBOL_VALUE (sym.symbol),
Simon> +	     sym.symbol->value_longest (),
Simon>  	     filename, line);
Simon>  	  return;
 
Simon> @@ -179,7 +179,7 @@ convert_one_symbol (compile_c_instance *context,
 
Simon>  	case LOC_STATIC:
Simon>  	  kind = GCC_C_SYMBOL_VARIABLE;
Simon> -	  addr = SYMBOL_VALUE_ADDRESS (sym.symbol);
Simon> +	  addr = sym.symbol->value_address ();
Simon>  	  break;
 
Simon>  	case LOC_FINAL_VALUE:
Simon> @@ -270,7 +270,7 @@ convert_symbol_bmsym (compile_c_instance *context,
Simon>    gcc_decl decl;
Simon>    CORE_ADDR addr;
 
Simon> -  addr = MSYMBOL_VALUE_ADDRESS (objfile, msym);
Simon> +  addr = msym->value_address (objfile);
 
Simon>    /* Conversion copied from write_exp_msymbol.  */
Simon>    switch (MSYMBOL_TYPE (msym))
Simon> @@ -404,7 +404,7 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
Simon>  	    gdb_printf (gdb_stdlog,
Simon>  			"gcc_symbol_address \"%s\": full symbol\n",
Simon>  			identifier);
Simon> -	  result = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym));
Simon> +	  result = BLOCK_ENTRY_PC (sym->value_block ());
Simon>  	  if (sym->type ()->is_gnu_ifunc ())
Simon>  	    result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
Simon>  	  found = 1;
Simon> @@ -421,7 +421,7 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
Simon>  			    "gcc_symbol_address \"%s\": minimal "
Simon>  			    "symbol\n",
Simon>  			    identifier);
Simon> -	      result = BMSYMBOL_VALUE_ADDRESS (msym);
Simon> +	      result = msym.value_address ();
Simon>  	      if (MSYMBOL_TYPE (msym.minsym) == mst_text_gnu_ifunc)
Simon>  		result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
Simon>  	      found = 1;
Simon> diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplus-symbols.c
Simon> index 3657c8453e10..b68184c55f96 100644
Simon> --- a/gdb/compile/compile-cplus-symbols.c
Simon> +++ b/gdb/compile/compile-cplus-symbols.c
Simon> @@ -81,13 +81,13 @@ convert_one_symbol (compile_cplus_instance *instance,
 
Simon>  	case LOC_LABEL:
Simon>  	  kind = GCC_CP_SYMBOL_LABEL;
Simon> -	  addr = SYMBOL_VALUE_ADDRESS (sym.symbol);
Simon> +	  addr = sym.symbol->value_address ();
Simon>  	  break;
 
Simon>  	case LOC_BLOCK:
Simon>  	  {
Simon>  	    kind = GCC_CP_SYMBOL_FUNCTION;
Simon> -	    addr = BLOCK_START (SYMBOL_BLOCK_VALUE (sym.symbol));
Simon> +	    addr = BLOCK_START (sym.symbol->value_block ());
Simon>  	    if (is_global && sym.symbol->type ()->is_gnu_ifunc ())
Simon>  	      addr = gnu_ifunc_resolve_addr (target_gdbarch (), addr);
Simon>  	  }
Simon> @@ -101,7 +101,7 @@ convert_one_symbol (compile_cplus_instance *instance,
Simon>  	    }
instance-> plugin ().build_constant
Simon>  	    (sym_type, sym.symbol->natural_name (),
Simon> -	     SYMBOL_VALUE (sym.symbol), filename, line);
Simon> +	     sym.symbol->value_longest (), filename, line);
Simon>  	  return;
 
Simon>  	case LOC_CONST_BYTES:
Simon> @@ -173,7 +173,7 @@ convert_one_symbol (compile_cplus_instance *instance,
 
Simon>  	case LOC_STATIC:
Simon>  	  kind = GCC_CP_SYMBOL_VARIABLE;
Simon> -	  addr = SYMBOL_VALUE_ADDRESS (sym.symbol);
Simon> +	  addr = sym.symbol->value_address ();
Simon>  	  break;
 
Simon>  	case LOC_FINAL_VALUE:
Simon> @@ -281,7 +281,7 @@ convert_symbol_bmsym (compile_cplus_instance *instance,
Simon>    gcc_type sym_type;
Simon>    CORE_ADDR addr;
 
Simon> -  addr = MSYMBOL_VALUE_ADDRESS (objfile, msym);
Simon> +  addr = msym->value_address (objfile);
 
Simon>    /* Conversion copied from write_exp_msymbol.  */
Simon>    switch (MSYMBOL_TYPE (msym))
Simon> @@ -441,7 +441,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
Simon>  	    gdb_printf (gdb_stdlog,
Simon>  			"gcc_symbol_address \"%s\": full symbol\n",
Simon>  			identifier);
Simon> -	  result = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
Simon> +	  result = BLOCK_START (sym->value_block ());
Simon>  	  if (sym->type ()->is_gnu_ifunc ())
Simon>  	    result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
Simon>  	  found = 1;
Simon> @@ -458,7 +458,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
Simon>  			    "gcc_symbol_address \"%s\": minimal "
Simon>  			    "symbol\n",
Simon>  			    identifier);
Simon> -	      result = BMSYMBOL_VALUE_ADDRESS (msym);
Simon> +	      result = msym.value_address ();
Simon>  	      if (MSYMBOL_TYPE (msym.minsym) == mst_text_gnu_ifunc)
Simon>  		result = gnu_ifunc_resolve_addr (target_gdbarch (), result);
Simon>  	      found = 1;
Simon> diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c
Simon> index 616f2c23980f..cea30304aa24 100644
Simon> --- a/gdb/compile/compile-cplus-types.c
Simon> +++ b/gdb/compile/compile-cplus-types.c
Simon> @@ -628,7 +628,7 @@ compile_cplus_convert_struct_or_union_members
Simon>  		const char *filename = symbol_symtab (sym.symbol)->filename;
Simon>  		unsigned int line = sym.symbol->line ();
 
Simon> -		physaddr = SYMBOL_VALUE_ADDRESS (sym.symbol);
Simon> +		physaddr = sym.symbol->value_address ();
instance-> plugin ().build_decl
Simon>  		  ("field physname", field_name,
Simon>  		   (GCC_CP_SYMBOL_VARIABLE| get_field_access_flag (type, i)),
Simon> @@ -766,7 +766,7 @@ compile_cplus_convert_struct_or_union_methods (compile_cplus_instance *instance,
 
Simon>  	  const char *filename = symbol_symtab (sym.symbol)->filename;
Simon>  	  unsigned int line = sym.symbol->line ();
Simon> -	  CORE_ADDR address = BLOCK_START (SYMBOL_BLOCK_VALUE (sym.symbol));
Simon> +	  CORE_ADDR address = BLOCK_START (sym.symbol->value_block ());
Simon>  	  const char *kind;
 
Simon>  	  if (TYPE_FN_FIELD_STATIC_P (methods, j))
Simon> diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
Simon> index 7364a4ae8b24..bfb40c9625cd 100644
Simon> --- a/gdb/compile/compile-object-load.c
Simon> +++ b/gdb/compile/compile-object-load.c
Simon> @@ -771,7 +771,7 @@ compile_object_load (const compile_file_names &file_names,
Simon>  	case mst_text:
Simon>  	case mst_bss:
Simon>  	case mst_data:
Simon> -	  sym->value = BMSYMBOL_VALUE_ADDRESS (bmsym);
Simon> +	  sym->value = bmsym.value_address ();
Simon>  	  if (compile_debug)
Simon>  	    gdb_printf (gdb_stdlog,
Simon>  			"ELF mst_text symbol \"%s\" relocated to %s\n",
Simon> @@ -780,7 +780,7 @@ compile_object_load (const compile_file_names &file_names,
Simon>  	  break;
Simon>  	case mst_text_gnu_ifunc:
sym-> value = gnu_ifunc_resolve_addr (target_gdbarch (),
Simon> -					       BMSYMBOL_VALUE_ADDRESS (bmsym));
Simon> +					       bmsym.value_address ());
Simon>  	  if (compile_debug)
Simon>  	    gdb_printf (gdb_stdlog,
Simon>  			"ELF mst_text_gnu_ifunc symbol \"%s\" "
Simon> diff --git a/gdb/compile/compile-object-run.c b/gdb/compile/compile-object-run.c
Simon> index bce0f82a1ee2..d5742a5880de 100644
Simon> --- a/gdb/compile/compile-object-run.c
Simon> +++ b/gdb/compile/compile-object-run.c
Simon> @@ -145,7 +145,7 @@ compile_object_run (compile_module_up &&module)
 
Simon>        gdb_assert (func_type->code () == TYPE_CODE_FUNC);
Simon>        func_val = value_from_pointer (lookup_pointer_type (func_type),
Simon> -				   BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (func_sym)));
Simon> +				   BLOCK_ENTRY_PC (func_sym->value_block ()));
 
Simon>        vargs = XALLOCAVEC (struct value *, func_type->num_fields ());
Simon>        if (func_type->num_fields () >= 1)
Simon> diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
Simon> index 3ac19fa001dd..b0fa33705ee1 100644
Simon> --- a/gdb/cp-namespace.c
Simon> +++ b/gdb/cp-namespace.c
Simon> @@ -281,7 +281,7 @@ cp_search_static_and_baseclasses (const char *name,
Simon>    if ((scope_type->code () == TYPE_CODE_FUNC
Simon>         || scope_type->code () == TYPE_CODE_METHOD)
Simon>        && domain == VAR_DOMAIN)
Simon> -    return lookup_symbol (nested, SYMBOL_BLOCK_VALUE (scope_sym.symbol),
Simon> +    return lookup_symbol (nested, scope_sym.symbol->value_block (),
Simon>  			  VAR_DOMAIN, NULL);
 
Simon>    /* Look for a symbol named NESTED in this class/namespace.
Simon> diff --git a/gdb/ctfread.c b/gdb/ctfread.c
Simon> index 87147a16bdf4..828f300d29d5 100644
Simon> --- a/gdb/ctfread.c
Simon> +++ b/gdb/ctfread.c
Simon> @@ -329,7 +329,7 @@ set_symbol_address (struct objfile *of, struct symbol *sym, const char *name)
Simon>    msym = lookup_minimal_symbol (name, nullptr, of);
Simon>    if (msym.minsym != NULL)
Simon>      {
Simon> -      SET_SYMBOL_VALUE_ADDRESS (sym, BMSYMBOL_VALUE_ADDRESS (msym));
Simon> +      sym->set_value_address (msym.value_address ());
sym-> set_aclass_index (LOC_STATIC);
sym-> set_section_index (msym.minsym->section_index ());
Simon>      }
Simon> diff --git a/gdb/dbxread.c b/gdb/dbxread.c
Simon> index 49bcebd2a815..a536a087c7f3 100644
Simon> --- a/gdb/dbxread.c
Simon> +++ b/gdb/dbxread.c
Simon> @@ -1655,7 +1655,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
Simon>  					  pst ? pst->filename : NULL,
Simon>  					  objfile);
Simon>  		  if (minsym.minsym != NULL)
Simon> -		    nlist.n_value = MSYMBOL_VALUE_RAW_ADDRESS (minsym.minsym);
Simon> +		    nlist.n_value = minsym.minsym->value_raw_address ();
Simon>  		}
Simon>  	      if (pst && textlow_not_set
Simon>  		  && gdbarch_sofun_address_maybe_missing (gdbarch))
Simon> @@ -1711,7 +1711,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
Simon>  					  pst ? pst->filename : NULL,
Simon>  					  objfile);
Simon>  		  if (minsym.minsym != NULL)
Simon> -		    nlist.n_value = MSYMBOL_VALUE_RAW_ADDRESS (minsym.minsym);
Simon> +		    nlist.n_value = minsym.minsym->value_raw_address ();
Simon>  		}
Simon>  	      if (pst && textlow_not_set
Simon>  		  && gdbarch_sofun_address_maybe_missing (gdbarch))
Simon> @@ -2024,7 +2024,7 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
Simon>  	}
 
Simon>        if (minsym.minsym)
Simon> -	pst->set_text_high (MSYMBOL_VALUE_RAW_ADDRESS (minsym.minsym)
Simon> +	pst->set_text_high (minsym.minsym->value_raw_address ()
Simon>  			    + MSYMBOL_SIZE (minsym.minsym));
 
Simon>        last_function_name = NULL;
Simon> @@ -2791,7 +2791,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
Simon>  		    = find_stab_function (name, get_last_source_file (),
Simon>  					  objfile);
Simon>  		  if (minsym.minsym != NULL)
Simon> -		    valu = BMSYMBOL_VALUE_ADDRESS (minsym);
Simon> +		    valu = minsym.value_address ();
Simon>  		}
 
Simon>  	      /* These addresses are absolute.  */
Simon> diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
Simon> index bb9778d9edde..ea45475810ec 100644
Simon> --- a/gdb/dwarf2/loc.c
Simon> +++ b/gdb/dwarf2/loc.c
Simon> @@ -453,7 +453,7 @@ dwarf2_find_location_expression (struct dwarf2_loclist_baton *baton,
Simon>  	  if (pc_block)
Simon>  	    pc_func = block_linkage_function (pc_block);
 
Simon> -	  if (pc_func && pc == BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (pc_func)))
Simon> +	  if (pc_func && pc == BLOCK_ENTRY_PC (pc_func->value_block ()))
Simon>  	    {
Simon>  	      *locexpr_length = length;
Simon>  	      return loc_ptr;
Simon> @@ -711,7 +711,7 @@ call_site_target::iterate_over_addresses
Simon>  			  : msym.minsym->print_name ()));
 			
Simon>  	  }
Simon> -	callback (BMSYMBOL_VALUE_ADDRESS (msym));
Simon> +	callback (msym.value_address ());
Simon>        }
Simon>        break;
 
Simon> @@ -753,7 +753,7 @@ func_addr_to_tail_call_list (struct gdbarch *gdbarch, CORE_ADDR addr)
Simon>    struct symbol *sym = find_pc_function (addr);
Simon>    struct type *type;
 
Simon> -  if (sym == NULL || BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)) != addr)
Simon> +  if (sym == NULL || BLOCK_ENTRY_PC (sym->value_block ()) != addr)
Simon>      throw_error (NO_ENTRY_VALUE_ERROR,
Simon>  		 _("DW_TAG_call_site resolving failed to find function "
Simon>  		   "name for address %s"),
Simon> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
Simon> index d8268de8031c..ac5408f25734 100644
Simon> --- a/gdb/dwarf2/read.c
Simon> +++ b/gdb/dwarf2/read.c
Simon> @@ -7951,7 +7951,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
Simon>        psymbol.domain = VAR_DOMAIN;
Simon>        psymbol.aclass = LOC_BLOCK;
Simon>        psymbol.ginfo.set_section_index (SECT_OFF_TEXT (objfile));
Simon> -      psymbol.ginfo.value.address = addr;
Simon> +      psymbol.ginfo.set_value_address (addr);
 
Simon>        if (pdi->main_subprogram && actual_name != NULL)
Simon>  	set_objfile_main_name (objfile, actual_name, cu->per_cu->lang);
Simon> @@ -7996,7 +7996,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
Simon>  	      psymbol.domain = VAR_DOMAIN;
Simon>  	      psymbol.aclass = LOC_STATIC;
Simon>  	      psymbol.ginfo.set_section_index (SECT_OFF_TEXT (objfile));
Simon> -	      psymbol.ginfo.value.address = addr;
Simon> +	      psymbol.ginfo.set_value_address (addr);
Simon>  	      where = psymbol_placement::GLOBAL;
Simon>  	    }
Simon>  	}
Simon> @@ -8013,7 +8013,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
Simon>  	  psymbol.aclass = LOC_STATIC;
Simon>  	  psymbol.ginfo.set_section_index (SECT_OFF_TEXT (objfile));
Simon>  	  if (has_loc)
Simon> -	    psymbol.ginfo.value.address = addr;
Simon> +	    psymbol.ginfo.set_value_address (addr);
Simon>  	  where = psymbol_placement::STATIC;
Simon>  	}
Simon>        break;
Simon> @@ -17025,7 +17025,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
Simon>  	}
 
Simon>        sym = new_symbol (die, objfile_type (objfile)->builtin_void, cu);
Simon> -      SYMBOL_VALUE_COMMON_BLOCK (sym) = common_block;
Simon> +      sym->set_value_common_block (common_block);
Simon>      }
Simon>  }
 
Simon> @@ -21706,19 +21706,16 @@ var_decode_location (struct attribute *attr, struct symbol *sym,
Simon>  	  unsigned int dummy;
 
Simon>  	  if (block->data[0] == DW_OP_addr)
Simon> -	    SET_SYMBOL_VALUE_ADDRESS
Simon> -	      (sym, cu->header.read_address (objfile->obfd,
Simon> -					     block->data + 1,
Simon> -					     &dummy));
Simon> +	    sym->set_value_address
Simon> +	      (cu->header.read_address (objfile->obfd, block->data + 1,
Simon> +					&dummy));
Simon>  	  else
Simon> -	    SET_SYMBOL_VALUE_ADDRESS
Simon> -	      (sym, read_addr_index_from_leb128 (cu, block->data + 1,
Simon> -						 &dummy));
Simon> +	    sym->set_value_address
Simon> +	      (read_addr_index_from_leb128 (cu, block->data + 1, &dummy));
sym-> set_aclass_index (LOC_STATIC);
Simon>  	  fixup_symbol_section (sym, objfile);
Simon> -	  SET_SYMBOL_VALUE_ADDRESS
Simon> -	    (sym,
Simon> -	     SYMBOL_VALUE_ADDRESS (sym)
Simon> +	  sym->set_value_address
Simon> +	    (sym->value_address ()
Simon>  	     + objfile->section_offsets[sym->section_index ()]);
Simon>  	  return;
Simon>  	}
Simon> @@ -21841,7 +21838,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
 
Simon>  	      addr = attr->as_address ();
Simon>  	      addr = gdbarch_adjust_dwarf2_addr (gdbarch, addr + baseaddr);
Simon> -	      SET_SYMBOL_VALUE_ADDRESS (sym, addr);
Simon> +	      sym->set_value_address (addr);
sym-> set_aclass_index (LOC_LABEL);
Simon>  	    }
Simon>  	  else
Simon> @@ -21927,7 +21924,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
Simon>  		attr2 = NULL;
 
Simon>  	      if (sym->aclass () == LOC_STATIC
Simon> -		  && SYMBOL_VALUE_ADDRESS (sym) == 0
Simon> +		  && sym->value_address () == 0
Simon>  		  && !per_objfile->per_bfd->has_section_at_zero)
Simon>  		{
Simon>  		  /* When a static variable is eliminated by the linker,
Simon> @@ -22332,13 +22329,13 @@ dwarf2_const_value (const struct attribute *attr, struct symbol *sym,
sym-> set_aclass_index (dwarf2_locexpr_index);
Simon>      }
Simon>    else if (bytes != NULL)
Simon> -     {
Simon> -      SYMBOL_VALUE_BYTES (sym) = bytes;
Simon> +    {
Simon> +      sym->set_value_bytes (bytes);
sym-> set_aclass_index (LOC_CONST_BYTES);
Simon>      }
Simon>    else
Simon>      {
Simon> -      SYMBOL_VALUE (sym) = value;
Simon> +      sym->set_value_longest (value);
sym-> set_aclass_index (LOC_CONST);
Simon>      }
Simon>  }
Simon> diff --git a/gdb/elfread.c b/gdb/elfread.c
Simon> index fb40032c5051..3f1f87650f21 100644
Simon> --- a/gdb/elfread.c
Simon> +++ b/gdb/elfread.c
Simon> @@ -703,7 +703,7 @@ elf_gnu_ifunc_record_cache (const char *name, CORE_ADDR addr)
Simon>    msym = lookup_minimal_symbol_by_pc (addr);
Simon>    if (msym.minsym == NULL)
Simon>      return 0;
Simon> -  if (BMSYMBOL_VALUE_ADDRESS (msym) != addr)
Simon> +  if (msym.value_address () != addr)
Simon>      return 0;
Simon>    objfile = msym.objfile;
 
Simon> @@ -830,7 +830,7 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p)
Simon>  	continue;
Simon>        if (MSYMBOL_TYPE (msym.minsym) != mst_slot_got_plt)
Simon>  	continue;
Simon> -      pointer_address = BMSYMBOL_VALUE_ADDRESS (msym);
Simon> +      pointer_address = msym.value_address ();
 
Simon>        plt = bfd_get_section_by_name (obfd, ".plt");
Simon>        if (plt == NULL)
Simon> diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
Simon> index aea01bb7dbc1..4f95b224d732 100644
Simon> --- a/gdb/f-valprint.c
Simon> +++ b/gdb/f-valprint.c
Simon> @@ -611,7 +611,7 @@ info_common_command_for_block (const struct block *block, const char *comname,
Simon>    ALL_BLOCK_SYMBOLS (block, iter, sym)
Simon>      if (sym->domain () == COMMON_BLOCK_DOMAIN)
Simon>        {
Simon> -	const struct common_block *common = SYMBOL_VALUE_COMMON_BLOCK (sym);
Simon> +	const struct common_block *common = sym->value_common_block ();
Simon>  	size_t index;
 
Simon>  	gdb_assert (sym->aclass () == LOC_COMMON_BLOCK);
Simon> diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
Simon> index 1b7e36ef8cc7..b241e855bd6f 100644
Simon> --- a/gdb/fbsd-tdep.c
Simon> +++ b/gdb/fbsd-tdep.c
Simon> @@ -1939,7 +1939,7 @@ fbsd_read_integer_by_name (struct gdbarch *gdbarch, const char *name)
Simon>      error (_("Unable to resolve symbol '%s'"), name);
 
Simon>    gdb_byte buf[4];
Simon> -  if (target_read_memory (BMSYMBOL_VALUE_ADDRESS (ms), buf, sizeof buf) != 0)
Simon> +  if (target_read_memory (ms.value_address (), buf, sizeof buf) != 0)
Simon>      error (_("Unable to read value of '%s'"), name);
 
Simon>    return extract_signed_integer (buf, gdbarch_byte_order (gdbarch));
Simon> @@ -2048,7 +2048,7 @@ CORE_ADDR
Simon>  fbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
Simon>  {
Simon>    struct bound_minimal_symbol msym = lookup_bound_minimal_symbol ("_rtld_bind");
Simon> -  if (msym.minsym != nullptr && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
Simon> +  if (msym.minsym != nullptr && msym.value_address () == pc)
Simon>      return frame_unwind_caller_pc (get_current_frame ());
 
Simon>    return 0;
Simon> diff --git a/gdb/findvar.c b/gdb/findvar.c
Simon> index 6660b0067957..ec21c82532b9 100644
Simon> --- a/gdb/findvar.c
Simon> +++ b/gdb/findvar.c
Simon> @@ -627,8 +627,7 @@ language_defn::read_var_value (struct symbol *var,
Simon>        /* Put the constant back in target format. */
Simon>        v = allocate_value (type);
Simon>        store_signed_integer (value_contents_raw (v).data (), TYPE_LENGTH (type),
Simon> -			    type_byte_order (type),
Simon> -			    (LONGEST) SYMBOL_VALUE (var));
Simon> +			    type_byte_order (type), var->value_longest ());
Simon>        VALUE_LVAL (v) = not_lval;
Simon>        return v;
 
Simon> @@ -638,13 +637,13 @@ language_defn::read_var_value (struct symbol *var,
Simon>        if (overlay_debugging)
Simon>  	{
Simon>  	  struct objfile *var_objfile = symbol_objfile (var);
Simon> -	  addr = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
Simon> +	  addr = symbol_overlayed_address (var->value_address (),
var-> obj_section (var_objfile));
Simon>  	  store_typed_address (value_contents_raw (v).data (), type, addr);
Simon>  	}
Simon>        else
Simon>  	store_typed_address (value_contents_raw (v).data (), type,
Simon> -			      SYMBOL_VALUE_ADDRESS (var));
Simon> +			      var->value_address ());
Simon>        VALUE_LVAL (v) = not_lval;
Simon>        return v;
 
Simon> @@ -655,7 +654,7 @@ language_defn::read_var_value (struct symbol *var,
Simon>  	  type = resolve_dynamic_type (type, {}, /* Unused address.  */ 0);
Simon>  	}
Simon>        v = allocate_value (type);
Simon> -      memcpy (value_contents_raw (v).data (), SYMBOL_VALUE_BYTES (var),
Simon> +      memcpy (value_contents_raw (v).data (), var->value_bytes (),
Simon>  	      TYPE_LENGTH (type));
Simon>        VALUE_LVAL (v) = not_lval;
Simon>        return v;
Simon> @@ -663,10 +662,10 @@ language_defn::read_var_value (struct symbol *var,
Simon>      case LOC_STATIC:
Simon>        if (overlay_debugging)
Simon>  	addr
Simon> -	  = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
Simon> +	  = symbol_overlayed_address (var->value_address (),
var-> obj_section (symbol_objfile (var)));
Simon>        else
Simon> -	addr = SYMBOL_VALUE_ADDRESS (var);
Simon> +	addr = var->value_address ();
Simon>        break;
 
Simon>      case LOC_ARG:
Simon> @@ -674,7 +673,7 @@ language_defn::read_var_value (struct symbol *var,
Simon>        if (!addr)
Simon>  	error (_("Unknown argument list address for `%s'."),
var-> print_name ());
Simon> -      addr += SYMBOL_VALUE (var);
Simon> +      addr += var->value_longest ();
Simon>        break;
 
Simon>      case LOC_REF_ARG:
Simon> @@ -686,7 +685,7 @@ language_defn::read_var_value (struct symbol *var,
Simon>  	if (!argref)
Simon>  	  error (_("Unknown argument list address for `%s'."),
var-> print_name ());
Simon> -	argref += SYMBOL_VALUE (var);
Simon> +	argref += var->value_longest ();
Simon>  	ref = value_at (lookup_pointer_type (type), argref);
Simon>  	addr = value_as_address (ref);
Simon>  	break;
Simon> @@ -694,7 +693,7 @@ language_defn::read_var_value (struct symbol *var,
 
Simon>      case LOC_LOCAL:
Simon>        addr = get_frame_locals_address (frame);
Simon> -      addr += SYMBOL_VALUE (var);
Simon> +      addr += var->value_longest ();
Simon>        break;
 
Simon>      case LOC_TYPEDEF:
Simon> @@ -705,10 +704,10 @@ language_defn::read_var_value (struct symbol *var,
Simon>      case LOC_BLOCK:
Simon>        if (overlay_debugging)
Simon>  	addr = symbol_overlayed_address
Simon> -	  (BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (var)),
Simon> +	  (BLOCK_ENTRY_PC (var->value_block ()),
var-> obj_section (symbol_objfile (var)));
Simon>        else
Simon> -	addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (var));
Simon> +	addr = BLOCK_ENTRY_PC (var->value_block ());
Simon>        break;
 
Simon>      case LOC_REGISTER:
Simon> @@ -778,9 +777,9 @@ language_defn::read_var_value (struct symbol *var,
Simon>  	   a TLS variable. */
Simon>  	if (obj_section == NULL
Simon>  	    || (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
Simon> -	   addr = MSYMBOL_VALUE_RAW_ADDRESS (msym);
Simon> +	   addr = msym->value_raw_address ();
Simon>  	else
Simon> -	   addr = BMSYMBOL_VALUE_ADDRESS (lookup_data.result);
Simon> +	   addr = lookup_data.result.value_address ();
Simon>  	if (overlay_debugging)
Simon>  	  addr = symbol_overlayed_address (addr, obj_section);
Simon>  	/* Determine address of TLS variable. */
Simon> diff --git a/gdb/frame.c b/gdb/frame.c
Simon> index 2b296ed6b961..2e574a2f009c 100644
Simon> --- a/gdb/frame.c
Simon> +++ b/gdb/frame.c
Simon> @@ -2430,12 +2430,12 @@ inside_main_func (frame_info *this_frame)
Simon>        if (bs.symbol == nullptr)
Simon>  	return false;
 
Simon> -      const struct block *block = SYMBOL_BLOCK_VALUE (bs.symbol);
Simon> +      const struct block *block = bs.symbol->value_block ();
Simon>        gdb_assert (block != nullptr);
Simon>        sym_addr = BLOCK_START (block);
Simon>      }
Simon>    else
Simon> -    sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +    sym_addr = msymbol.value_address ();
 
Simon>    /* Convert any function descriptor addresses into the actual function
Simon>       code address.  */
Simon> diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
Simon> index 1f291d9117d3..2328791a540b 100644
Simon> --- a/gdb/frv-tdep.c
Simon> +++ b/gdb/frv-tdep.c
Simon> @@ -1384,7 +1384,7 @@ frv_frame_this_id (struct frame_info *this_frame,
 
Simon>    /* Check if the stack is empty.  */
Simon>    msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL);
Simon> -  if (msym_stack.minsym && info->base == BMSYMBOL_VALUE_ADDRESS (msym_stack))
Simon> +  if (msym_stack.minsym && info->base == msym_stack.value_address ())
Simon>      return;
 
Simon>    /* Hopefully the prologue analysis either correctly determined the
Simon> diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c
Simon> index 34703cc3e125..f77e313e0dda 100644
Simon> --- a/gdb/ft32-tdep.c
Simon> +++ b/gdb/ft32-tdep.c
Simon> @@ -200,7 +200,7 @@ ft32_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
Simon>  		regnum);
Simon>        msymbol = lookup_minimal_symbol (prolog_symbol, NULL, NULL);
Simon>        if (msymbol.minsym)
Simon> -	prologs[regnum] = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +	prologs[regnum] = msymbol.value_address ();
Simon>        else
Simon>  	prologs[regnum] = 0;
Simon>      }
Simon> diff --git a/gdb/glibc-tdep.c b/gdb/glibc-tdep.c
Simon> index 19b69fb94dc7..7f6c12bc402f 100644
Simon> --- a/gdb/glibc-tdep.c
Simon> +++ b/gdb/glibc-tdep.c
Simon> @@ -66,7 +66,7 @@ glibc_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
Simon>        if (! fixup.minsym)
Simon>  	fixup = lookup_minimal_symbol ("fixup", NULL, resolver.objfile);
 
Simon> -      if (fixup.minsym && BMSYMBOL_VALUE_ADDRESS (fixup) == pc)
Simon> +      if (fixup.minsym && fixup.value_address () == pc)
Simon>  	return frame_unwind_caller_pc (get_current_frame ());
Simon>      }
 
Simon> diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
Simon> index baf015b9813d..7aac0ca4f9c2 100644
Simon> --- a/gdb/gnu-v3-abi.c
Simon> +++ b/gdb/gnu-v3-abi.c
Simon> @@ -1146,7 +1146,7 @@ gnuv3_get_typeid (struct value *value)
Simon>        if (minsym.minsym == NULL)
Simon>  	error (_("could not find typeinfo symbol for '%s'"), name);
 
Simon> -      result = value_at_lazy (typeinfo_type, BMSYMBOL_VALUE_ADDRESS (minsym));
Simon> +      result = value_at_lazy (typeinfo_type, minsym.value_address ());
Simon>      }
 
Simon>    return result;
Simon> @@ -1235,7 +1235,7 @@ gnuv3_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc)
Simon>    if (fn_sym.minsym == NULL)
Simon>      return 0;
 
Simon> -  method_stop_pc = BMSYMBOL_VALUE_ADDRESS (fn_sym);
Simon> +  method_stop_pc = fn_sym.value_address ();
 
Simon>    /* Some targets have minimal symbols pointing to function descriptors
Simon>       (powerpc 64 for example).  Make sure to retrieve the address
Simon> diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
Simon> index 576678ae9b20..f9ececbb04fc 100644
Simon> --- a/gdb/hppa-tdep.c
Simon> +++ b/gdb/hppa-tdep.c
Simon> @@ -197,7 +197,7 @@ hppa_symbol_address(const char *sym)
 
Simon>    minsym = lookup_minimal_symbol (sym, NULL, NULL);
Simon>    if (minsym.minsym)
Simon> -    return BMSYMBOL_VALUE_ADDRESS (minsym);
Simon> +    return minsym.value_address ();
Simon>    else
Simon>      return (CORE_ADDR)-1;
Simon>  }
Simon> @@ -2528,7 +2528,7 @@ hppa_lookup_stub_minimal_symbol (const char *name,
Simon>  	    {
Simon>  	      struct unwind_table_entry *u;
 
Simon> -	      u = find_unwind_entry (MSYMBOL_VALUE (msym));
Simon> +	      u = find_unwind_entry (msym->value_longest ());
Simon>  	      if (u != NULL && u->stub_unwind.stub_type == stub_type)
Simon>  		{
Simon>  		  result.objfile = objfile;
Simon> diff --git a/gdb/infcmd.c b/gdb/infcmd.c
Simon> index 719bd6888a8c..84eb6e5d79bc 100644
Simon> --- a/gdb/infcmd.c
Simon> +++ b/gdb/infcmd.c
Simon> @@ -979,7 +979,7 @@ prepare_one_step (thread_info *tp, struct step_command_fsm *sm)
Simon>  	      symbol *sym = inline_skipped_symbol (tp);
Simon>  	      if (sym->aclass () == LOC_BLOCK)
Simon>  		{
Simon> -		  const block *block = SYMBOL_BLOCK_VALUE (sym);
Simon> +		  const block *block = sym->value_block ();
Simon>  		  if (BLOCK_END (block) < tp->control.step_range_end)
tp-> control.step_range_end = BLOCK_END (block);
Simon>  		}
Simon> @@ -1336,7 +1336,7 @@ until_next_command (int from_tty)
Simon>        if (msymbol.minsym == NULL)
Simon>  	error (_("Execution is not within a known function."));
 
Simon> -      tp->control.step_range_start = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +      tp->control.step_range_start = msymbol.value_address ();
Simon>        /* The upper-bound of step_range is exclusive.  In order to make PC
Simon>  	 within the range, set the step_range_end with PC + 1.  */
tp-> control.step_range_end = pc + 1;
Simon> @@ -1345,7 +1345,7 @@ until_next_command (int from_tty)
Simon>      {
Simon>        sal = find_pc_line (pc, 0);
 
Simon> -      tp->control.step_range_start = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (func));
Simon> +      tp->control.step_range_start = BLOCK_ENTRY_PC (func->value_block ());
tp-> control.step_range_end = sal.end;
 
Simon>        /* By setting the step_range_end based on the current pc, we are
Simon> diff --git a/gdb/infrun.c b/gdb/infrun.c
Simon> index 0b88eb8cfdfc..c311240b78cd 100644
Simon> --- a/gdb/infrun.c
Simon> +++ b/gdb/infrun.c
Simon> @@ -8090,7 +8090,7 @@ check_exception_resume (struct execution_control_state *ecs,
Simon>  	 cases such as throwing an exception from inside a signal
Simon>  	 handler.  */
 
Simon> -      b = SYMBOL_BLOCK_VALUE (func);
Simon> +      b = func->value_block ();
Simon>        ALL_BLOCK_SYMBOLS (b, iter, sym)
Simon>  	{
Simon>  	  if (!sym->is_argument ())
Simon> diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c
Simon> index a9006a6c8a3f..bcdf36cd067e 100644
Simon> --- a/gdb/inline-frame.c
Simon> +++ b/gdb/inline-frame.c
Simon> @@ -181,7 +181,7 @@ inline_frame_this_id (struct frame_info *this_frame,
Simon>       in the frame ID (and eventually, to set breakpoints).  */
Simon>    func = get_frame_function (this_frame);
Simon>    gdb_assert (func != NULL);
Simon> -  (*this_id).code_addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (func));
Simon> +  (*this_id).code_addr = BLOCK_ENTRY_PC (func->value_block ());
Simon>    (*this_id).artificial_depth++;
Simon>  }
 
Simon> @@ -329,7 +329,7 @@ stopped_by_user_bp_inline_frame (const block *frame_block, bpstat *stop_chain)
Simon>  		 to presenting the stop at the innermost inline
Simon>  		 function.  */
Simon>  	      if (loc->symbol == nullptr
Simon> -		  || frame_block == SYMBOL_BLOCK_VALUE (loc->symbol))
Simon> +		  || frame_block == loc->symbol->value_block ())
Simon>  		return true;
Simon>  	    }
Simon>  	}
Simon> diff --git a/gdb/jit.c b/gdb/jit.c
Simon> index 342b0d07114f..ae679a1f0437 100644
Simon> --- a/gdb/jit.c
Simon> +++ b/gdb/jit.c
Simon> @@ -265,7 +265,7 @@ jit_read_descriptor (gdbarch *gdbarch,
Simon>    jiter_objfile_data *objf_data = jiter->jiter_data.get ();
Simon>    gdb_assert (objf_data != nullptr);
 
Simon> -  CORE_ADDR addr = MSYMBOL_VALUE_ADDRESS (jiter, objf_data->descriptor);
Simon> +  CORE_ADDR addr = objf_data->descriptor->value_address (jiter);
 
Simon>    jit_debug_printf ("descriptor_addr = %s", paddress (gdbarch, addr));
 
Simon> @@ -591,7 +591,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
block_name-> set_aclass_index (LOC_BLOCK);
Simon>        symbol_set_symtab (block_name, filetab);
block_name-> set_type (lookup_function_type (block_type));
Simon> -      SYMBOL_BLOCK_VALUE (block_name) = new_block;
Simon> +      block_name->set_value_block (new_block);
 
block_name-> m_name = obstack_strdup (&objfile->objfile_obstack,
Simon>  					   gdb_block_iter.name.get ());
Simon> @@ -887,7 +887,7 @@ jit_breakpoint_re_set_internal (struct gdbarch *gdbarch, program_space *pspace)
Simon>        bound_minimal_symbol reg_symbol
Simon>  	= lookup_minimal_symbol (jit_break_name, nullptr, the_objfile);
Simon>        if (reg_symbol.minsym == NULL
Simon> -	  || BMSYMBOL_VALUE_ADDRESS (reg_symbol) == 0)
Simon> +	  || reg_symbol.value_address () == 0)
Simon>  	{
Simon>  	  /* No need to repeat the lookup the next time.  */
the_objfile-> skip_jit_symbol_lookup = true;
Simon> @@ -897,7 +897,7 @@ jit_breakpoint_re_set_internal (struct gdbarch *gdbarch, program_space *pspace)
Simon>        bound_minimal_symbol desc_symbol
Simon>  	= lookup_minimal_symbol (jit_descriptor_name, NULL, the_objfile);
Simon>        if (desc_symbol.minsym == NULL
Simon> -	  || BMSYMBOL_VALUE_ADDRESS (desc_symbol) == 0)
Simon> +	  || desc_symbol.value_address () == 0)
Simon>  	{
Simon>  	  /* No need to repeat the lookup the next time.  */
the_objfile-> skip_jit_symbol_lookup = true;
Simon> @@ -909,9 +909,7 @@ jit_breakpoint_re_set_internal (struct gdbarch *gdbarch, program_space *pspace)
objf_data-> register_code = reg_symbol.minsym;
objf_data-> descriptor = desc_symbol.minsym;
 
Simon> -      CORE_ADDR addr = MSYMBOL_VALUE_ADDRESS (the_objfile,
Simon> -					      objf_data->register_code);
Simon> -
Simon> +      CORE_ADDR addr = objf_data->register_code->value_address (the_objfile);
Simon>        jit_debug_printf ("breakpoint_addr = %s", paddress (gdbarch, addr));
 
Simon>        /* Check if we need to re-create the breakpoint.  */
Simon> diff --git a/gdb/linespec.c b/gdb/linespec.c
Simon> index 9d4707cbb4e7..3c176bea94e5 100644
Simon> --- a/gdb/linespec.c
Simon> +++ b/gdb/linespec.c
Simon> @@ -2224,14 +2224,14 @@ convert_linespec_to_sals (struct linespec_state *state, linespec *ls)
Simon>  		   && sym.symbol->aclass () == LOC_BLOCK)
Simon>  		{
Simon>  		  const CORE_ADDR addr
Simon> -		    = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym.symbol));
Simon> +		    = BLOCK_ENTRY_PC (sym.symbol->value_block ());
 
Simon>  		  for (const auto &elem : ls->minimal_symbols)
Simon>  		    {
Simon>  		      if (MSYMBOL_TYPE (elem.minsym) == mst_text_gnu_ifunc
Simon>  			  || MSYMBOL_TYPE (elem.minsym) == mst_data_gnu_ifunc)
Simon>  			{
Simon> -			  CORE_ADDR msym_addr = BMSYMBOL_VALUE_ADDRESS (elem);
Simon> +			  CORE_ADDR msym_addr = elem.value_address ();
Simon>  			  if (MSYMBOL_TYPE (elem.minsym) == mst_data_gnu_ifunc)
Simon>  			    {
Simon>  			      struct gdbarch *gdbarch
Simon> @@ -3986,7 +3986,7 @@ find_label_symbols (struct linespec_state *self,
Simon>  	  fn_sym = elt.symbol;
Simon>  	  set_current_program_space
Simon>  	    (symbol_symtab (fn_sym)->compunit ()->objfile ()->pspace);
Simon> -	  block = SYMBOL_BLOCK_VALUE (fn_sym);
Simon> +	  block = fn_sym->value_block ();
 
Simon>  	  find_label_symbols_in_block (block, name, fn_sym, completion_mode,
Simon>  				       &result, label_funcs_ret);
Simon> @@ -4166,7 +4166,7 @@ minsym_found (struct linespec_state *self, struct objfile *objfile,
Simon>        if (is_function)
Simon>  	sal.pc = func_addr;
Simon>        else
Simon> -	sal.pc = MSYMBOL_VALUE_ADDRESS (objfile, msymbol);
Simon> +	sal.pc = msymbol->value_address (objfile);
Simon>        sal.pspace = current_program_space;
Simon>      }
 
Simon> @@ -4377,13 +4377,13 @@ symbol_to_sal (struct symtab_and_line *result,
Simon>      }
Simon>    else
Simon>      {
Simon> -      if (sym->aclass () == LOC_LABEL && SYMBOL_VALUE_ADDRESS (sym) != 0)
Simon> +      if (sym->aclass () == LOC_LABEL && sym->value_address () != 0)
Simon>  	{
Simon>  	  *result = {};
result-> symtab = symbol_symtab (sym);
result-> symbol = sym;
result-> line = sym->line ();
Simon> -	  result->pc = SYMBOL_VALUE_ADDRESS (sym);
Simon> +	  result->pc = sym->value_address ();
result-> pspace = result->symtab->compunit ()->objfile ()->pspace;
result-> explicit_pc = 1;
Simon>  	  return 1;
Simon> @@ -4399,7 +4399,7 @@ symbol_to_sal (struct symtab_and_line *result,
result-> symtab = symbol_symtab (sym);
result-> symbol = sym;
result-> line = sym->line ();
Simon> -	  result->pc = SYMBOL_VALUE_ADDRESS (sym);
Simon> +	  result->pc = sym->value_address ();
result-> pspace = result->symtab->compunit ()->objfile ()->pspace;
Simon>  	  return 1;
Simon>  	}
Simon> diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
Simon> index 2837233ac6a9..11da82a1abc7 100644
Simon> --- a/gdb/linux-thread-db.c
Simon> +++ b/gdb/linux-thread-db.c
Simon> @@ -474,7 +474,7 @@ inferior_has_bug (const char *ver_symbol, int ver_major_min, int ver_minor_min)
Simon>    if (version_msym.minsym == NULL)
Simon>      return 0;
 
Simon> -  version_addr = BMSYMBOL_VALUE_ADDRESS (version_msym);
Simon> +  version_addr = version_msym.value_address ();
Simon>    gdb::unique_xmalloc_ptr<char> version
Simon>      = target_read_string (version_addr, 32, &got);
Simon>    if (version != nullptr
Simon> diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
Simon> index 02e3cf1b4e7b..85bac11b8fb6 100644
Simon> --- a/gdb/m2-exp.y
Simon> +++ b/gdb/m2-exp.y
Simon> @@ -490,7 +490,7 @@ exp	:	STRING
 
Simon>  /* This will be used for extensions later.  Like adding modules.  */
Simon>  block	:	fblock	
Simon> -			{ $$ = SYMBOL_BLOCK_VALUE($1); }
Simon> +			{ $$ = $1->value_block (); }
Simon>  	;
 
Simon>  fblock	:	BLOCKNAME
Simon> diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
Simon> index 55ef5a551f8b..4971be796cd3 100644
Simon> --- a/gdb/m32c-tdep.c
Simon> +++ b/gdb/m32c-tdep.c
Simon> @@ -2216,7 +2216,7 @@ m32c_return_value (struct gdbarch *gdbarch,
Simon>  	    error (_("The return value is stored in memory at 'mem0', "
Simon>  		     "but GDB cannot find\n"
Simon>  		     "its address."));
Simon> -	  read_memory (BMSYMBOL_VALUE_ADDRESS (mem0), readbuf, valtype_len);
Simon> +	  read_memory (mem0.value_address (), readbuf, valtype_len);
Simon>  	}
Simon>      }
 
Simon> @@ -2248,7 +2248,7 @@ m32c_return_value (struct gdbarch *gdbarch,
Simon>  	    error (_("The return value is stored in memory at 'mem0', "
Simon>  		     "but GDB cannot find\n"
Simon>  		     " its address."));
Simon> -	  write_memory (BMSYMBOL_VALUE_ADDRESS (mem0), writebuf, valtype_len);
Simon> +	  write_memory (mem0.value_address (), writebuf, valtype_len);
Simon>  	}
Simon>      }
 
Simon> @@ -2473,7 +2473,7 @@ m32c_m16c_address_to_pointer (struct gdbarch *gdbarch,
Simon>        else
Simon>  	{
Simon>  	  /* The trampoline's address is our pointer.  */
Simon> -	  addr = BMSYMBOL_VALUE_ADDRESS (tramp_msym);
Simon> +	  addr = tramp_msym.value_address ();
Simon>  	}
Simon>      }
 
Simon> @@ -2525,7 +2525,7 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch,
Simon>  	      /* If we do have such a symbol, return its value as the
Simon>  		 function's true address.  */
Simon>  	      if (func_msym.minsym)
Simon> -		ptr = BMSYMBOL_VALUE_ADDRESS (func_msym);
Simon> +		ptr = func_msym.value_address ();
Simon>  	    }
Simon>  	}
Simon>        else
Simon> diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
Simon> index 9c276fb7593c..3ad4c8de6bf2 100644
Simon> --- a/gdb/m32r-tdep.c
Simon> +++ b/gdb/m32r-tdep.c
Simon> @@ -811,7 +811,7 @@ m32r_frame_this_id (struct frame_info *this_frame,
 
Simon>    /* Check if the stack is empty.  */
Simon>    msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL);
Simon> -  if (msym_stack.minsym && info->base == BMSYMBOL_VALUE_ADDRESS (msym_stack))
Simon> +  if (msym_stack.minsym && info->base == msym_stack.value_address ())
Simon>      return;
 
Simon>    /* Hopefully the prologue analysis either correctly determined the
Simon> diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
Simon> index 5c1f20415c8c..e82b18a848fc 100644
Simon> --- a/gdb/m68hc11-tdep.c
Simon> +++ b/gdb/m68hc11-tdep.c
Simon> @@ -215,7 +215,7 @@ m68hc11_get_register_info (struct m68hc11_soft_reg *reg, const char *name)
Simon>    msymbol = lookup_minimal_symbol (name, NULL, NULL);
Simon>    if (msymbol.minsym)
Simon>      {
Simon> -      reg->addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +      reg->addr = msymbol.value_address ();
reg-> name = xstrdup (name);
 
Simon>        /* Keep track of the address range for soft registers.  */
Simon> diff --git a/gdb/machoread.c b/gdb/machoread.c
Simon> index 14a7428a9793..90f25b3c1912 100644
Simon> --- a/gdb/machoread.c
Simon> +++ b/gdb/machoread.c
Simon> @@ -404,7 +404,7 @@ macho_resolve_oso_sym_with_minsym (struct objfile *main_objfile, asymbol *sym)
Simon>        return 0;
Simon>      }
Simon>    else
Simon> -    return BMSYMBOL_VALUE_ADDRESS (msym);
Simon> +    return msym.value_address ();
Simon>  }
 
Simon>  /* Add oso file OSO/ABFD as a symbol file.  */
Simon> diff --git a/gdb/maint.c b/gdb/maint.c
Simon> index 8cebd6ab5af3..3f3dad5bd794 100644
Simon> --- a/gdb/maint.c
Simon> +++ b/gdb/maint.c
Simon> @@ -588,7 +588,7 @@ maintenance_translate_address (const char *arg, int from_tty)
Simon>      {
Simon>        const char *symbol_name = sym.minsym->print_name ();
Simon>        const char *symbol_offset
Simon> -	= pulongest (address - BMSYMBOL_VALUE_ADDRESS (sym));
Simon> +	= pulongest (address - sym.value_address ());
 
Simon>        sect = sym.obj_section ();
Simon>        if (sect != NULL)
Simon> diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
Simon> index 67630b793327..6dcac13d2c5b 100644
Simon> --- a/gdb/mdebugread.c
Simon> +++ b/gdb/mdebugread.c
Simon> @@ -533,7 +533,7 @@ reg_value_complaint (int regnum, int num_regs, const char *sym)
Simon>  static int
Simon>  mdebug_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
Simon>  {
Simon> -  int regno = gdbarch_ecoff_reg_to_regnum (gdbarch, SYMBOL_VALUE (sym));
Simon> +  int regno = gdbarch_ecoff_reg_to_regnum (gdbarch, sym->value_longest ());
 
Simon>    if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
Simon>      {
Simon> @@ -631,7 +631,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
Simon>        b = BLOCKVECTOR_BLOCK (top_stack->cur_st->compunit ()->blockvector (),
Simon>  			     GLOBAL_BLOCK);
Simon>        s = new_symbol (name);
Simon> -      SET_SYMBOL_VALUE_ADDRESS (s, (CORE_ADDR) sh->value);
Simon> +      s->set_value_address (sh->value);
Simon>        add_data_symbol (sh, ax, bigend, s, LOC_STATIC, b, objfile, name);
Simon>        break;
 
Simon> @@ -644,18 +644,18 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
Simon>  	     address is not in the symbol; we need to fix it later in
Simon>  	     scan_file_globals.  */
Simon>  	  int bucket = hashname (s->linkage_name ());
Simon> -	  SYMBOL_VALUE_CHAIN (s) = global_sym_chain[bucket];
Simon> +	  s->set_value_chain (global_sym_chain[bucket]);
Simon>  	  global_sym_chain[bucket] = s;
Simon>  	}
Simon>        else
Simon> -	SET_SYMBOL_VALUE_ADDRESS (s, (CORE_ADDR) sh->value);
Simon> +	s->set_value_address (sh->value);
Simon>        add_data_symbol (sh, ax, bigend, s, LOC_STATIC, b, objfile, name);
Simon>        break;
 
Simon>      case stLocal:		/* Local variable, goes into current block.  */
Simon>        b = top_stack->cur_block;
Simon>        s = new_symbol (name);
Simon> -      SYMBOL_VALUE (s) = svalue;
Simon> +      s->set_value_longest (svalue);
Simon>        if (sh->sc == scRegister)
Simon>  	add_data_symbol (sh, ax, bigend, s, mdebug_register_index,
Simon>  			 b, objfile, name);
Simon> @@ -696,7 +696,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
s-> set_aclass_index (LOC_ARG);
Simon>  	  break;
Simon>  	}
Simon> -      SYMBOL_VALUE (s) = svalue;
Simon> +      s->set_value_longest (svalue);
s-> set_type (parse_type (cur_fd, ax, sh->index, 0, bigend, name));
Simon>        add_symbol (s, top_stack->cur_st, top_stack->cur_block);
Simon>        break;
Simon> @@ -705,7 +705,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
Simon>        s = new_symbol (name);
s-> set_domain (VAR_DOMAIN);	/* So that it can be used */
s-> set_aclass_index (LOC_LABEL);	/* but not misused.  */
Simon> -      SET_SYMBOL_VALUE_ADDRESS (s, (CORE_ADDR) sh->value);
Simon> +      s->set_value_address (sh->value);
s-> set_type (objfile_type (objfile)->builtin_int);
Simon>        add_symbol (s, top_stack->cur_st, top_stack->cur_block);
Simon>        break;
Simon> @@ -796,7 +796,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
 
Simon>        /* Create and enter a new lexical context.  */
Simon>        b = new_block (FUNCTION_BLOCK, s->language ());
Simon> -      SYMBOL_BLOCK_VALUE (s) = b;
Simon> +      s->set_value_block (b);
Simon>        BLOCK_FUNCTION (b) = s;
Simon>        BLOCK_START (b) = BLOCK_END (b) = sh->value;
Simon>        BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
Simon> @@ -1068,8 +1068,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
enum_sym-> set_aclass_index (LOC_CONST);
enum_sym-> set_type (t);
enum_sym-> set_domain (VAR_DOMAIN);
Simon> -		SYMBOL_VALUE (enum_sym) = tsym.value;
Simon> -		if (SYMBOL_VALUE (enum_sym) < 0)
Simon> +		enum_sym->set_value_longest (tsym.value);
Simon> +		if (enum_sym->value_longest () < 0)
Simon>  		  unsigned_enum = 0;
Simon>  		add_symbol (enum_sym, top_stack->cur_st, top_stack->cur_block);
 
Simon> @@ -1099,7 +1099,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
Simon>  	s = new_symbol (name);
s-> set_domain (STRUCT_DOMAIN);
s-> set_aclass_index (LOC_TYPEDEF);
Simon> -	SYMBOL_VALUE (s) = 0;
Simon> +	s->set_value_longest (0);
s-> set_type (t);
Simon>  	add_symbol (s, top_stack->cur_st, top_stack->cur_block);
Simon>  	break;
Simon> @@ -1159,7 +1159,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
s-> set_type (objfile_type (mdebugread_objfile)->builtin_void);
Simon>  	  e = OBSTACK_ZALLOC (&mdebugread_objfile->objfile_obstack,
Simon>  			      mdebug_extra_func_info);
Simon> -	  SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;
Simon> +	  s->set_value_bytes ((gdb_byte *) e);
e-> numargs = top_stack->numargs;
e-> pdr.framereg = -1;
Simon>  	  add_symbol (s, top_stack->cur_st, top_stack->cur_block);
Simon> @@ -1297,7 +1297,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
Simon>        s = new_symbol (name);
s-> set_domain (VAR_DOMAIN);
s-> set_aclass_index (LOC_TYPEDEF);
Simon> -      SYMBOL_BLOCK_VALUE (s) = top_stack->cur_block;
Simon> +      s->set_value_block (top_stack->cur_block);
s-> set_type (t);
Simon>        add_symbol (s, top_stack->cur_st, top_stack->cur_block);
 
Simon> @@ -1977,7 +1977,7 @@ parse_procedure (PDR *pr, struct compunit_symtab *search_symtab,
 
Simon>    if (s != 0)
Simon>      {
Simon> -      b = SYMBOL_BLOCK_VALUE (s);
Simon> +      b = s->value_block ();
Simon>      }
Simon>    else
Simon>      {
Simon> @@ -2012,7 +2012,7 @@ parse_procedure (PDR *pr, struct compunit_symtab *search_symtab,
Simon>      {
Simon>        struct mdebug_extra_func_info *e;
       
Simon> -      e = (struct mdebug_extra_func_info *) SYMBOL_VALUE_BYTES (i);
Simon> +      e = (struct mdebug_extra_func_info *) i->value_bytes ();
e-> pdr = *pr;
 
Simon>        /* GDB expects the absolute function start address for the
Simon> @@ -3990,7 +3990,7 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
s-> set_domain (LABEL_DOMAIN);
s-> set_aclass_index (LOC_CONST);
s-> set_type (objfile_type (objfile)->builtin_void);
Simon> -		  SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;
Simon> +		  s->set_value_bytes ((gdb_byte *) e);
e-> pdr.framereg = -1;
Simon>  		  add_symbol_to_list (s, get_local_symbols ());
Simon>  		}
Simon> diff --git a/gdb/mi/mi-symbol-cmds.c b/gdb/mi/mi-symbol-cmds.c
Simon> index 5d6d34129291..60321f767962 100644
Simon> --- a/gdb/mi/mi-symbol-cmds.c
Simon> +++ b/gdb/mi/mi-symbol-cmds.c
Simon> @@ -100,7 +100,7 @@ output_nondebug_symbol (ui_out *uiout,
Simon>    ui_out_emit_tuple tuple_emitter (uiout, NULL);
 
uiout-> field_core_addr ("address", gdbarch,
Simon> -			  BMSYMBOL_VALUE_ADDRESS (msymbol));
Simon> +			  msymbol.value_address ());
uiout-> field_string ("name", msymbol.minsym->print_name ());
Simon>  }
 
Simon> diff --git a/gdb/minsyms.c b/gdb/minsyms.c
Simon> index a24930ba9425..e93cbed86216 100644
Simon> --- a/gdb/minsyms.c
Simon> +++ b/gdb/minsyms.c
Simon> @@ -113,7 +113,7 @@ bool
Simon>  msymbol_is_function (struct objfile *objfile, minimal_symbol *minsym,
Simon>  		     CORE_ADDR *func_address_p)
Simon>  {
Simon> -  CORE_ADDR msym_addr = MSYMBOL_VALUE_ADDRESS (objfile, minsym);
Simon> +  CORE_ADDR msym_addr = minsym->value_address (objfile);
 
Simon>    switch (minsym->type)
Simon>      {
Simon> @@ -498,7 +498,7 @@ find_minimal_symbol_address (const char *name, CORE_ADDR *addr,
Simon>      = lookup_minimal_symbol (name, NULL, objfile);
 
Simon>    if (sym.minsym != NULL)
Simon> -    *addr = BMSYMBOL_VALUE_ADDRESS (sym);
Simon> +    *addr = sym.value_address ();
 
Simon>    return sym.minsym == NULL;
Simon>  }
Simon> @@ -665,7 +665,7 @@ lookup_minimal_symbol_by_pc_name (CORE_ADDR pc, const char *name,
Simon>  	       msymbol != NULL;
Simon>  	       msymbol = msymbol->hash_next)
Simon>  	    {
Simon> -	      if (MSYMBOL_VALUE_ADDRESS (objfile, msymbol) == pc
Simon> +	      if (msymbol->value_address (objfile) == pc
Simon>  		  && strcmp (msymbol->linkage_name (), name) == 0)
Simon>  		return msymbol;
Simon>  	    }
Simon> @@ -799,14 +799,14 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
Simon>  	     Warning: this code is trickier than it would appear at first.  */
 
Simon>  	  if (frob_address (objfile, &pc)
Simon> -	      && pc >= MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[lo]))
Simon> +	      && pc >= msymbol[lo].value_raw_address ())
Simon>  	    {
Simon> -	      while (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi]) > pc)
Simon> +	      while (msymbol[hi].value_raw_address () > pc)
Simon>  		{
Simon>  		  /* pc is still strictly less than highest address.  */
Simon>  		  /* Note "new" will always be >= lo.  */
Simon>  		  newobj = (lo + hi) / 2;
Simon> -		  if ((MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[newobj]) >= pc)
Simon> +		  if ((msymbol[newobj].value_raw_address () >= pc)
Simon>  		      || (lo == newobj))
Simon>  		    {
Simon>  		      hi = newobj;
Simon> @@ -821,8 +821,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
Simon>  		 hi to point to the last one.  That way we can find the
Simon>  		 right symbol if it has an index greater than hi.  */
Simon>  	      while (hi < objfile->per_bfd->minimal_symbol_count - 1
Simon> -		     && (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
Simon> -			 == MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi + 1])))
Simon> +		     && (msymbol[hi].value_raw_address ()
Simon> +			 == msymbol[hi + 1].value_raw_address ()))
Simon>  		hi++;
 
Simon>  	      /* Skip various undesirable symbols.  */
Simon> @@ -870,8 +870,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
Simon>  		      && MSYMBOL_TYPE (&msymbol[hi - 1]) == want_type
Simon>  		      && (MSYMBOL_SIZE (&msymbol[hi])
Simon>  			  == MSYMBOL_SIZE (&msymbol[hi - 1]))
Simon> -		      && (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
Simon> -			  == MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi - 1]))
Simon> +		      && (msymbol[hi].value_raw_address ()
Simon> +			  == msymbol[hi - 1].value_raw_address ())
Simon>  		      && (msymbol[hi].obj_section (objfile)
Simon>  			  == msymbol[hi - 1].obj_section (objfile)))
Simon>  		    {
Simon> @@ -900,9 +900,9 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
Simon>  		     the cancellable variants, but both have sizes.  */
Simon>  		  if (hi > 0
Simon>  		      && MSYMBOL_SIZE (&msymbol[hi]) != 0
Simon> -		      && pc >= (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
Simon> +		      && pc >= (msymbol[hi].value_raw_address ()
Simon>  				+ MSYMBOL_SIZE (&msymbol[hi]))
Simon> -		      && pc < (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi - 1])
Simon> +		      && pc < (msymbol[hi - 1].value_raw_address ()
Simon>  			       + MSYMBOL_SIZE (&msymbol[hi - 1])))
Simon>  		    {
Simon>  		      hi--;
Simon> @@ -932,7 +932,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 
Simon>  	      if (hi >= 0
Simon>  		  && MSYMBOL_SIZE (&msymbol[hi]) != 0
Simon> -		  && pc >= (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
Simon> +		  && pc >= (msymbol[hi].value_raw_address ()
Simon>  			    + MSYMBOL_SIZE (&msymbol[hi])))
Simon>  		{
Simon>  		  if (best_zero_sized != -1)
Simon> @@ -944,9 +944,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
Simon>  		      if (previous != nullptr)
Simon>  			{
Simon>  			  if (previous->minsym == nullptr
Simon> -			      || (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
Simon> -				  > MSYMBOL_VALUE_RAW_ADDRESS
Simon> -					(previous->minsym)))
Simon> +			      || (msymbol[hi].value_raw_address ()
Simon> +				  > previous->minsym->value_raw_address ()))
Simon>  			    {
previous-> minsym = &msymbol[hi];
previous-> objfile = objfile;
Simon> @@ -963,8 +962,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
 
Simon>  	      if (hi >= 0
Simon>  		  && ((best_symbol == NULL) ||
Simon> -		      (MSYMBOL_VALUE_RAW_ADDRESS (best_symbol) <
Simon> -		       MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi]))))
Simon> +		      (best_symbol->value_raw_address () <
Simon> +		       msymbol[hi].value_raw_address ())))
Simon>  		{
Simon>  		  best_symbol = &msymbol[hi];
Simon>  		  best_objfile = objfile;
Simon> @@ -1209,7 +1208,7 @@ minimal_symbol_reader::record_full (gdb::string_view name,
Simon>    else
msymbol-> m_name = name.data ();
 
Simon> -  SET_MSYMBOL_VALUE_ADDRESS (msymbol, address);
Simon> +  msymbol->set_value_address (address);
msymbol-> set_section_index (section);
 
Simon>    MSYMBOL_TYPE (msymbol) = ms_type;
Simon> @@ -1233,11 +1232,11 @@ static inline bool
Simon>  minimal_symbol_is_less_than (const minimal_symbol &fn1,
Simon>  			     const minimal_symbol &fn2)
Simon>  {
Simon> -  if (MSYMBOL_VALUE_RAW_ADDRESS (&fn1) < MSYMBOL_VALUE_RAW_ADDRESS (&fn2))
Simon> +  if ((&fn1)->value_raw_address () < (&fn2)->value_raw_address ())
Simon>      {
Simon>        return true;		/* addr 1 is less than addr 2.  */
Simon>      }
Simon> -  else if (MSYMBOL_VALUE_RAW_ADDRESS (&fn1) > MSYMBOL_VALUE_RAW_ADDRESS (&fn2))
Simon> +  else if ((&fn1)->value_raw_address () > (&fn2)->value_raw_address ())
Simon>      {
Simon>        return false;		/* addr 1 is greater than addr 2.  */
Simon>      }
Simon> @@ -1297,8 +1296,8 @@ compact_minimal_symbols (struct minimal_symbol *msymbol, int mcount,
Simon>        copyfrom = copyto = msymbol;
Simon>        while (copyfrom < msymbol + mcount - 1)
Simon>  	{
Simon> -	  if (MSYMBOL_VALUE_RAW_ADDRESS (copyfrom)
Simon> -	      == MSYMBOL_VALUE_RAW_ADDRESS ((copyfrom + 1))
Simon> +	  if (copyfrom->value_raw_address ()
Simon> +	      == (copyfrom + 1)->value_raw_address ()
Simon>  	      && (copyfrom->section_index ()
Simon>  		  == (copyfrom + 1)->section_index ())
Simon>  	      && strcmp (copyfrom->linkage_name (),
Simon> @@ -1596,7 +1595,7 @@ minimal_symbol_upper_bound (struct bound_minimal_symbol minsym)
Simon>       of the section, as the end of the function.  */
 
Simon>    if (MSYMBOL_SIZE (minsym.minsym) != 0)
Simon> -    return BMSYMBOL_VALUE_ADDRESS (minsym) + MSYMBOL_SIZE (minsym.minsym);
Simon> +    return minsym.value_address () + MSYMBOL_SIZE (minsym.minsym);
 
Simon>    /* Step over other symbols at this same address, and symbols in
Simon>       other sections, to find the next symbol in this section with a
Simon> @@ -1609,17 +1608,17 @@ minimal_symbol_upper_bound (struct bound_minimal_symbol minsym)
Simon>    section = msymbol->section_index ();
Simon>    for (iter = msymbol + 1; iter != past_the_end; ++iter)
Simon>      {
Simon> -      if ((MSYMBOL_VALUE_RAW_ADDRESS (iter)
Simon> -	   != MSYMBOL_VALUE_RAW_ADDRESS (msymbol))
Simon> +      if ((iter->value_raw_address ()
Simon> +	   != msymbol->value_raw_address ())
Simon>  	  && iter->section_index () == section)
Simon>  	break;
Simon>      }
 
Simon>    obj_section = minsym.obj_section ();
Simon>    if (iter != past_the_end
Simon> -      && (MSYMBOL_VALUE_ADDRESS (minsym.objfile, iter)
Simon> +      && (iter->value_address (minsym.objfile)
Simon>  	  < obj_section->endaddr ()))
Simon> -    result = MSYMBOL_VALUE_ADDRESS (minsym.objfile, iter);
Simon> +    result = iter->value_address (minsym.objfile);
Simon>    else
Simon>      /* We got the start address from the last msymbol in the objfile.
Simon>         So the end address is the end of the section.  */
Simon> diff --git a/gdb/minsyms.h b/gdb/minsyms.h
Simon> index 519702494ed5..cf2c3c1f85fa 100644
Simon> --- a/gdb/minsyms.h
Simon> +++ b/gdb/minsyms.h
Simon> @@ -36,6 +36,11 @@ struct bound_minimal_symbol
 
Simon>    bound_minimal_symbol () = default;
 
Simon> +  CORE_ADDR value_address () const
Simon> +  {
Simon> +    return this->minsym->value_address (this->objfile);
Simon> +  }
Simon> +
Simon>    /* The minimal symbol that was found, or NULL if no minimal symbol
Simon>       was found.  */
 
Simon> diff --git a/gdb/mips-fbsd-tdep.c b/gdb/mips-fbsd-tdep.c
Simon> index e7eeecb2174f..05043d93e745 100644
Simon> --- a/gdb/mips-fbsd-tdep.c
Simon> +++ b/gdb/mips-fbsd-tdep.c
Simon> @@ -470,7 +470,7 @@ mips_fbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
Simon>  {
Simon>    struct bound_minimal_symbol msym
Simon>      = lookup_bound_minimal_symbol ("_mips_rtld_bind");
Simon> -  if (msym.minsym != nullptr && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
Simon> +  if (msym.minsym != nullptr && msym.value_address () == pc)
Simon>      return frame_unwind_caller_pc (get_current_frame ());
 
Simon>    return fbsd_skip_solib_resolver (gdbarch, pc);
Simon> diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
Simon> index 3f4c1b321b3f..d8f90ccf8812 100644
Simon> --- a/gdb/mips-linux-tdep.c
Simon> +++ b/gdb/mips-linux-tdep.c
Simon> @@ -701,7 +701,7 @@ mips_linux_skip_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
 
Simon>    resolver = lookup_minimal_symbol ("__dl_runtime_resolve", NULL, NULL);
 
Simon> -  if (resolver.minsym && BMSYMBOL_VALUE_ADDRESS (resolver) == pc)
Simon> +  if (resolver.minsym && resolver.value_address () == pc)
Simon>      return frame_unwind_caller_pc (get_current_frame ());
 
Simon>    return glibc_skip_solib_resolver (gdbarch, pc);
Simon> diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
Simon> index 9157e9fa1434..78e7f5ccf871 100644
Simon> --- a/gdb/mips-tdep.c
Simon> +++ b/gdb/mips-tdep.c
Simon> @@ -436,12 +436,12 @@ mips_elf_make_msymbol_special (asymbol * sym, struct minimal_symbol *msym)
Simon>    if (ELF_ST_IS_MICROMIPS (st_other))
Simon>      {
Simon>        MSYMBOL_TARGET_FLAG_MICROMIPS (msym) = 1;
Simon> -      SET_MSYMBOL_VALUE_ADDRESS (msym, MSYMBOL_VALUE_RAW_ADDRESS (msym) | 1);
Simon> +      msym->set_value_address (msym->value_raw_address () | 1);
Simon>      }
Simon>    else if (ELF_ST_IS_MIPS16 (st_other))
Simon>      {
Simon>        MSYMBOL_TARGET_FLAG_MIPS16 (msym) = 1;
Simon> -      SET_MSYMBOL_VALUE_ADDRESS (msym, MSYMBOL_VALUE_RAW_ADDRESS (msym) | 1);
Simon> +      msym->set_value_address (msym->value_raw_address () | 1);
Simon>      }
Simon>  }
 
Simon> @@ -486,7 +486,7 @@ mips_make_symbol_special (struct symbol *sym, struct objfile *objfile)
Simon>    if (sym->aclass () == LOC_BLOCK)
Simon>      {
Simon>        /* We are in symbol reading so it is OK to cast away constness.  */
Simon> -      struct block *block = (struct block *) SYMBOL_BLOCK_VALUE (sym);
Simon> +      struct block *block = (struct block *) sym->value_block ();
Simon>        CORE_ADDR compact_block_start;
Simon>        struct bound_minimal_symbol msym;
 
Simon> @@ -7830,7 +7830,7 @@ mips_skip_pic_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
Simon>       which jumps to foo.  */
Simon>    msym = lookup_minimal_symbol_by_pc (pc);
Simon>    if (msym.minsym == NULL
Simon> -      || BMSYMBOL_VALUE_ADDRESS (msym) != pc
Simon> +      || msym.value_address () != pc
Simon>        || msym.minsym->linkage_name () == NULL
Simon>        || !startswith (msym.minsym->linkage_name (), ".pic."))
Simon>      return 0;
Simon> diff --git a/gdb/netbsd-tdep.c b/gdb/netbsd-tdep.c
Simon> index 38b8a195358e..fbedb77f46e7 100644
Simon> --- a/gdb/netbsd-tdep.c
Simon> +++ b/gdb/netbsd-tdep.c
Simon> @@ -367,7 +367,7 @@ nbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
Simon>    struct bound_minimal_symbol msym;
 
Simon>    msym = lookup_minimal_symbol ("_rtld_bind_start", NULL, NULL);
Simon> -  if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
Simon> +  if (msym.minsym && msym.value_address () == pc)
Simon>      return frame_unwind_caller_pc (get_current_frame ());
Simon>    else
Simon>      return find_solib_trampoline_target (get_current_frame (), pc);
Simon> diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
Simon> index ed13097f7a85..00c362c5c9c8 100644
Simon> --- a/gdb/objc-lang.c
Simon> +++ b/gdb/objc-lang.c
Simon> @@ -1249,7 +1249,7 @@ find_objc_msgsend (void)
Simon>  	  continue; 
Simon>  	}
 
Simon> -      methcalls[i].begin = BMSYMBOL_VALUE_ADDRESS (func);
Simon> +      methcalls[i].begin = func.value_address ();
Simon>        methcalls[i].end = minimal_symbol_upper_bound (func);
Simon>      }
Simon>  }
Simon> diff --git a/gdb/objfiles.c b/gdb/objfiles.c
Simon> index ddd94da42a6f..0c71e0bd6a9f 100644
Simon> --- a/gdb/objfiles.c
Simon> +++ b/gdb/objfiles.c
Simon> @@ -619,11 +619,8 @@ relocate_one_symbol (struct symbol *sym, struct objfile *objfile,
Simon>    if ((sym->aclass () == LOC_LABEL
Simon>         || sym->aclass () == LOC_STATIC)
Simon>        && sym->section_index () >= 0)
Simon> -    {
Simon> -      SET_SYMBOL_VALUE_ADDRESS (sym,
Simon> -				SYMBOL_VALUE_ADDRESS (sym)
Simon> -				+ delta[sym->section_index ()]);
Simon> -    }
Simon> +    sym->set_value_address (sym->value_address ()
Simon> +			    + delta[sym->section_index ()]);
Simon>  }
 
Simon>  /* Relocate OBJFILE to NEW_OFFSETS.  There should be OBJFILE->NUM_SECTIONS
Simon> diff --git a/gdb/obsd-tdep.c b/gdb/obsd-tdep.c
Simon> index f9b967ac47d7..eed327bf7a92 100644
Simon> --- a/gdb/obsd-tdep.c
Simon> +++ b/gdb/obsd-tdep.c
Simon> @@ -31,7 +31,7 @@ obsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
Simon>    struct bound_minimal_symbol msym;
 
Simon>    msym = lookup_minimal_symbol("_dl_bind", NULL, NULL);
Simon> -  if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
Simon> +  if (msym.minsym && msym.value_address () == pc)
Simon>      return frame_unwind_caller_pc (get_current_frame ());
Simon>    else
Simon>      return find_solib_trampoline_target (get_current_frame (), pc);
Simon> diff --git a/gdb/p-exp.y b/gdb/p-exp.y
Simon> index 3d1ea722d81d..ffa82f6e42c3 100644
Simon> --- a/gdb/p-exp.y
Simon> +++ b/gdb/p-exp.y
Simon> @@ -612,7 +612,7 @@ exp	:	THIS
Simon>  block	:	BLOCKNAME
Simon>  			{
Simon>  			  if ($1.sym.symbol != 0)
Simon> -			      $$ = SYMBOL_BLOCK_VALUE ($1.sym.symbol);
Simon> +			      $$ = $1.sym.symbol->value_block ();
Simon>  			  else
Simon>  			    {
Simon>  			      std::string copy = copy_name ($1.stoken);
Simon> @@ -639,7 +639,7 @@ block	:	block COLONCOLON name
Simon>  			  if (!tem || tem->aclass () != LOC_BLOCK)
Simon>  			    error (_("No function \"%s\" in specified context."),
Simon>  				   copy.c_str ());
Simon> -			  $$ = SYMBOL_BLOCK_VALUE (tem); }
Simon> +			  $$ = tem->value_block (); }
Simon>  	;
 
Simon>  variable:	block COLONCOLON name
Simon> diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
Simon> index 427520fa6a07..43c286d64727 100644
Simon> --- a/gdb/p-valprint.c
Simon> +++ b/gdb/p-valprint.c
Simon> @@ -228,7 +228,7 @@ pascal_language::value_print_inner (struct value *val,
Simon>  	  /* If 'symbol_print' is set, we did the work above.  */
Simon>  	  if (!options->symbol_print
Simon>  	      && (msymbol.minsym != NULL)
Simon> -	      && (vt_address == BMSYMBOL_VALUE_ADDRESS (msymbol)))
Simon> +	      && (vt_address == msymbol.value_address ()))
Simon>  	    {
Simon>  	      if (want_space)
Simon>  		gdb_puts (" ", stream);
Simon> diff --git a/gdb/parse.c b/gdb/parse.c
Simon> index 6d1b3d9d9238..2389dbf0b0f5 100644
Simon> --- a/gdb/parse.c
Simon> +++ b/gdb/parse.c
Simon> @@ -115,11 +115,11 @@ find_minsym_type_and_address (minimal_symbol *msymbol,
Simon>      {
Simon>        /* Addresses of TLS symbols are really offsets into a
Simon>  	 per-objfile/per-thread storage block.  */
Simon> -      addr = MSYMBOL_VALUE_RAW_ADDRESS (bound_msym.minsym);
Simon> +      addr = bound_msym.minsym->value_raw_address ();
Simon>      }
Simon>    else if (msymbol_is_function (objfile, msymbol, &addr))
Simon>      {
Simon> -      if (addr != BMSYMBOL_VALUE_ADDRESS (bound_msym))
Simon> +      if (addr != bound_msym.value_address ())
Simon>  	{
Simon>  	  /* This means we resolved a function descriptor, and we now
Simon>  	     have an address for a code/text symbol instead of a data
Simon> @@ -132,7 +132,7 @@ find_minsym_type_and_address (minimal_symbol *msymbol,
Simon>  	}
Simon>      }
Simon>    else
Simon> -    addr = BMSYMBOL_VALUE_ADDRESS (bound_msym);
Simon> +    addr = bound_msym.value_address ();
 
Simon>    if (overlay_debugging)
Simon>      addr = symbol_overlayed_address (addr, section);
Simon> diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
Simon> index ece7e7639232..a11f3672393b 100644
Simon> --- a/gdb/ppc-linux-tdep.c
Simon> +++ b/gdb/ppc-linux-tdep.c
Simon> @@ -1662,9 +1662,9 @@ ppc_elfv2_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR pc)
Simon>    if (MSYMBOL_TARGET_FLAG_1 (fun.minsym))
Simon>      local_entry_offset = 8;
 
Simon> -  if (BMSYMBOL_VALUE_ADDRESS (fun) <= pc
Simon> -      && pc < BMSYMBOL_VALUE_ADDRESS (fun) + local_entry_offset)
Simon> -    return BMSYMBOL_VALUE_ADDRESS (fun) + local_entry_offset;
Simon> +  if (fun.value_address () <= pc
Simon> +      && pc < fun.value_address () + local_entry_offset)
Simon> +    return fun.value_address () + local_entry_offset;
 
Simon>    return pc;
Simon>  }
Simon> diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
Simon> index 9a3b02f028d3..6c2fd1bfc998 100644
Simon> --- a/gdb/ppc-sysv-tdep.c
Simon> +++ b/gdb/ppc-sysv-tdep.c
Simon> @@ -1059,7 +1059,7 @@ convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr)
Simon>    if (fn.minsym == NULL)
Simon>      return 0;
Simon>    /* Found a descriptor.  */
Simon> -  (*desc_addr) = BMSYMBOL_VALUE_ADDRESS (fn);
Simon> +  (*desc_addr) = fn.value_address ();
Simon>    return 1;
Simon>  }
 
Simon> diff --git a/gdb/printcmd.c b/gdb/printcmd.c
Simon> index 3c78edf7cce0..e870b35cf387 100644
Simon> --- a/gdb/printcmd.c
Simon> +++ b/gdb/printcmd.c
Simon> @@ -645,7 +645,7 @@ build_address_symbolic (struct gdbarch *gdbarch,
Simon>  	 pointer is <function+3>.  This matches the ISA behavior.  */
Simon>        addr = gdbarch_addr_bits_remove (gdbarch, addr);
 
Simon> -      name_location = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (symbol));
Simon> +      name_location = BLOCK_ENTRY_PC (symbol->value_block ());
Simon>        if (do_demangle || asm_demangle)
Simon>  	name_temp = symbol->print_name ();
Simon>        else
Simon> @@ -673,7 +673,7 @@ build_address_symbolic (struct gdbarch *gdbarch,
Simon>  	      under consideration.  */
Simon>        if (symbol == NULL ||
Simon>  	   (!prefer_sym_over_minsym
Simon> -	    && BMSYMBOL_VALUE_ADDRESS (msymbol) == addr
Simon> +	    && msymbol.value_address () == addr
Simon>  	    && name_location != addr))
Simon>  	{
Simon>  	  /* If this is a function (i.e. a code address), strip out any
Simon> @@ -688,7 +688,7 @@ build_address_symbolic (struct gdbarch *gdbarch,
Simon>  	    addr = gdbarch_addr_bits_remove (gdbarch, addr);
 
Simon>  	  symbol = 0;
Simon> -	  name_location = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +	  name_location = msymbol.value_address ();
Simon>  	  if (do_demangle || asm_demangle)
Simon>  	    name_temp = msymbol.minsym->print_name ();
Simon>  	  else
Simon> @@ -1551,7 +1551,7 @@ info_symbol_command (const char *arg, int from_tty)
Simon>  	    const char *loc_string;
 
Simon>  	    matches = 1;
Simon> -	    offset = sect_addr - MSYMBOL_VALUE_ADDRESS (objfile, msymbol);
Simon> +	    offset = sect_addr - msymbol->value_address (objfile);
Simon>  	    mapped = section_is_mapped (osect) ? _("mapped") : _("unmapped");
Simon>  	    sec_name = osect->the_bfd_section->name;
Simon>  	    msym_name = msymbol->print_name ();
Simon> @@ -1649,7 +1649,7 @@ info_address_command (const char *exp, int from_tty)
Simon>  	  struct objfile *objfile = msymbol.objfile;
 
Simon>  	  gdbarch = objfile->arch ();
Simon> -	  load_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +	  load_addr = msymbol.value_address ();
 
Simon>  	  gdb_printf ("Symbol \"");
Simon>  	  fprintf_symbol (gdb_stdout, exp,
Simon> @@ -1679,7 +1679,7 @@ info_address_command (const char *exp, int from_tty)
Simon>    gdb_printf ("Symbol \"");
Simon>    gdb_puts (sym->print_name ());
Simon>    gdb_printf ("\" is ");
Simon> -  val = SYMBOL_VALUE (sym);
Simon> +  val = sym->value_longest ();
Simon>    if (sym->is_objfile_owned ())
Simon>      section = sym->obj_section (symbol_objfile (sym));
Simon>    else
Simon> @@ -1703,7 +1703,7 @@ info_address_command (const char *exp, int from_tty)
 
Simon>      case LOC_LABEL:
Simon>        gdb_printf ("a label at address ");
Simon> -      load_addr = SYMBOL_VALUE_ADDRESS (sym);
Simon> +      load_addr = sym->value_address ();
Simon>        fputs_styled (paddress (gdbarch, load_addr), address_style.style (),
Simon>  		    gdb_stdout);
Simon>        if (section_is_overlay (section))
Simon> @@ -1739,7 +1739,7 @@ info_address_command (const char *exp, int from_tty)
 
Simon>      case LOC_STATIC:
Simon>        gdb_printf (_("static storage at address "));
Simon> -      load_addr = SYMBOL_VALUE_ADDRESS (sym);
Simon> +      load_addr = sym->value_address ();
Simon>        fputs_styled (paddress (gdbarch, load_addr), address_style.style (),
Simon>  		    gdb_stdout);
Simon>        if (section_is_overlay (section))
Simon> @@ -1778,7 +1778,7 @@ info_address_command (const char *exp, int from_tty)
 
Simon>      case LOC_BLOCK:
Simon>        gdb_printf (_("a function at address "));
Simon> -      load_addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym));
Simon> +      load_addr = BLOCK_ENTRY_PC (sym->value_block ());
Simon>        fputs_styled (paddress (gdbarch, load_addr), address_style.style (),
Simon>  		    gdb_stdout);
Simon>        if (section_is_overlay (section))
Simon> @@ -1806,7 +1806,7 @@ info_address_command (const char *exp, int from_tty)
Simon>  	    if (section
Simon>  		&& (section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
Simon>  	      {
Simon> -		load_addr = MSYMBOL_VALUE_RAW_ADDRESS (msym.minsym);
Simon> +		load_addr = msym.minsym->value_raw_address ();
Simon>  		gdb_printf (_("a thread-local variable at offset %s "
Simon>  			      "in the thread-local storage for `%s'"),
Simon>  			    paddress (gdbarch, load_addr),
Simon> @@ -1814,7 +1814,7 @@ info_address_command (const char *exp, int from_tty)
Simon>  	      }
Simon>  	    else
Simon>  	      {
Simon> -		load_addr = BMSYMBOL_VALUE_ADDRESS (msym);
Simon> +		load_addr = msym.value_address ();
Simon>  		gdb_printf (_("static storage at address "));
Simon>  		fputs_styled (paddress (gdbarch, load_addr),
Simon>  			      address_style.style (), gdb_stdout);
Simon> diff --git a/gdb/proc-service.c b/gdb/proc-service.c
Simon> index e21ea05872a1..dd3d7c9201e6 100644
Simon> --- a/gdb/proc-service.c
Simon> +++ b/gdb/proc-service.c
Simon> @@ -111,7 +111,7 @@ ps_pglobal_lookup (struct ps_prochandle *ph, const char *obj,
Simon>    if (ms.minsym == NULL)
Simon>      return PS_NOSYM;
 
Simon> -  *sym_addr = core_addr_to_ps_addr (BMSYMBOL_VALUE_ADDRESS (ms));
Simon> +  *sym_addr = core_addr_to_ps_addr (ms.value_address ());
Simon>    return PS_OK;
Simon>  }
 
Simon> diff --git a/gdb/psympriv.h b/gdb/psympriv.h
Simon> index eeaf076bf136..9964c102403e 100644
Simon> --- a/gdb/psympriv.h
Simon> +++ b/gdb/psympriv.h
Simon> @@ -46,14 +46,14 @@ struct partial_symbol
Simon>    /* Return the unrelocated address of this partial symbol.  */
Simon>    CORE_ADDR unrelocated_address () const
Simon>    {
Simon> -    return ginfo.value.address;
Simon> +    return ginfo.value_address ();
Simon>    }
 
Simon>    /* Return the address of this partial symbol, relocated according to
Simon>       the offsets provided in OBJFILE.  */
Simon>    CORE_ADDR address (const struct objfile *objfile) const
Simon>    {
Simon> -    return (ginfo.value.address
Simon> +    return (ginfo.value_address ()
Simon>  	    + objfile->section_offsets[ginfo.section_index ()]);
Simon>    }
 
Simon> @@ -61,7 +61,7 @@ struct partial_symbol
Simon>       unrelocated.  */
Simon>    void set_unrelocated_address (CORE_ADDR addr)
Simon>    {
Simon> -    ginfo.value.address = addr;
Simon> +    ginfo.set_value_address (addr);
Simon>    }
 
Simon>    /* Note that partial_symbol does not derive from general_symbol_info
Simon> diff --git a/gdb/psymtab.c b/gdb/psymtab.c
Simon> index a26ecd0b4e5e..5d9949bca1d9 100644
Simon> --- a/gdb/psymtab.c
Simon> +++ b/gdb/psymtab.c
Simon> @@ -134,7 +134,7 @@ find_pc_sect_psymtab_closer (struct objfile *objfile,
Simon>  	     object's symbol table.  */
Simon>  	  p = find_pc_sect_psymbol (objfile, tpst, pc, section);
Simon>  	  if (p != NULL
Simon> -	      && (p->address (objfile) == BMSYMBOL_VALUE_ADDRESS (msymbol)))
Simon> +	      && (p->address (objfile) == msymbol.value_address ()))
Simon>  	    return tpst;
 
Simon>  	  /* Also accept the textlow value of a psymtab as a
Simon> @@ -211,7 +211,7 @@ psymbol_functions::find_pc_sect_psymtab (struct objfile *objfile,
Simon>  	      p = find_pc_sect_psymbol (objfile, pst, pc, section);
Simon>  	      if (p == NULL
Simon>  		  || (p->address (objfile)
Simon> -		      != BMSYMBOL_VALUE_ADDRESS (msymbol)))
Simon> +		      != msymbol.value_address ()))
Simon>  		goto next;
Simon>  	    }
 
Simon> @@ -1287,7 +1287,7 @@ psymbol_bcache::hash (const void *addr, int length)
Simon>    unsigned int domain = psymbol->domain;
Simon>    unsigned int theclass = psymbol->aclass;
 
Simon> -  h = fast_hash (&psymbol->ginfo.value, sizeof (psymbol->ginfo.value), h);
Simon> +  h = fast_hash (&psymbol->ginfo.m_value, sizeof (psymbol->ginfo.m_value), h);
Simon>    h = fast_hash (&lang, sizeof (unsigned int), h);
Simon>    h = fast_hash (&domain, sizeof (unsigned int), h);
Simon>    h = fast_hash (&theclass, sizeof (unsigned int), h);
Simon> @@ -1306,8 +1306,8 @@ psymbol_bcache::compare (const void *addr1, const void *addr2, int length)
Simon>    struct partial_symbol *sym1 = (struct partial_symbol *) addr1;
Simon>    struct partial_symbol *sym2 = (struct partial_symbol *) addr2;
 
Simon> -  return (memcmp (&sym1->ginfo.value, &sym2->ginfo.value,
Simon> -		  sizeof (sym1->ginfo.value)) == 0
Simon> +  return (memcmp (&sym1->ginfo.m_value, &sym2->ginfo.m_value,
Simon> +		  sizeof (sym1->ginfo.m_value)) == 0
Simon>  	  && sym1->ginfo.language () == sym2->ginfo.language ()
Simon>  	  && sym1->domain == sym2->domain
Simon>  	  && sym1->aclass == sym2->aclass
Simon> @@ -1804,7 +1804,7 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
Simon>  		  /* Skip symbols for inlined functions without address.  These may
Simon>  		     or may not have a match in the full symtab.  */
Simon>  		  if (psym->aclass == LOC_BLOCK
Simon> -		      && psym->ginfo.value.address == 0)
Simon> +		      && psym->ginfo.value_address () == 0)
Simon>  		    continue;
 
Simon>  		  sym = block_lookup_symbol (b, psym->ginfo.search_name (),
Simon> diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
Simon> index cbc3508756e6..aae6e397327f 100644
Simon> --- a/gdb/ravenscar-thread.c
Simon> +++ b/gdb/ravenscar-thread.c
Simon> @@ -361,7 +361,7 @@ get_running_thread_id (int cpu)
Simon>      return 0;
 
Simon>    object_size = TYPE_LENGTH (builtin_type_void_data_ptr);
Simon> -  object_addr = (BMSYMBOL_VALUE_ADDRESS (object_msym)
Simon> +  object_addr = (object_msym.value_address ()
Simon>  		 + (cpu - 1) * object_size);
Simon>    buf_size = object_size;
Simon>    buf = (gdb_byte *) alloca (buf_size);
Simon> diff --git a/gdb/remote.c b/gdb/remote.c
Simon> index b002f041734c..75d6bf3919d0 100644
Simon> --- a/gdb/remote.c
Simon> +++ b/gdb/remote.c
Simon> @@ -5155,7 +5155,7 @@ remote_target::remote_check_symbols ()
Simon>        else
Simon>  	{
Simon>  	  int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
Simon> -	  CORE_ADDR sym_addr = BMSYMBOL_VALUE_ADDRESS (sym);
Simon> +	  CORE_ADDR sym_addr = sym.value_address ();
 
Simon>  	  /* If this is a function address, return the start of code
Simon>  	     instead of any data function descriptor.  */
Simon> diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
Simon> index 2a05026f3d7f..18754f4f93b4 100644
Simon> --- a/gdb/sol-thread.c
Simon> +++ b/gdb/sol-thread.c
Simon> @@ -767,7 +767,7 @@ ps_pglobal_lookup (struct ps_prochandle *ph, const char *ld_object_name,
Simon>    if (!ms.minsym)
Simon>      return PS_NOSYM;
 
Simon> -  *ld_symbol_addr = BMSYMBOL_VALUE_ADDRESS (ms);
Simon> +  *ld_symbol_addr = ms.value_address ();
Simon>    return PS_OK;
Simon>  }
 
Simon> diff --git a/gdb/sol2-tdep.c b/gdb/sol2-tdep.c
Simon> index e456c6c9a41a..a7bf8836269f 100644
Simon> --- a/gdb/sol2-tdep.c
Simon> +++ b/gdb/sol2-tdep.c
Simon> @@ -67,7 +67,7 @@ sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
Simon>    struct bound_minimal_symbol msym;
 
Simon>    msym = lookup_minimal_symbol("elf_bndr", NULL, NULL);
Simon> -  if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
Simon> +  if (msym.minsym && msym.value_address () == pc)
Simon>      return frame_unwind_caller_pc (get_current_frame ());
 
Simon>    return 0;
Simon> diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c
Simon> index a0735eafcc6a..0b03f9446086 100644
Simon> --- a/gdb/solib-dsbt.c
Simon> +++ b/gdb/solib-dsbt.c
Simon> @@ -459,7 +459,7 @@ lm_base (void)
 
Simon>    if (got_sym.minsym != 0)
Simon>      {
Simon> -      addr = BMSYMBOL_VALUE_ADDRESS (got_sym);
Simon> +      addr = got_sym.value_address ();
Simon>        if (solib_dsbt_debug)
Simon>  	gdb_printf (gdb_stdlog,
Simon>  		    "lm_base: get addr %x by _GLOBAL_OFFSET_TABLE_.\n",
Simon> diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
Simon> index 925ec717c8e2..a6d6fe070882 100644
Simon> --- a/gdb/solib-frv.c
Simon> +++ b/gdb/solib-frv.c
Simon> @@ -296,7 +296,7 @@ lm_base (void)
Simon>        return 0;
Simon>      }
 
Simon> -  addr = BMSYMBOL_VALUE_ADDRESS (got_sym) + 8;
Simon> +  addr = got_sym.value_address () + 8;
 
Simon>    if (solib_frv_debug)
Simon>      gdb_printf (gdb_stdlog,
Simon> @@ -900,7 +900,7 @@ main_got (void)
Simon>    if (got_sym.minsym == 0)
Simon>      return 0;
 
Simon> -  return BMSYMBOL_VALUE_ADDRESS (got_sym);
Simon> +  return got_sym.value_address ();
Simon>  }
 
Simon>  /* Find the global pointer for the given function address ADDR.  */
Simon> diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
Simon> index ca98a812f365..2f3e79d200f2 100644
Simon> --- a/gdb/solib-svr4.c
Simon> +++ b/gdb/solib-svr4.c
Simon> @@ -713,7 +713,7 @@ elf_locate_base (void)
Simon>    msymbol = lookup_minimal_symbol ("_r_debug", NULL,
current_program_space-> symfile_object_file);
Simon>    if (msymbol.minsym != NULL)
Simon> -    return BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +    return msymbol.value_address ();
 
Simon>    /* DT_DEBUG entry not found.  */
Simon>    return 0;
Simon> @@ -2369,9 +2369,9 @@ enable_break (struct svr4_info *info, int from_tty)
Simon>      {
Simon>        msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, objf);
Simon>        if ((msymbol.minsym != NULL)
Simon> -	  && (BMSYMBOL_VALUE_ADDRESS (msymbol) != 0))
Simon> +	  && (msymbol.value_address () != 0))
Simon>  	{
Simon> -	  sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +	  sym_addr = msymbol.value_address ();
Simon>  	  sym_addr = gdbarch_convert_from_func_ptr_addr
Simon>  	    (target_gdbarch (), sym_addr, current_inferior ()->top_target ());
Simon>  	  svr4_create_solib_event_breakpoints (info, target_gdbarch (),
Simon> @@ -2386,9 +2386,9 @@ enable_break (struct svr4_info *info, int from_tty)
Simon>  	{
Simon>  	  msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, objf);
Simon>  	  if ((msymbol.minsym != NULL)
Simon> -	      && (BMSYMBOL_VALUE_ADDRESS (msymbol) != 0))
Simon> +	      && (msymbol.value_address () != 0))
Simon>  	    {
Simon> -	      sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +	      sym_addr = msymbol.value_address ();
Simon>  	      sym_addr = gdbarch_convert_from_func_ptr_addr
Simon>  		(target_gdbarch (), sym_addr,
Simon>  		 current_inferior ()->top_target ());
Simon> diff --git a/gdb/solib.c b/gdb/solib.c
Simon> index c64ef8c23b75..0fbf5bc988dd 100644
Simon> --- a/gdb/solib.c
Simon> +++ b/gdb/solib.c
Simon> @@ -1551,9 +1551,9 @@ gdb_bfd_lookup_symbol_from_symtab (bfd *abfd,
Simon>  		{
Simon>  		  struct minimal_symbol msym {};
 
Simon> -		  SET_MSYMBOL_VALUE_ADDRESS (&msym, symaddr);
Simon> +		  msym.set_value_address (symaddr);
Simon>  		  gdbarch_elf_make_msymbol_special (gdbarch, sym, &msym);
Simon> -		  symaddr = MSYMBOL_VALUE_RAW_ADDRESS (&msym);
Simon> +		  symaddr = msym.value_raw_address ();
Simon>  		}
 
Simon>  	      /* BFD symbols are section relative.  */
Simon> diff --git a/gdb/stabsread.c b/gdb/stabsread.c
Simon> index 5e85c34303c9..3f173da71d59 100644
Simon> --- a/gdb/stabsread.c
Simon> +++ b/gdb/stabsread.c
Simon> @@ -623,7 +623,7 @@ symbol_reference_defined (const char **string)
Simon>  static int
Simon>  stab_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
Simon>  {
Simon> -  int regno = gdbarch_stab_reg_to_regnum (gdbarch, SYMBOL_VALUE (sym));
Simon> +  int regno = gdbarch_stab_reg_to_regnum (gdbarch, sym->value_longest ());
 
Simon>    if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
Simon>      {
Simon> @@ -805,7 +805,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>  	    target_float_from_string (dbl_valu, dbl_type, std::string (p));
 
sym-> set_type (dbl_type);
Simon> -	    SYMBOL_VALUE_BYTES (sym) = dbl_valu;
Simon> +	    sym->set_value_bytes (dbl_valu);
sym-> set_aclass_index (LOC_CONST_BYTES);
Simon>  	  }
Simon>  	  break;
Simon> @@ -819,7 +819,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>  	       unsigned as well as signed constants.  */
 
sym-> set_type (objfile_type (objfile)->builtin_long);
Simon> -	    SYMBOL_VALUE (sym) = atoi (p);
Simon> +	    sym->set_value_longest (atoi (p));
sym-> set_aclass_index (LOC_CONST);
Simon>  	  }
Simon>  	  break;
Simon> @@ -827,7 +827,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>  	case 'c':
Simon>  	  {
sym-> set_type (objfile_type (objfile)->builtin_char);
Simon> -	    SYMBOL_VALUE (sym) = atoi (p);
Simon> +	    sym->set_value_longest (atoi (p));
sym-> set_aclass_index (LOC_CONST);
Simon>  	  }
Simon>  	  break;
Simon> @@ -888,7 +888,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>  	    memcpy (string_value, string_local, ind + 1);
Simon>  	    p++;
 
Simon> -	    SYMBOL_VALUE_BYTES (sym) = string_value;
Simon> +	    sym->set_value_bytes (string_value);
sym-> set_aclass_index (LOC_CONST_BYTES);
Simon>  	  }
Simon>  	  break;
Simon> @@ -915,7 +915,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>  	       correct.  Ideally, we should be using whatever we have
Simon>  	       available for parsing unsigned and long long values,
Simon>  	       however.  */
Simon> -	    SYMBOL_VALUE (sym) = atoi (p);
Simon> +	    sym->set_value_longest (atoi (p));
Simon>  	  }
Simon>  	  break;
Simon>  	default:
Simon> @@ -933,7 +933,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
sym-> set_type (read_type (&p, objfile));
sym-> set_aclass_index (LOC_LABEL);
sym-> set_domain (VAR_DOMAIN);
Simon> -      SET_SYMBOL_VALUE_ADDRESS (sym, valu);
Simon> +      sym->set_value_address (valu);
Simon>        add_symbol_to_list (sym, get_local_symbols ());
Simon>        break;
 
Simon> @@ -1032,7 +1032,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>        if (sym->linkage_name () && sym->linkage_name ()[0] != '#')
Simon>  	{
Simon>  	  i = hashname (sym->linkage_name ());
Simon> -	  SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
Simon> +	  sym->set_value_chain (global_sym_chain[i]);
Simon>  	  global_sym_chain[i] = sym;
Simon>  	}
Simon>        add_symbol_to_list (sym, get_global_symbols ());
Simon> @@ -1045,7 +1045,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>      case 'l':
sym-> set_type (read_type (&p, objfile));
sym-> set_aclass_index (LOC_LOCAL);
Simon> -      SYMBOL_VALUE (sym) = valu;
Simon> +      sym->set_value_longest (valu);
sym-> set_domain (VAR_DOMAIN);
Simon>        add_symbol_to_list (sym, get_local_symbols ());
Simon>        break;
Simon> @@ -1065,7 +1065,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
sym-> set_type (read_type (&p, objfile));
 
sym-> set_aclass_index (LOC_ARG);
Simon> -      SYMBOL_VALUE (sym) = valu;
Simon> +      sym->set_value_longest (valu);
sym-> set_domain (VAR_DOMAIN);
sym-> set_is_argument (1);
Simon>        add_symbol_to_list (sym, get_local_symbols ());
Simon> @@ -1115,7 +1115,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
sym-> set_type (read_type (&p, objfile));
sym-> set_aclass_index (stab_register_index);
sym-> set_is_argument (1);
Simon> -      SYMBOL_VALUE (sym) = valu;
Simon> +      sym->set_value_longest (valu);
sym-> set_domain (VAR_DOMAIN);
Simon>        add_symbol_to_list (sym, get_local_symbols ());
Simon>        break;
Simon> @@ -1124,7 +1124,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>        /* Register variable (either global or local).  */
sym-> set_type (read_type (&p, objfile));
sym-> set_aclass_index (stab_register_index);
Simon> -      SYMBOL_VALUE (sym) = valu;
Simon> +      sym->set_value_longest (valu);
sym-> set_domain (VAR_DOMAIN);
Simon>        if (within_function)
Simon>  	{
Simon> @@ -1164,7 +1164,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>  		  /* Use the type from the LOC_REGISTER; that is the type
Simon>  		     that is actually in that register.  */
prev_sym-> set_type (sym->type ());
Simon> -		  SYMBOL_VALUE (prev_sym) = SYMBOL_VALUE (sym);
Simon> +		  prev_sym->set_value_longest (sym->value_longest ());
Simon>  		  sym = prev_sym;
Simon>  		  break;
Simon>  		}
Simon> @@ -1179,7 +1179,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>        /* Static symbol at top level of file.  */
sym-> set_type (read_type (&p, objfile));
sym-> set_aclass_index (LOC_STATIC);
Simon> -      SET_SYMBOL_VALUE_ADDRESS (sym, valu);
Simon> +      sym->set_value_address (valu);
sym-> set_domain (VAR_DOMAIN);
Simon>        add_symbol_to_list (sym, get_file_symbols ());
Simon>        break;
Simon> @@ -1210,7 +1210,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>  	return NULL;
 
sym-> set_aclass_index (LOC_TYPEDEF);
Simon> -      SYMBOL_VALUE (sym) = valu;
Simon> +      sym->set_value_longest (valu);
sym-> set_domain (VAR_DOMAIN);
Simon>        /* C++ vagaries: we may have a type which is derived from
Simon>  	 a base type which did not have its name defined when the
Simon> @@ -1287,7 +1287,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 
Simon>  	  *struct_sym = *sym;
struct_sym-> set_aclass_index (LOC_TYPEDEF);
Simon> -	  SYMBOL_VALUE (struct_sym) = valu;
Simon> +	  struct_sym->set_value_longest (valu);
struct_sym-> set_domain (STRUCT_DOMAIN);
Simon>  	  if (sym->type ()->name () == 0)
sym-> type ()->set_name
Simon> @@ -1314,7 +1314,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>  	return NULL;
 
sym-> set_aclass_index (LOC_TYPEDEF);
Simon> -      SYMBOL_VALUE (sym) = valu;
Simon> +      sym->set_value_longest (valu);
sym-> set_domain (STRUCT_DOMAIN);
Simon>        if (sym->type ()->name () == 0)
sym-> type ()->set_name
Simon> @@ -1329,7 +1329,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 
Simon>  	  *typedef_sym = *sym;
typedef_sym-> set_aclass_index (LOC_TYPEDEF);
Simon> -	  SYMBOL_VALUE (typedef_sym) = valu;
Simon> +	  typedef_sym->set_value_longest (valu);
typedef_sym-> set_domain (VAR_DOMAIN);
Simon>  	  if (sym->type ()->name () == 0)
sym-> type ()->set_name
Simon> @@ -1343,7 +1343,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>        /* Static symbol of local scope.  */
sym-> set_type (read_type (&p, objfile));
sym-> set_aclass_index (LOC_STATIC);
Simon> -      SET_SYMBOL_VALUE_ADDRESS (sym, valu);
Simon> +      sym->set_value_address (valu);
sym-> set_domain (VAR_DOMAIN);
Simon>        add_symbol_to_list (sym, get_local_symbols ());
Simon>        break;
Simon> @@ -1353,7 +1353,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
sym-> set_type (read_type (&p, objfile));
sym-> set_aclass_index (LOC_REF_ARG);
sym-> set_is_argument (1);
Simon> -      SYMBOL_VALUE (sym) = valu;
Simon> +      sym->set_value_longest (valu);
sym-> set_domain (VAR_DOMAIN);
Simon>        add_symbol_to_list (sym, get_local_symbols ());
Simon>        break;
Simon> @@ -1363,7 +1363,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
sym-> set_type (read_type (&p, objfile));
sym-> set_aclass_index (stab_regparm_index);
sym-> set_is_argument (1);
Simon> -      SYMBOL_VALUE (sym) = valu;
Simon> +      sym->set_value_longest (valu);
sym-> set_domain (VAR_DOMAIN);
Simon>        add_symbol_to_list (sym, get_local_symbols ());
Simon>        break;
Simon> @@ -1375,7 +1375,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>  	 "x:3" (local symbol) instead.  */
sym-> set_type (read_type (&p, objfile));
sym-> set_aclass_index (LOC_LOCAL);
Simon> -      SYMBOL_VALUE (sym) = valu;
Simon> +      sym->set_value_longest (valu);
sym-> set_domain (VAR_DOMAIN);
Simon>        add_symbol_to_list (sym, get_local_symbols ());
Simon>        break;
Simon> @@ -1383,7 +1383,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
Simon>      default:
sym-> set_type (error_type (&p, objfile));
sym-> set_aclass_index (LOC_CONST);
Simon> -      SYMBOL_VALUE (sym) = 0;
Simon> +      sym->set_value_longest (0);
sym-> set_domain (VAR_DOMAIN);
Simon>        add_symbol_to_list (sym, get_file_symbols ());
Simon>        break;
Simon> @@ -3594,7 +3594,7 @@ read_enum_type (const char **pp, struct type *type,
Simon>  			 &objfile->objfile_obstack);
sym-> set_aclass_index (LOC_CONST);
sym-> set_domain (VAR_DOMAIN);
Simon> -      SYMBOL_VALUE (sym) = n;
Simon> +      sym->set_value_longest (n);
Simon>        if (n < 0)
Simon>  	unsigned_enum = 0;
Simon>        add_symbol_to_list (sym, symlist);
Simon> @@ -3637,7 +3637,7 @@ read_enum_type (const char **pp, struct type *type,
 
xsym-> set_type (type);
type-> field (n).set_name (xsym->linkage_name ());
Simon> -	  type->field (n).set_loc_enumval (SYMBOL_VALUE (xsym));
Simon> +	  type->field (n).set_loc_enumval (xsym->value_longest ());
Simon>  	  TYPE_FIELD_BITSIZE (type, n) = 0;
Simon>  	}
Simon>        if (syms == osyms)
Simon> @@ -4287,7 +4287,7 @@ common_block_end (struct objfile *objfile)
Simon>       Does it matter?  */
 
Simon>    i = hashname (sym->linkage_name ());
Simon> -  SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
Simon> +  sym->set_value_chain (global_sym_chain[i]);
Simon>    global_sym_chain[i] = sym;
Simon>    common_block_name = NULL;
Simon>  }
Simon> @@ -4306,9 +4306,8 @@ fix_common_block (struct symbol *sym, CORE_ADDR valu)
Simon>        int j;
 
Simon>        for (j = next->nsyms - 1; j >= 0; j--)
Simon> -	SET_SYMBOL_VALUE_ADDRESS (next->symbol[j],
Simon> -				  SYMBOL_VALUE_ADDRESS (next->symbol[j])
Simon> -				  + valu);
Simon> +	next->symbol[j]->set_value_address
Simon> +	  (next->symbol[j]->value_address () + valu);
Simon>      }
Simon>  }
Simon>  \f
Simon> @@ -4564,11 +4563,11 @@ scan_file_globals (struct objfile *objfile)
Simon>  		     assign the value we have to it.  */
Simon>  		  if (prev)
Simon>  		    {
Simon> -		      SYMBOL_VALUE_CHAIN (prev) = SYMBOL_VALUE_CHAIN (sym);
Simon> +		      prev->set_value_chain (sym->value_chain ());
Simon>  		    }
Simon>  		  else
Simon>  		    {
Simon> -		      global_sym_chain[hash] = SYMBOL_VALUE_CHAIN (sym);
Simon> +		      global_sym_chain[hash] = sym->value_chain ();
Simon>  		    }
 
Simon>  		  /* Check to see whether we need to fix up a common block.  */
Simon> @@ -4577,23 +4576,17 @@ scan_file_globals (struct objfile *objfile)
Simon>  		  if (sym)
Simon>  		    {
Simon>  		      if (sym->aclass () == LOC_BLOCK)
Simon> -			{
Simon> -			  fix_common_block (sym,
Simon> -					    MSYMBOL_VALUE_ADDRESS (resolve_objfile,
Simon> -								   msymbol));
Simon> -			}
Simon> +			fix_common_block
Simon> +			  (sym, msymbol->value_address (resolve_objfile));
Simon>  		      else
Simon> -			{
Simon> -			  SET_SYMBOL_VALUE_ADDRESS
Simon> -			    (sym, MSYMBOL_VALUE_ADDRESS (resolve_objfile,
Simon> -							 msymbol));
Simon> -			}
Simon> +			sym->set_value_address
Simon> +			  (msymbol->value_address (resolve_objfile));
sym-> set_section_index (msymbol->section_index ());
Simon>  		    }
 
Simon>  		  if (prev)
Simon>  		    {
Simon> -		      sym = SYMBOL_VALUE_CHAIN (prev);
Simon> +		      sym = prev->value_chain ();
Simon>  		    }
Simon>  		  else
Simon>  		    {
Simon> @@ -4603,7 +4596,7 @@ scan_file_globals (struct objfile *objfile)
Simon>  	      else
Simon>  		{
Simon>  		  prev = sym;
Simon> -		  sym = SYMBOL_VALUE_CHAIN (sym);
Simon> +		  sym = sym->value_chain ();
Simon>  		}
Simon>  	    }
Simon>  	}
Simon> @@ -4620,11 +4613,11 @@ scan_file_globals (struct objfile *objfile)
Simon>        while (sym)
Simon>  	{
Simon>  	  prev = sym;
Simon> -	  sym = SYMBOL_VALUE_CHAIN (sym);
Simon> +	  sym = sym->value_chain ();
 
Simon>  	  /* Change the symbol address from the misleading chain value
Simon>  	     to address zero.  */
Simon> -	  SET_SYMBOL_VALUE_ADDRESS (prev, 0);
Simon> +	  prev->set_value_address (0);
 
Simon>  	  /* Complain about unresolved common block symbols.  */
Simon>  	  if (prev->aclass () == LOC_STATIC)
Simon> diff --git a/gdb/stack.c b/gdb/stack.c
Simon> index 1ccad83a2dda..1229ee6b4921 100644
Simon> --- a/gdb/stack.c
Simon> +++ b/gdb/stack.c
Simon> @@ -750,7 +750,7 @@ print_frame_args (const frame_print_options &fp_opts,
 
Simon>    if (func)
Simon>      {
Simon> -      const struct block *b = SYMBOL_BLOCK_VALUE (func);
Simon> +      const struct block *b = func->value_block ();
Simon>        struct block_iterator iter;
Simon>        struct symbol *sym;
 
Simon> @@ -778,7 +778,7 @@ print_frame_args (const frame_print_options &fp_opts,
Simon>  	    case LOC_ARG:
Simon>  	    case LOC_REF_ARG:
Simon>  	      {
Simon> -		long current_offset = SYMBOL_VALUE (sym);
Simon> +		long current_offset = sym->value_longest ();
Simon>  		int arg_size = TYPE_LENGTH (sym->type ());
 
Simon>  		/* Compute address of next argument by adding the size of
Simon> @@ -2554,7 +2554,7 @@ print_frame_arg_vars (struct frame_info *frame,
Simon>    cb_data.stream = stream;
Simon>    cb_data.values_printed = 0;
 
Simon> -  iterate_over_block_arg_vars (SYMBOL_BLOCK_VALUE (func), cb_data);
Simon> +  iterate_over_block_arg_vars (func->value_block (), cb_data);
 
Simon>    /* do_print_variable_and_value invalidates FRAME.  */
Simon>    frame = NULL;
Simon> diff --git a/gdb/symfile.c b/gdb/symfile.c
Simon> index dcd217c0a51c..6f546f5b0591 100644
Simon> --- a/gdb/symfile.c
Simon> +++ b/gdb/symfile.c
Simon> @@ -3450,11 +3450,11 @@ simple_read_overlay_table (void)
Simon>    word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
Simon>    byte_order = gdbarch_byte_order (gdbarch);
 
Simon> -  cache_novlys = read_memory_integer (BMSYMBOL_VALUE_ADDRESS (novlys_msym),
Simon> +  cache_novlys = read_memory_integer (novlys_msym.value_address (),
Simon>  				      4, byte_order);
Simon>    cache_ovly_table
Simon>      = (unsigned int (*)[4]) xmalloc (cache_novlys * sizeof (*cache_ovly_table));
Simon> -  cache_ovly_table_base = BMSYMBOL_VALUE_ADDRESS (ovly_table_msym);
Simon> +  cache_ovly_table_base = ovly_table_msym.value_address ();
Simon>    read_target_long_array (cache_ovly_table_base,
Simon>  			  (unsigned int *) cache_ovly_table,
Simon>  			  cache_novlys * 4, word_size, byte_order);
Simon> @@ -3524,7 +3524,7 @@ simple_overlay_update (struct obj_section *osect)
Simon>  		   "find `_ovly_table' array\n"
Simon>  		   "in inferior.  Use `overlay manual' mode."));
 	
Simon> -	if (cache_ovly_table_base == BMSYMBOL_VALUE_ADDRESS (minsym))
Simon> +	if (cache_ovly_table_base == minsym.value_address ())
Simon>  	  /* Then go ahead and try to look up this single section in
Simon>  	     the cache.  */
Simon>  	  if (simple_overlay_update_1 (osect))
Simon> diff --git a/gdb/symmisc.c b/gdb/symmisc.c
Simon> index 1779816348fc..1bc5f9f0bd95 100644
Simon> --- a/gdb/symmisc.c
Simon> +++ b/gdb/symmisc.c
Simon> @@ -201,7 +201,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
 
Simon>        /* Use the relocated address as shown in the symbol here -- do
Simon>  	 not try to respect copy relocations.  */
Simon> -      CORE_ADDR addr = (msymbol->value.address
Simon> +      CORE_ADDR addr = (msymbol->value_raw_address ()
Simon>  			+ objfile->section_offsets[msymbol->section_index ()]);
Simon>        gdb_puts (paddress (gdbarch, addr), outfile);
Simon>        gdb_printf (outfile, " %s", msymbol->linkage_name ());
Simon> @@ -511,7 +511,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
Simon>    if (symbol->domain () == LABEL_DOMAIN)
Simon>      {
Simon>        gdb_printf (outfile, "label %s at ", symbol->print_name ());
Simon> -      gdb_puts (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
Simon> +      gdb_puts (paddress (gdbarch, symbol->value_address ()),
Simon>  		outfile);
Simon>        if (section)
Simon>  	gdb_printf (outfile, " section %s\n",
Simon> @@ -562,8 +562,8 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
Simon>  	{
Simon>  	case LOC_CONST:
Simon>  	  gdb_printf (outfile, "const %s (%s)",
Simon> -		      plongest (SYMBOL_VALUE (symbol)),
Simon> -		      hex_string (SYMBOL_VALUE (symbol)));
Simon> +		      plongest (symbol->value_longest ()),
Simon> +		      hex_string (symbol->value_longest ()));
Simon>  	  break;
 
Simon>  	case LOC_CONST_BYTES:
Simon> @@ -575,14 +575,13 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
Simon>  			pulongest (TYPE_LENGTH (type)));
Simon>  	    for (i = 0; i < TYPE_LENGTH (type); i++)
Simon>  	      gdb_printf (outfile, " %02x",
Simon> -			  (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]);
Simon> +			  (unsigned) symbol->value_bytes ()[i]);
Simon>  	  }
Simon>  	  break;
 
Simon>  	case LOC_STATIC:
Simon>  	  gdb_printf (outfile, "static at ");
Simon> -	  gdb_puts (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
Simon> -		    outfile);
Simon> +	  gdb_puts (paddress (gdbarch, symbol->value_address ()), outfile);
Simon>  	  if (section)
Simon>  	    gdb_printf (outfile, " section %s",
Simon>  			bfd_section_name (section->the_bfd_section));
Simon> @@ -591,30 +590,30 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
Simon>  	case LOC_REGISTER:
Simon>  	  if (symbol->is_argument ())
Simon>  	    gdb_printf (outfile, "parameter register %s",
Simon> -			plongest (SYMBOL_VALUE (symbol)));
Simon> +			plongest (symbol->value_longest ()));
Simon>  	  else
Simon>  	    gdb_printf (outfile, "register %s",
Simon> -			plongest (SYMBOL_VALUE (symbol)));
Simon> +			plongest (symbol->value_longest ()));
Simon>  	  break;
 
Simon>  	case LOC_ARG:
Simon>  	  gdb_printf (outfile, "arg at offset %s",
Simon> -		      hex_string (SYMBOL_VALUE (symbol)));
Simon> +		      hex_string (symbol->value_longest ()));
Simon>  	  break;
 
Simon>  	case LOC_REF_ARG:
Simon>  	  gdb_printf (outfile, "reference arg at %s",
Simon> -		      hex_string (SYMBOL_VALUE (symbol)));
Simon> +		      hex_string (symbol->value_longest ()));
Simon>  	  break;
 
Simon>  	case LOC_REGPARM_ADDR:
Simon>  	  gdb_printf (outfile, "address parameter register %s",
Simon> -		      plongest (SYMBOL_VALUE (symbol)));
Simon> +		      plongest (symbol->value_longest ()));
Simon>  	  break;
 
Simon>  	case LOC_LOCAL:
Simon>  	  gdb_printf (outfile, "local at offset %s",
Simon> -		      hex_string (SYMBOL_VALUE (symbol)));
Simon> +		      hex_string (symbol->value_longest ()));
Simon>  	  break;
 
Simon>  	case LOC_TYPEDEF:
Simon> @@ -622,8 +621,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
 
Simon>  	case LOC_LABEL:
Simon>  	  gdb_printf (outfile, "label at ");
Simon> -	  gdb_puts (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (symbol)),
Simon> -		    outfile);
Simon> +	  gdb_puts (paddress (gdbarch, symbol->value_address ()), outfile);
Simon>  	  if (section)
Simon>  	    gdb_printf (outfile, " section %s",
Simon>  			bfd_section_name (section->the_bfd_section));
Simon> @@ -632,9 +630,9 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
Simon>  	case LOC_BLOCK:
Simon>  	  gdb_printf
Simon>  	    (outfile, "block object %s, %s..%s",
Simon> -	     host_address_to_string (SYMBOL_BLOCK_VALUE (symbol)),
Simon> -	     paddress (gdbarch, BLOCK_START (SYMBOL_BLOCK_VALUE (symbol))),
Simon> -	     paddress (gdbarch, BLOCK_END (SYMBOL_BLOCK_VALUE (symbol))));
Simon> +	     host_address_to_string (symbol->value_block ()),
Simon> +	     paddress (gdbarch, BLOCK_START (symbol->value_block ())),
Simon> +	     paddress (gdbarch, BLOCK_END (symbol->value_block ())));
Simon>  	  if (section)
Simon>  	    gdb_printf (outfile, " section %s",
Simon>  			bfd_section_name (section->the_bfd_section));
Simon> diff --git a/gdb/symtab.c b/gdb/symtab.c
Simon> index 3cc2d4f8648c..d15eec8b6b49 100644
Simon> --- a/gdb/symtab.c
Simon> +++ b/gdb/symtab.c
Simon> @@ -414,6 +414,19 @@ compunit_language (const struct compunit_symtab *cust)
Simon>    return symtab->language ();
Simon>  }
 
Simon> +/* The relocated address of the minimal symbol, using the section
Simon> +   offsets from OBJFILE.  */
Simon> +
Simon> +CORE_ADDR
Simon> +minimal_symbol::value_address (objfile *objfile) const
Simon> +{
Simon> +  if (this->maybe_copied)
Simon> +    return get_msymbol_address (objfile, this);
Simon> +  else
Simon> +    return (this->value_raw_address ()
Simon> +	    + objfile->section_offsets[this->section_index ()]);
Simon> +}
Simon> +
Simon>  /* See symtab.h.  */
 
Simon>  bool
Simon> @@ -1805,10 +1818,10 @@ fixup_symbol_section (struct symbol *sym, struct objfile *objfile)
Simon>      {
Simon>      case LOC_STATIC:
Simon>      case LOC_LABEL:
Simon> -      addr = SYMBOL_VALUE_ADDRESS (sym);
Simon> +      addr = sym->value_address ();
Simon>        break;
Simon>      case LOC_BLOCK:
Simon> -      addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym));
Simon> +      addr = BLOCK_ENTRY_PC (sym->value_block ());
Simon>        break;
 
Simon>      default:
Simon> @@ -3083,7 +3096,7 @@ find_symbol_at_address (CORE_ADDR address)
Simon>  	  ALL_BLOCK_SYMBOLS (b, iter, sym)
Simon>  	    {
Simon>  	      if (sym->aclass () == LOC_STATIC
Simon> -		  && SYMBOL_VALUE_ADDRESS (sym) == addr)
Simon> +		  && sym->value_address () == addr)
Simon>  		return sym;
Simon>  	    }
Simon>  	}
Simon> @@ -3245,8 +3258,8 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
msymbol-> linkage_name ()); */
Simon>  	  ;
Simon>  	/* fall through */
Simon> -	else if (BMSYMBOL_VALUE_ADDRESS (mfunsym)
Simon> -		 == BMSYMBOL_VALUE_ADDRESS (msymbol))
Simon> +	else if (mfunsym.value_address ()
Simon> +		 == msymbol.value_address ())
Simon>  	  /* Avoid infinite recursion */
Simon>  	  /* See above comment about why warning is commented out.  */
Simon>  	  /* warning ("In stub for %s; unable to find real function/line info",
Simon> @@ -3258,12 +3271,12 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
Simon>  	    /* Detect an obvious case of infinite recursion.  If this
Simon>  	       should occur, we'd like to know about it, so error out,
Simon>  	       fatally.  */
Simon> -	    if (BMSYMBOL_VALUE_ADDRESS (mfunsym) == pc)
Simon> +	    if (mfunsym.value_address () == pc)
Simon>  	      internal_error (__FILE__, __LINE__,
Simon>  		_("Infinite recursion detected in find_pc_sect_line;"
Simon>  		  "please file a bug report"));
 
Simon> -	    return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
Simon> +	    return find_pc_line (mfunsym.value_address (), 0);
Simon>  	  }
Simon>        }
 
Simon> @@ -3766,7 +3779,7 @@ find_function_start_sal (symbol *sym, bool funfirstline)
Simon>  {
Simon>    fixup_symbol_section (sym, NULL);
Simon>    symtab_and_line sal
Simon> -    = find_function_start_sal_1 (BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)),
Simon> +    = find_function_start_sal_1 (BLOCK_ENTRY_PC (sym->value_block ()),
sym-> obj_section (symbol_objfile (sym)),
Simon>  				 funfirstline);
Simon>    sal.symbol = sym;
Simon> @@ -3895,7 +3908,7 @@ skip_prologue_sal (struct symtab_and_line *sal)
Simon>        fixup_symbol_section (sym, NULL);
 
Simon>        objfile = symbol_objfile (sym);
Simon> -      pc = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym));
Simon> +      pc = BLOCK_ENTRY_PC (sym->value_block ());
Simon>        section = sym->obj_section (objfile);
Simon>        name = sym->linkage_name ();
Simon>      }
Simon> @@ -3908,7 +3921,7 @@ skip_prologue_sal (struct symtab_and_line *sal)
Simon>  	return;
 
Simon>        objfile = msymbol.objfile;
Simon> -      pc = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +      pc = msymbol.value_address ();
Simon>        section = msymbol.minsym->obj_section (objfile);
Simon>        name = msymbol.minsym->linkage_name ();
Simon>      }
Simon> @@ -3971,8 +3984,8 @@ skip_prologue_sal (struct symtab_and_line *sal)
Simon>        /* Check if gdbarch_skip_prologue left us in mid-line, and the next
Simon>  	 line is still part of the same function.  */
Simon>        if (skip && start_sal.pc != pc
Simon> -	  && (sym ? (BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)) <= start_sal.end
Simon> -		     && start_sal.end < BLOCK_END (SYMBOL_BLOCK_VALUE (sym)))
Simon> +	  && (sym ? (BLOCK_ENTRY_PC (sym->value_block ()) <= start_sal.end
Simon> +		     && start_sal.end < BLOCK_END (sym->value_block ()))
Simon>  	      : (lookup_minimal_symbol_by_pc_section (start_sal.end, section).minsym
Simon>  		 == lookup_minimal_symbol_by_pc_section (pc, section).minsym)))
Simon>  	{
Simon> @@ -4169,7 +4182,7 @@ find_function_alias_target (bound_minimal_symbol msymbol)
Simon>    symbol *sym = find_pc_function (func_addr);
Simon>    if (sym != NULL
Simon>        && sym->aclass () == LOC_BLOCK
Simon> -      && BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)) == func_addr)
Simon> +      && BLOCK_ENTRY_PC (sym->value_block ()) == func_addr)
Simon>      return sym;
 
Simon>    return NULL;
Simon> @@ -4822,8 +4835,7 @@ global_symbol_searcher::expand_symtabs
Simon>  		     the symbols tables are expanded.  */
Simon>  		  if (kind == FUNCTIONS_DOMAIN
Simon>  		      ? (find_pc_compunit_symtab
Simon> -			 (MSYMBOL_VALUE_ADDRESS (objfile, msymbol))
Simon> -			 == NULL)
Simon> +			 (msymbol->value_address (objfile)) == NULL)
Simon>  		      : (lookup_symbol_in_objfile_from_linkage_name
Simon>  			 (objfile, msymbol->linkage_name (),
Simon>  			  VAR_DOMAIN)
Simon> @@ -4945,8 +4957,7 @@ global_symbol_searcher::add_matching_msymbols
Simon>  		 symbol might be found via find_pc_symtab.  */
Simon>  	      if (kind != FUNCTIONS_DOMAIN
Simon>  		  || (find_pc_compunit_symtab
Simon> -		      (MSYMBOL_VALUE_ADDRESS (objfile, msymbol))
Simon> -		      == NULL))
Simon> +		      (msymbol->value_address (objfile)) == NULL))
Simon>  		{
Simon>  		  if (lookup_symbol_in_objfile_from_linkage_name
Simon>  		      (objfile, msymbol->linkage_name (),
Simon> @@ -5168,11 +5179,11 @@ print_msymbol_info (struct bound_minimal_symbol msymbol)
Simon>    char *tmp;
 
Simon>    if (gdbarch_addr_bit (gdbarch) <= 32)
Simon> -    tmp = hex_string_custom (BMSYMBOL_VALUE_ADDRESS (msymbol)
Simon> +    tmp = hex_string_custom (msymbol.value_address ()
Simon>  			     & (CORE_ADDR) 0xffffffff,
Simon>  			     8);
Simon>    else
Simon> -    tmp = hex_string_custom (BMSYMBOL_VALUE_ADDRESS (msymbol),
Simon> +    tmp = hex_string_custom (msymbol.value_address (),
Simon>  			     16);
 
Simon>    ui_file_style sym_style = (msymbol.minsym->text_p ()
Simon> @@ -5780,7 +5791,7 @@ find_gnu_ifunc (const symbol *sym)
Simon>  				symbol_name_match_type::SEARCH_NAME);
Simon>    struct objfile *objfile = symbol_objfile (sym);
 
Simon> -  CORE_ADDR address = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym));
Simon> +  CORE_ADDR address = BLOCK_ENTRY_PC (sym->value_block ());
Simon>    minimal_symbol *ifunc = NULL;
 
Simon>    iterate_over_minimal_symbols (objfile, lookup_name,
Simon> @@ -5789,7 +5800,7 @@ find_gnu_ifunc (const symbol *sym)
Simon>        if (MSYMBOL_TYPE (minsym) == mst_text_gnu_ifunc
Simon>  	  || MSYMBOL_TYPE (minsym) == mst_data_gnu_ifunc)
Simon>  	{
Simon> -	  CORE_ADDR msym_addr = MSYMBOL_VALUE_ADDRESS (objfile, minsym);
Simon> +	  CORE_ADDR msym_addr = minsym->value_address (objfile);
Simon>  	  if (MSYMBOL_TYPE (minsym) == mst_data_gnu_ifunc)
Simon>  	    {
Simon>  	      struct gdbarch *gdbarch = objfile->arch ();
Simon> @@ -6634,9 +6645,9 @@ get_symbol_address (const struct symbol *sym)
Simon>        bound_minimal_symbol minsym
Simon>  	= lookup_minimal_symbol_linkage (linkage_name, objfile);
Simon>        if (minsym.minsym != nullptr)
Simon> -	return BMSYMBOL_VALUE_ADDRESS (minsym);
Simon> +	return minsym.value_address ();
Simon>      }
Simon> -  return sym->value.address;
Simon> +  return sym->m_value.address;
Simon>  }
 
Simon>  /* See symtab.h.  */
Simon> @@ -6657,10 +6668,10 @@ get_msymbol_address (struct objfile *objf, const struct minimal_symbol *minsym)
Simon>  	  bound_minimal_symbol found
Simon>  	    = lookup_minimal_symbol_linkage (linkage_name, objfile);
Simon>  	  if (found.minsym != nullptr)
Simon> -	    return BMSYMBOL_VALUE_ADDRESS (found);
Simon> +	    return found.value_address ();
Simon>  	}
Simon>      }
Simon> -  return (minsym->value.address
Simon> +  return (minsym->m_value.address
Simon>  	  + objf->section_offsets[minsym->section_index ()]);
Simon>  }
 
Simon> diff --git a/gdb/symtab.h b/gdb/symtab.h
Simon> index 0df5e2375640..390ee9d0d67d 100644
Simon> --- a/gdb/symtab.h
Simon> +++ b/gdb/symtab.h
Simon> @@ -475,6 +475,16 @@ struct general_symbol_info
Simon>  			      gdb::optional<hashval_t> hash
Simon>  				= gdb::optional<hashval_t> ());
 
Simon> +  CORE_ADDR value_address () const
Simon> +  {
Simon> +    return m_value.address;
Simon> +  }
Simon> +
Simon> +  void set_value_address (CORE_ADDR address)
Simon> +  {
Simon> +    m_value.address = address;
Simon> +  }
Simon> +
Simon>    /* Name of the symbol.  This is a required field.  Storage for the
Simon>       name is allocated on the objfile_obstack for the associated
Simon>       objfile.  For languages like C++ that make a distinction between
Simon> @@ -507,7 +517,7 @@ struct general_symbol_info
 
Simon>      struct symbol *chain;
Simon>    }
Simon> -  value;
Simon> +  m_value;
 
Simon>    /* Since one and only one language can apply, wrap the language specific
Simon>       information inside a union.  */
Simon> @@ -573,19 +583,6 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *);
 
Simon>  extern CORE_ADDR get_symbol_address (const struct symbol *sym);
 
Simon> -/* Note that these macros only work with symbol, not partial_symbol.  */
Simon> -
Simon> -#define SYMBOL_VALUE(symbol)		(symbol)->value.ivalue
Simon> -#define SYMBOL_VALUE_ADDRESS(symbol)			      \
Simon> -  (((symbol)->maybe_copied) ? get_symbol_address (symbol)     \
Simon> -   : ((symbol)->value.address))
Simon> -#define SET_SYMBOL_VALUE_ADDRESS(symbol, new_value)	\
Simon> -  ((symbol)->value.address = (new_value))
Simon> -#define SYMBOL_VALUE_BYTES(symbol)	(symbol)->value.bytes
Simon> -#define SYMBOL_VALUE_COMMON_BLOCK(symbol) (symbol)->value.common_block
Simon> -#define SYMBOL_BLOCK_VALUE(symbol)	(symbol)->value.block
Simon> -#define SYMBOL_VALUE_CHAIN(symbol)	(symbol)->value.chain
Simon> -
Simon>  /* Try to determine the demangled name for a symbol, based on the
Simon>     language of that symbol.  If the language is set to language_auto,
Simon>     it will attempt to find any demangling algorithm that works and
Simon> @@ -664,6 +661,15 @@ enum minimal_symbol_type
Simon>  #define MINSYM_TYPE_BITS 4
Simon>  gdb_static_assert (nr_minsym_types <= (1 << MINSYM_TYPE_BITS));
 
Simon> +/* Return the address of MINSYM, which comes from OBJF.  The
Simon> +   MAYBE_COPIED flag must be set on MINSYM.  If MINSYM appears in the
Simon> +   main program's minimal symbols, then that minsym's address is
Simon> +   returned; otherwise, MINSYM's address is returned.  This should
Simon> +   generally only be used via the MSYMBOL_VALUE_ADDRESS macro.  */
Simon> +
Simon> +extern CORE_ADDR get_msymbol_address (struct objfile *objf,
Simon> +				      const struct minimal_symbol *minsym);
Simon> +
Simon>  /* Define a simple structure used to hold some very basic information about
Simon>     all defined global symbols (text, data, bss, abs, etc).  The only required
Simon>     information is the general_symbol_info.
Simon> @@ -678,6 +684,21 @@ gdb_static_assert (nr_minsym_types <= (1 << MINSYM_TYPE_BITS));
 
Simon>  struct minimal_symbol : public general_symbol_info
Simon>  {
Simon> +  LONGEST value_longest () const
Simon> +  {
Simon> +    return m_value.ivalue;
Simon> +  }
Simon> +
Simon> +  /* The relocated address of the minimal symbol, using the section
Simon> +     offsets from OBJFILE.  */
Simon> +  CORE_ADDR value_address (objfile *objfile) const;
Simon> +
Simon> +  /* The unrelocated address of the minimal symbol.  */
Simon> +  CORE_ADDR value_raw_address () const
Simon> +  {
Simon> +    return m_value.address;
Simon> +  }
Simon> +
Simon>    /* Size of this symbol.  dbx_end_psymtab in dbxread.c uses this
Simon>       information to calculate the end of the partial symtab based on the
Simon>       address of the last symbol plus the size of the last symbol.  */
Simon> @@ -735,15 +756,6 @@ struct minimal_symbol : public general_symbol_info
Simon>    bool text_p () const;
Simon>  };
 
Simon> -/* Return the address of MINSYM, which comes from OBJF.  The
Simon> -   MAYBE_COPIED flag must be set on MINSYM.  If MINSYM appears in the
Simon> -   main program's minimal symbols, then that minsym's address is
Simon> -   returned; otherwise, MINSYM's address is returned.  This should
Simon> -   generally only be used via the MSYMBOL_VALUE_ADDRESS macro.  */
Simon> -
Simon> -extern CORE_ADDR get_msymbol_address (struct objfile *objf,
Simon> -				      const struct minimal_symbol *minsym);
Simon> -
Simon>  #define MSYMBOL_TARGET_FLAG_1(msymbol)  (msymbol)->target_flag_1
Simon>  #define MSYMBOL_TARGET_FLAG_2(msymbol)  (msymbol)->target_flag_2
Simon>  #define MSYMBOL_SIZE(msymbol)		((msymbol)->size + 0)
Simon> @@ -756,23 +768,6 @@ extern CORE_ADDR get_msymbol_address (struct objfile *objf,
Simon>  #define MSYMBOL_HAS_SIZE(msymbol)	((msymbol)->has_size + 0)
Simon>  #define MSYMBOL_TYPE(msymbol)		(msymbol)->type
 
Simon> -#define MSYMBOL_VALUE(symbol)		(symbol)->value.ivalue
Simon> -/* The unrelocated address of the minimal symbol.  */
Simon> -#define MSYMBOL_VALUE_RAW_ADDRESS(symbol) ((symbol)->value.address + 0)
Simon> -/* The relocated address of the minimal symbol, using the section
Simon> -   offsets from OBJFILE.  */
Simon> -#define MSYMBOL_VALUE_ADDRESS(objfile, symbol)				\
Simon> -  (((symbol)->maybe_copied) ? get_msymbol_address (objfile, symbol)	\
Simon> -   : ((symbol)->value.address						\
Simon> -      + (objfile)->section_offsets[(symbol)->section_index ()]))
Simon> -/* For a bound minsym, we can easily compute the address directly.  */
Simon> -#define BMSYMBOL_VALUE_ADDRESS(symbol) \
Simon> -  MSYMBOL_VALUE_ADDRESS ((symbol).objfile, (symbol).minsym)
Simon> -#define SET_MSYMBOL_VALUE_ADDRESS(symbol, new_value)	\
Simon> -  ((symbol)->value.address = (new_value))
Simon> -#define MSYMBOL_VALUE_BYTES(symbol)	(symbol)->value.bytes
Simon> -#define MSYMBOL_BLOCK_VALUE(symbol)	(symbol)->value.block
Simon> -
Simon>  #include "minsyms.h"
 
Simon>  \f
Simon> @@ -1124,7 +1119,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
Simon>        /* We can't use an initializer list for members of a base class, and
Simon>  	 general_symbol_info needs to stay a POD type.  */
Simon>        m_name = nullptr;
Simon> -      value.ivalue = 0;
Simon> +      m_value.ivalue = 0;
Simon>        language_specific.obstack = nullptr;
Simon>        m_language = language_unknown;
Simon>        ada_mangled = 0;
Simon> @@ -1222,6 +1217,69 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
Simon>      m_line = line;
Simon>    }
 
Simon> +  LONGEST value_longest () const
Simon> +  {
Simon> +    return m_value.ivalue;
Simon> +  }
Simon> +
Simon> +  void set_value_longest (LONGEST value)
Simon> +  {
Simon> +    m_value.ivalue = value;
Simon> +  }
Simon> +
Simon> +  CORE_ADDR value_address () const
Simon> +  {
Simon> +    if (this->maybe_copied)
Simon> +      return get_symbol_address (this);
Simon> +    else
Simon> +      return m_value.address;
Simon> +  }
Simon> +
Simon> +  void set_value_address (CORE_ADDR address)
Simon> +  {
Simon> +    m_value.address = address;
Simon> +  }
Simon> +
Simon> +  const gdb_byte *value_bytes () const
Simon> +  {
Simon> +    return m_value.bytes;
Simon> +  }
Simon> +
Simon> +  void set_value_bytes (const gdb_byte *bytes)
Simon> +  {
Simon> +    m_value.bytes = bytes;
Simon> +  }
Simon> +
Simon> +  const common_block *value_common_block () const
Simon> +  {
Simon> +    return m_value.common_block;
Simon> +  }
Simon> +
Simon> +  void set_value_common_block (const common_block *common_block)
Simon> +  {
Simon> +    m_value.common_block = common_block;
Simon> +  }
Simon> +
Simon> +  const block *value_block () const
Simon> +  {
Simon> +    return m_value.block;
Simon> +  }
Simon> +
Simon> +  void set_value_block (const block *block)
Simon> +  {
Simon> +    m_value.block = block;
Simon> +  }
Simon> +
Simon> +  symbol *value_chain () const
Simon> +  {
Simon> +    return m_value.chain;
Simon> +  }
Simon> +
Simon> +  void set_value_chain (symbol *sym)
Simon> +  {
Simon> +    m_value.chain = sym;
Simon> +  }
Simon> +
Simon>    /* Data type of value */
 
Simon>    struct type *m_type = nullptr;
Simon> diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
Simon> index b45763ec02b8..5a4048f9078c 100644
Simon> --- a/gdb/tracepoint.c
Simon> +++ b/gdb/tracepoint.c
Simon> @@ -696,7 +696,7 @@ validate_actionline (const char *line, struct breakpoint *b)
Simon>  		      error (_("constant `%s' (value %s) "
Simon>  			       "will not be collected."),
sym-> print_name (),
Simon> -			     plongest (SYMBOL_VALUE (sym)));
Simon> +			     plongest (sym->value_longest ()));
Simon>  		    }
Simon>  		  else if (sym->aclass () == LOC_OPTIMIZED_OUT)
Simon>  		    {
Simon> @@ -931,10 +931,10 @@ collection_list::collect_symbol (struct symbol *sym,
Simon>        break;
Simon>      case LOC_CONST:
Simon>        gdb_printf ("constant %s (value %s) will not be collected.\n",
Simon> -		  sym->print_name (), plongest (SYMBOL_VALUE (sym)));
Simon> +		  sym->print_name (), plongest (sym->value_longest ()));
Simon>        break;
Simon>      case LOC_STATIC:
Simon> -      offset = SYMBOL_VALUE_ADDRESS (sym);
Simon> +      offset = sym->value_address ();
Simon>        if (info_verbose)
Simon>  	{
Simon>  	  gdb_printf ("LOC_STATIC %s: collect %ld bytes at %s.\n",
Simon> @@ -965,7 +965,7 @@ collection_list::collect_symbol (struct symbol *sym,
Simon>        break;
Simon>      case LOC_ARG:
Simon>        reg = frame_regno;
Simon> -      offset = frame_offset + SYMBOL_VALUE (sym);
Simon> +      offset = frame_offset + sym->value_longest ();
Simon>        if (info_verbose)
Simon>  	{
Simon>  	  gdb_printf ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
Simon> @@ -975,7 +975,7 @@ collection_list::collect_symbol (struct symbol *sym,
Simon>        add_memrange (gdbarch, reg, offset, len, scope);
Simon>        break;
Simon>      case LOC_REGPARM_ADDR:
Simon> -      reg = SYMBOL_VALUE (sym);
Simon> +      reg = sym->value_longest ();
Simon>        offset = 0;
Simon>        if (info_verbose)
Simon>  	{
Simon> @@ -987,7 +987,7 @@ collection_list::collect_symbol (struct symbol *sym,
Simon>        break;
Simon>      case LOC_LOCAL:
Simon>        reg = frame_regno;
Simon> -      offset = frame_offset + SYMBOL_VALUE (sym);
Simon> +      offset = frame_offset + sym->value_longest ();
Simon>        if (info_verbose)
Simon>  	{
Simon>  	  gdb_printf ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
Simon> @@ -2526,20 +2526,18 @@ info_scope_command (const char *args_in, int from_tty)
Simon>  		  continue;
Simon>  		case LOC_CONST:
Simon>  		  gdb_printf ("a constant with value %s (%s)",
Simon> -			      plongest (SYMBOL_VALUE (sym)),
Simon> -			      hex_string (SYMBOL_VALUE (sym)));
Simon> +			      plongest (sym->value_longest ()),
Simon> +			      hex_string (sym->value_longest ()));
Simon>  		  break;
Simon>  		case LOC_CONST_BYTES:
Simon>  		  gdb_printf ("constant bytes: ");
Simon>  		  if (sym->type ())
Simon>  		    for (j = 0; j < TYPE_LENGTH (sym->type ()); j++)
Simon> -		      gdb_printf (" %02x",
Simon> -				  (unsigned) SYMBOL_VALUE_BYTES (sym)[j]);
Simon> +		      gdb_printf (" %02x", (unsigned) sym->value_bytes ()[j]);
Simon>  		  break;
Simon>  		case LOC_STATIC:
Simon>  		  gdb_printf ("in static storage at address ");
Simon> -		  gdb_printf ("%s", paddress (gdbarch,
Simon> -					      SYMBOL_VALUE_ADDRESS (sym)));
Simon> +		  gdb_printf ("%s", paddress (gdbarch, sym->value_address ()));
Simon>  		  break;
Simon>  		case LOC_REGISTER:
Simon>  		  /* GDBARCH is the architecture associated with the objfile
Simon> @@ -2561,15 +2559,15 @@ info_scope_command (const char *args_in, int from_tty)
Simon>  		  break;
Simon>  		case LOC_ARG:
Simon>  		  gdb_printf ("an argument at stack/frame offset %s",
Simon> -			      plongest (SYMBOL_VALUE (sym)));
Simon> +			      plongest (sym->value_longest ()));
Simon>  		  break;
Simon>  		case LOC_LOCAL:
Simon>  		  gdb_printf ("a local variable at frame offset %s",
Simon> -			      plongest (SYMBOL_VALUE (sym)));
Simon> +			      plongest (sym->value_longest ()));
Simon>  		  break;
Simon>  		case LOC_REF_ARG:
Simon>  		  gdb_printf ("a reference argument at offset %s",
Simon> -			      plongest (SYMBOL_VALUE (sym)));
Simon> +			      plongest (sym->value_longest ()));
Simon>  		  break;
Simon>  		case LOC_REGPARM_ADDR:
Simon>  		  /* Note comment at LOC_REGISTER.  */
Simon> @@ -2583,13 +2581,13 @@ info_scope_command (const char *args_in, int from_tty)
Simon>  		  continue;
Simon>  		case LOC_LABEL:
Simon>  		  gdb_printf ("a label at address ");
Simon> -		  gdb_printf ("%s", paddress (gdbarch,
Simon> -					      SYMBOL_VALUE_ADDRESS (sym)));
Simon> +		  gdb_printf ("%s", paddress (gdbarch, sym->value_address ()));
Simon>  		  break;
Simon>  		case LOC_BLOCK:
Simon>  		  gdb_printf ("a function at address ");
Simon>  		  gdb_printf ("%s",
Simon> -			      paddress (gdbarch, BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym))));
Simon> +			      paddress (gdbarch,
Simon> +					BLOCK_ENTRY_PC (sym->value_block ())));
Simon>  		  break;
Simon>  		case LOC_UNRESOLVED:
Simon>  		  msym = lookup_minimal_symbol (sym->linkage_name (),
Simon> @@ -2600,8 +2598,7 @@ info_scope_command (const char *args_in, int from_tty)
Simon>  		    {
Simon>  		      gdb_printf ("static storage at address ");
Simon>  		      gdb_printf ("%s",
Simon> -				  paddress (gdbarch,
Simon> -					    BMSYMBOL_VALUE_ADDRESS (msym)));
Simon> +				  paddress (gdbarch, msym.value_address ()));
Simon>  		    }
Simon>  		  break;
Simon>  		case LOC_OPTIMIZED_OUT:
Simon> diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
Simon> index 70f7429d32b4..2cb9c75ca8da 100644
Simon> --- a/gdb/tui/tui-disasm.c
Simon> +++ b/gdb/tui/tui-disasm.c
Simon> @@ -168,9 +168,9 @@ tui_find_backward_disassembly_start_address (CORE_ADDR addr)
Simon>  					      lookup_msym_prefer::TEXT,
Simon>  					      &msym_prev);
Simon>    if (msym.minsym != nullptr)
Simon> -    return BMSYMBOL_VALUE_ADDRESS (msym);
Simon> +    return msym.value_address ();
Simon>    else if (msym_prev.minsym != nullptr)
Simon> -    return BMSYMBOL_VALUE_ADDRESS (msym_prev);
Simon> +    return msym_prev.value_address ();
 
Simon>    /* Find the section that ADDR is in, and look for the start of the
Simon>       section.  */
Simon> @@ -404,7 +404,7 @@ tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
Simon>  	  struct bound_minimal_symbol main_symbol
Simon>  	    = lookup_minimal_symbol (main_name (), nullptr, nullptr);
Simon>  	  if (main_symbol.minsym != nullptr)
Simon> -	    addr = BMSYMBOL_VALUE_ADDRESS (main_symbol);
Simon> +	    addr = main_symbol.value_address ();
Simon>  	}
Simon>      }
Simon>    else				/* The target is executing.  */
Simon> diff --git a/gdb/valops.c b/gdb/valops.c
Simon> index 67209ce6cd8c..42a1213b0c55 100644
Simon> --- a/gdb/valops.c
Simon> +++ b/gdb/valops.c
Simon> @@ -146,7 +146,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p)
Simon>  	  type = lookup_pointer_type (builtin_type (gdbarch)->builtin_char);
Simon>  	  type = lookup_function_type (type);
Simon>  	  type = lookup_pointer_type (type);
Simon> -	  maddr = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +	  maddr = msymbol.value_address ();
 
Simon>  	  if (objf_p)
Simon>  	    *objf_p = objfile;
Simon> diff --git a/gdb/value.c b/gdb/value.c
Simon> index 24f1151c03f0..08cccf711b22 100644
Simon> --- a/gdb/value.c
Simon> +++ b/gdb/value.c
Simon> @@ -2986,7 +2986,7 @@ value_static_field (struct type *type, int fieldno)
Simon>  	  if (!msym.minsym)
Simon>  	    retval = allocate_optimized_out_value (field_type);
Simon>  	  else
Simon> -	    retval = value_at_lazy (field_type, BMSYMBOL_VALUE_ADDRESS (msym));
Simon> +	    retval = value_at_lazy (field_type, msym.value_address ());
Simon>  	}
Simon>        else
Simon>  	retval = value_of_variable (sym.symbol, sym.block);
Simon> @@ -3184,7 +3184,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f,
Simon>    VALUE_LVAL (v) = lval_memory;
Simon>    if (sym)
Simon>      {
Simon> -      set_value_address (v, BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)));
Simon> +      set_value_address (v, BLOCK_ENTRY_PC (sym->value_block ()));
Simon>      }
Simon>    else
Simon>      {
Simon> @@ -3195,7 +3195,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f,
 
Simon>        set_value_address (v,
Simon>  	gdbarch_convert_from_func_ptr_addr
Simon> -	   (gdbarch, BMSYMBOL_VALUE_ADDRESS (msym),
Simon> +	   (gdbarch, msym.value_address (),
Simon>  	    current_inferior ()->top_target ()));
Simon>      }
 
Simon> diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
Simon> index e45fa275c095..c5d2d0a492f8 100644
Simon> --- a/gdb/xcoffread.c
Simon> +++ b/gdb/xcoffread.c
Simon> @@ -1563,7 +1563,7 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
Simon>      ++name;
 
Simon>    /* default assumptions */
Simon> -  SET_SYMBOL_VALUE_ADDRESS (sym, cs->c_value + off);
Simon> +  sym->set_value_address (cs->c_value + off);
sym-> set_domain (VAR_DOMAIN);
sym-> set_section_index (secnum_to_section (cs->c_secnum, objfile));
 
Simon> @@ -1660,9 +1660,8 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
cs-> c_name, 0, 0, objfile);
Simon>  	  if (sym != NULL)
Simon>  	    {
Simon> -	      SET_SYMBOL_VALUE_ADDRESS (sym,
Simon> -					SYMBOL_VALUE_ADDRESS (sym)
Simon> -					+ static_block_base);
Simon> +	      sym->set_value_address
Simon> +		(sym->value_address () + static_block_base);
sym-> set_section_index (static_block_section);
Simon>  	    }
Simon>  	  return sym;
Simon> diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c
Simon> index a252574c94e2..c2d906d14025 100644
Simon> --- a/gdb/z80-tdep.c
Simon> +++ b/gdb/z80-tdep.c
Simon> @@ -360,7 +360,7 @@ z80_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
Simon>        msymbol = lookup_minimal_symbol ("__sdcc_enter_ix", NULL, NULL);
Simon>        if (msymbol.minsym)
Simon>  	{
Simon> -	  value = BMSYMBOL_VALUE_ADDRESS (msymbol);
Simon> +	  value = msymbol.value_address ();
Simon>  	  if (value == extract_unsigned_integer (&prologue[pos+1], addr_len, byte_order))
Simon>  	    {
Simon>  	      pos += 1 + addr_len;
Simon> @@ -625,7 +625,7 @@ z80_frame_unwind_cache (struct frame_info *this_frame,
Simon>  		  msymbol = lookup_minimal_symbol (names[i], NULL, NULL);
Simon>  		  if (!msymbol.minsym)
Simon>  		    continue;
Simon> -		  if (addr == BMSYMBOL_VALUE_ADDRESS (msymbol))
Simon> +		  if (addr == msymbol.value_address ())
Simon>  		    break;
Simon>  		}
Simon>  	      if (i >= 0)
Simon> @@ -722,7 +722,7 @@ z80_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
Simon>        struct bound_minimal_symbol bh;
Simon>        bh = lookup_minimal_symbol ("_break_handler", NULL, NULL);
Simon>        if (bh.minsym)
Simon> -	addr = BMSYMBOL_VALUE_ADDRESS (bh);
Simon> +	addr = bh.value_address ();
Simon>        else
Simon>  	{
Simon>  	  warning(_("Unable to determine inferior's software breakpoint type: "
Simon> @@ -927,14 +927,13 @@ z80_read_overlay_region_table ()
Simon>    word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
Simon>    byte_order = gdbarch_byte_order (gdbarch);
 
Simon> -  cache_novly_regions = read_memory_integer (
Simon> -				BMSYMBOL_VALUE_ADDRESS (novly_regions_msym),
Simon> -				4, byte_order);
Simon> +  cache_novly_regions = read_memory_integer (novly_regions_msym.value_address (),
Simon> +                                             4, byte_order);
Simon>    cache_ovly_region_table
Simon>      = (unsigned int (*)[3]) xmalloc (cache_novly_regions *
Simon>  					sizeof (*cache_ovly_region_table));
Simon>    cache_ovly_region_table_base
Simon> -    = BMSYMBOL_VALUE_ADDRESS (ovly_region_table_msym);
Simon> +    = ovly_region_table_msym.value_address ();
Simon>    read_target_long_array (cache_ovly_region_table_base,
Simon>  			  (unsigned int *) cache_ovly_region_table,
Simon>  			  cache_novly_regions * 3, word_size, byte_order);

Simon> base-commit: f190d13c78ba4b98d272cbb4e9a8f19b49b575de
Simon> -- 

Simon> 2.35.1



Tom

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] gdb: remove symbol value macros
  2022-04-10 12:51 [PATCH 1/4] gdb: remove symbol value macros Simon Marchi
                   ` (3 preceding siblings ...)
  2022-04-10 21:36 ` [PATCH 1/4] gdb: remove symbol value macros Tom Tromey
@ 2022-04-10 21:36 ` Tom Tromey
  2022-04-11 14:48   ` Simon Marchi
  4 siblings, 1 reply; 10+ messages in thread
From: Tom Tromey @ 2022-04-10 21:36 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches; +Cc: Simon Marchi, Simon Marchi

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> From: Simon Marchi <simon.marchi@efficios.com>
Simon> Remove all macros related to getting and setting some symbol value:

Ugh, finger slip on that last email.
I like your patch better than the one I wrote, looking forward to it
going in.

thanks,
Tom

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] gdb: remove symbol value macros
  2022-04-10 21:36 ` Tom Tromey
@ 2022-04-11 14:48   ` Simon Marchi
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Marchi @ 2022-04-11 14:48 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi via Gdb-patches; +Cc: Simon Marchi

On 2022-04-10 17:36, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Simon> From: Simon Marchi <simon.marchi@efficios.com>
> Simon> Remove all macros related to getting and setting some symbol value:
>
> Ugh, finger slip on that last email.
> I like your patch better than the one I wrote, looking forward to it
> going in.
>
> thanks,
> Tom

Pushed, thanks.

Simon

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/4] gdb: remove MSYMBOL_TYPE macro
  2022-04-10 12:51 ` [PATCH 2/4] gdb: remove MSYMBOL_TYPE macro Simon Marchi
@ 2022-04-12 15:54   ` Tom Tromey
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2022-04-12 15:54 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches; +Cc: Simon Marchi, Simon Marchi

Simon> Add a getter and a setter for a minimal symbol's type.  Remove the
Simon> corresponding macro and adjust all callers.

Looks good.  Thank you.

Tom

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/4] gdb: remove minimal symbol size macros
  2022-04-10 12:51 ` [PATCH 3/4] gdb: remove minimal symbol size macros Simon Marchi
@ 2022-04-12 15:54   ` Tom Tromey
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2022-04-12 15:54 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches; +Cc: Simon Marchi, Simon Marchi

Simon> Remove MSYMBOL_HAS_SIZE, MSYMBOL_SIZE and SET_MSYMBOL_SIZE, replace them
Simon> with equivalent methods.

Looks good, thank you.

Tom

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] gdb: remove MSYMBOL_TARGET_FLAG_{1,2} macros
  2022-04-10 12:51 ` [PATCH 4/4] gdb: remove MSYMBOL_TARGET_FLAG_{1,2} macros Simon Marchi
@ 2022-04-12 15:55   ` Tom Tromey
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2022-04-12 15:55 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches; +Cc: Simon Marchi, Simon Marchi

Simon> Replace with equivalent getter/setter macros.

Looks good to me.  Thanks for doing this.

Tom

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-04-12 15:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-10 12:51 [PATCH 1/4] gdb: remove symbol value macros Simon Marchi
2022-04-10 12:51 ` [PATCH 2/4] gdb: remove MSYMBOL_TYPE macro Simon Marchi
2022-04-12 15:54   ` Tom Tromey
2022-04-10 12:51 ` [PATCH 3/4] gdb: remove minimal symbol size macros Simon Marchi
2022-04-12 15:54   ` Tom Tromey
2022-04-10 12:51 ` [PATCH 4/4] gdb: remove MSYMBOL_TARGET_FLAG_{1,2} macros Simon Marchi
2022-04-12 15:55   ` Tom Tromey
2022-04-10 21:36 ` [PATCH 1/4] gdb: remove symbol value macros Tom Tromey
2022-04-10 21:36 ` Tom Tromey
2022-04-11 14:48   ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).