[v2,07/31] Use bound_symbol::address in tracepoint.c

Message ID 20231105-split-objfile-2023-bound-sym-october-v2-7-dbd2d158bbc3@tromey.com
State New
Headers
Series Baby step for objfile splitting |

Commit Message

Tom Tromey Nov. 5, 2023, 6:11 p.m. UTC
  This changes the easy spots in tracepoint.c to use
bound_symbol::address.
---
 gdb/tracepoint.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 2c548688570..6eb40153e24 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -2484,11 +2484,15 @@  info_scope_command (const char *args_in, int from_tty)
   resolve_sal_pc (&sals[0]);
   block = block_for_pc (sals[0].pc);
 
+  struct objfile *objfile = block->objfile ();
+
   while (block != 0)
     {
       QUIT;			/* Allow user to bail out with ^C.  */
       for (struct symbol *sym : block_iterator_range (block))
 	{
+	  bound_symbol bsym { sym, objfile };
+
 	  QUIT;			/* Allow user to bail out with ^C.  */
 	  if (count == 0)
 	    gdb_printf ("Scope for %s:\n", save_args);
@@ -2529,7 +2533,7 @@  info_scope_command (const char *args_in, int from_tty)
 		  break;
 		case LOC_STATIC:
 		  gdb_printf ("in static storage at address ");
-		  gdb_printf ("%s", paddress (gdbarch, sym->value_address ()));
+		  gdb_printf ("%s", paddress (gdbarch, bsym.address ()));
 		  break;
 		case LOC_REGISTER:
 		  /* GDBARCH is the architecture associated with the objfile
@@ -2573,7 +2577,7 @@  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, sym->value_address ()));
+		  gdb_printf ("%s", paddress (gdbarch, bsym.address ()));
 		  break;
 		case LOC_BLOCK:
 		  gdb_printf ("a function at address ");