From: Tankut Baris Aktemur Date: Thu, 5 Mar 2026 15:07:54 +0000 (+0100) Subject: gdb: remove last_examine_address X-Git-Tag: binutils-2_47~1238 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c2fe40ecea74a4680fd9d6d63024908d785cd2c;p=thirdparty%2Fbinutils-gdb.git gdb: remove last_examine_address Remove the global variable `last_examine_address`. It can be obtained from another global variable, `last_examine_value`. Reviewed-By: Keith Seitz Approved-By: Tom Tromey --- diff --git a/gdb/printcmd.c b/gdb/printcmd.c index d7abbcc499b..193080ef75c 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -85,10 +85,6 @@ static CORE_ADDR next_address; static int branch_delay_insns; -/* Last address examined. */ - -static CORE_ADDR last_examine_address; - /* Contents of last address examined. This is not valid past the end of the `x' command! */ @@ -1164,9 +1160,6 @@ do_examine (struct format_data fmt, struct gdbarch *gdbarch, CORE_ADDR addr) i--, count--) { gdb_printf ("\t"); - /* Note that print_formatted sets next_address for the next - object. */ - last_examine_address = next_address; /* The value to be displayed is not fetched greedily. Instead, to avoid the possibility of a fetched value not @@ -1176,7 +1169,10 @@ do_examine (struct format_data fmt, struct gdbarch *gdbarch, CORE_ADDR addr) the address stored in LAST_EXAMINE_VALUE. FIXME: Should the disassembler be modified so that LAST_EXAMINE_VALUE is left with the byte sequence from the last complete - instruction fetched from memory? */ + instruction fetched from memory? + + Note that print_formatted sets NEXT_ADDRESS for the next + object. */ last_examine_value = release_value (value_at_lazy (val_type, next_address)); @@ -1883,6 +1879,7 @@ x_command (const char *exp, int from_tty) the correct pointer type. */ struct type *pointer_type = lookup_pointer_type (last_examine_value->type ()); + CORE_ADDR last_examine_address = last_examine_value->address (); set_internalvar (lookup_internalvar ("_"), value_from_pointer (pointer_type, last_examine_address));