aboutsummaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r--gdb/printcmd.c44
1 files changed, 17 insertions, 27 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 1d6a492..19fbc20 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1,6 +1,6 @@
/* Print values for GNU debugger GDB.
- Copyright (C) 1986-2024 Free Software Foundation, Inc.
+ Copyright (C) 1986-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -43,7 +43,6 @@
#include "disasm.h"
#include "target-float.h"
#include "observable.h"
-#include "solist.h"
#include "parser-defs.h"
#include "charset.h"
#include "arch-utils.h"
@@ -56,7 +55,6 @@
#include "gdbsupport/byte-vector.h"
#include <optional>
#include "gdbsupport/gdb-safe-ctype.h"
-#include "gdbsupport/rsp-low.h"
#include "inferior.h"
/* Chain containing all defined memory-tag subcommands. */
@@ -606,7 +604,6 @@ build_address_symbolic (struct gdbarch *gdbarch,
int *line, /* OUT */
int *unmapped) /* OUT */
{
- struct bound_minimal_symbol msymbol;
struct symbol *symbol;
CORE_ADDR name_location = 0;
struct obj_section *section = NULL;
@@ -638,7 +635,8 @@ build_address_symbolic (struct gdbarch *gdbarch,
save some memory, but for many debug format--ELF/DWARF or
anything/stabs--it would be inconvenient to eliminate those minimal
symbols anyway). */
- msymbol = lookup_minimal_symbol_by_pc_section (addr, section);
+ bound_minimal_symbol msymbol
+ = lookup_minimal_symbol_by_pc_section (addr, section);
symbol = find_pc_sect_function (addr, section);
if (symbol)
@@ -1322,7 +1320,9 @@ process_print_command_args (const char *args, value_print_options *print_opts,
value, so invert it for parse_expression. */
parser_flags flags = 0;
if (!voidprint)
- flags = PARSER_VOID_CONTEXT;
+ flags |= PARSER_VOID_CONTEXT;
+ if (parser_debug)
+ flags |= PARSER_DEBUG;
expression_up expr = parse_expression (exp, nullptr, flags);
return expr->evaluate ();
}
@@ -1575,7 +1575,6 @@ info_address_command (const char *exp, int from_tty)
struct gdbarch *gdbarch;
int regno;
struct symbol *sym;
- struct bound_minimal_symbol msymbol;
long val;
struct obj_section *section;
CORE_ADDR load_addr, context_pc = 0;
@@ -1601,7 +1600,8 @@ info_address_command (const char *exp, int from_tty)
return;
}
- msymbol = lookup_bound_minimal_symbol (exp);
+ bound_minimal_symbol msymbol
+ = lookup_minimal_symbol (current_program_space, exp);
if (msymbol.minsym != NULL)
{
@@ -1753,9 +1753,9 @@ info_address_command (const char *exp, int from_tty)
case LOC_UNRESOLVED:
{
- struct bound_minimal_symbol msym;
-
- msym = lookup_bound_minimal_symbol (sym->linkage_name ());
+ bound_minimal_symbol msym
+ = lookup_minimal_symbol (current_program_space,
+ sym->linkage_name ());
if (msym.minsym == NULL)
gdb_printf ("unresolved");
else
@@ -2294,11 +2294,11 @@ disable_display_command (const char *args, int from_tty)
static void
clear_dangling_display_expressions (struct objfile *objfile)
{
- program_space *pspace = objfile->pspace;
+ program_space *pspace = objfile->pspace ();
if (objfile->separate_debug_objfile_backlink)
{
objfile = objfile->separate_debug_objfile_backlink;
- gdb_assert (objfile->pspace == pspace);
+ gdb_assert (objfile->pspace () == pspace);
}
for (auto &d : all_displays)
@@ -2394,7 +2394,7 @@ printf_c_string (struct ui_file *stream, const char *format,
}
else
{
- CORE_ADDR tem = value_as_address (value);;
+ CORE_ADDR tem = value_as_address (value);
if (tem == 0)
{
@@ -2885,7 +2885,7 @@ static void
printf_command (const char *arg, int from_tty)
{
ui_printf (arg, gdb_stdout);
- gdb_stdout->reset_style ();
+ gdb_stdout->emit_style_escape (ui_file_style ());
gdb_stdout->wrap_here (0);
gdb_stdout->flush ();
}
@@ -2922,14 +2922,6 @@ show_memory_tagging_unsupported (void)
" architecture."));
}
-/* Implement the "memory-tag" prefix command. */
-
-static void
-memory_tag_command (const char *arg, int from_tty)
-{
- help_list (memory_tag_list, "memory-tag ", all_commands, gdb_stdout);
-}
-
/* Helper for print-logical-tag and print-allocation-tag. */
static void
@@ -3191,9 +3183,7 @@ memory_tag_check_command (const char *args, int from_tty)
}
}
-void _initialize_printcmd ();
-void
-_initialize_printcmd ()
+INIT_GDB_FILE (printcmd)
{
struct cmd_list_element *c;
@@ -3386,7 +3376,7 @@ Convert the arguments to a string as \"printf\" would, but then\n\
treat this string as a command line, and evaluate it."));
/* Memory tagging commands. */
- add_prefix_cmd ("memory-tag", class_vars, memory_tag_command, _("\
+ add_basic_prefix_cmd ("memory-tag", class_vars, _("\
Generic command for printing and manipulating memory tag properties."),
&memory_tag_list, 0, &cmdlist);
add_cmd ("print-logical-tag", class_vars,