[06/30] Use block_symbol::address in tracepoint.c

Message ID 20231029-split-objfile-2023-bound-sym-october-v1-6-612531df2734@tromey.com
State New
Headers
Series Baby step for objfile splitting |

Commit Message

Tom Tromey Oct. 29, 2023, 11:23 p.m. UTC
  This changes the easy spots in tracepoint.c to use
block_symbol::address.
---
 gdb/tracepoint.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 2c548688570..89611114c9b 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -2489,6 +2489,8 @@  info_scope_command (const char *args_in, int from_tty)
       QUIT;			/* Allow user to bail out with ^C.  */
       for (struct symbol *sym : block_iterator_range (block))
 	{
+	  block_symbol bsym { sym, block };
+
 	  QUIT;			/* Allow user to bail out with ^C.  */
 	  if (count == 0)
 	    gdb_printf ("Scope for %s:\n", save_args);
@@ -2529,7 +2531,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 +2575,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 ");