GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Functions | Variables
printcmd.c File Reference
#include "defs.h"
#include "frame.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "value.h"
#include "language.h"
#include "c-lang.h"
#include "expression.h"
#include "gdbcore.h"
#include "gdbcmd.h"
#include "target.h"
#include "breakpoint.h"
#include "demangle.h"
#include "gdb-demangle.h"
#include "valprint.h"
#include "annotate.h"
#include "symfile.h"
#include "objfiles.h"
#include "completer.h"
#include "ui-out.h"
#include "block.h"
#include "disasm.h"
#include "target-float.h"
#include "observable.h"
#include "solist.h"
#include "parser-defs.h"
#include "charset.h"
#include "arch-utils.h"
#include "cli/cli-utils.h"
#include "cli/cli-option.h"
#include "cli/cli-script.h"
#include "cli/cli-style.h"
#include "gdbsupport/format.h"
#include "source.h"
#include "gdbsupport/byte-vector.h"
#include "gdbsupport/gdb_optional.h"
#include "gdbsupport/gdb-safe-ctype.h"
#include "gdbsupport/rsp-low.h"

Go to the source code of this file.

Classes

struct  display
 

Functions

static void show_max_symbolic_offset (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static void show_print_symbol_filename (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static void do_one_display (struct display *)
 
static struct format_data decode_format (const char **string_ptr, int oformat, int osize)
 
static void print_formatted (struct value *val, int size, const struct value_print_options *options, struct ui_file *stream)
 
static struct typefloat_type_from_length (struct type *type)
 
void print_scalar_formatted (const gdb_byte *valaddr, struct type *type, const struct value_print_options *options, int size, struct ui_file *stream)
 
void set_next_address (struct gdbarch *gdbarch, CORE_ADDR addr)
 
int print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr, struct ui_file *stream, int do_demangle, const char *leadin)
 
int build_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr, bool do_demangle, bool prefer_sym_over_minsym, std::string *name, int *offset, std::string *filename, int *line, int *unmapped)
 
void print_address (struct gdbarch *gdbarch, CORE_ADDR addr, struct ui_file *stream)
 
const char * pc_prefix (CORE_ADDR addr)
 
int print_address_demangle (const struct value_print_options *opts, struct gdbarch *gdbarch, CORE_ADDR addr, struct ui_file *stream, int do_demangle)
 
static CORE_ADDR find_instruction_backward (struct gdbarch *gdbarch, CORE_ADDR addr, int inst_count, int *inst_read)
 
static int read_memory_backward (struct gdbarch *gdbarch, CORE_ADDR memaddr, gdb_byte *myaddr, int len)
 
static int integer_is_zero (const gdb_byte *x, int len)
 
static CORE_ADDR find_string_backward (struct gdbarch *gdbarch, CORE_ADDR addr, int count, int char_size, const struct value_print_options *options, int *strings_counted)
 
static void do_examine (struct format_data fmt, struct gdbarch *gdbarch, CORE_ADDR addr)
 
static void validate_format (struct format_data fmt, const char *cmdname)
 
void print_command_parse_format (const char **expp, const char *cmdname, value_print_options *opts)
 
void print_value (value *val, const value_print_options &opts)
 
static bool should_validate_memtags (struct value *value)
 
static struct valueprocess_print_command_args (const char *args, value_print_options *print_opts, bool voidprint)
 
static void print_command_1 (const char *args, int voidprint)
 
static bool skip_over_slash_fmt (completion_tracker &tracker, const char **args)
 
void print_command_completer (struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *)
 
static void print_command (const char *exp, int from_tty)
 
static void call_command (const char *exp, int from_tty)
 
void output_command (const char *exp, int from_tty)
 
static void set_command (const char *exp, int from_tty)
 
static void info_symbol_command (const char *arg, int from_tty)
 
static void info_address_command (const char *exp, int from_tty)
 
static void x_command (const char *exp, int from_tty)
 
static void display_and_x_command_completer (struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *)
 
static void display_command (const char *arg, int from_tty)
 
void clear_displays ()
 
static void delete_display (struct display *display)
 
static void map_display_numbers (const char *args, gdb::function_view< void(struct display *)> function)
 
static void undisplay_command (const char *args, int from_tty)
 
void do_displays (void)
 
void disable_display (int num)
 
void disable_current_display (void)
 
static void info_display_command (const char *ignore, int from_tty)
 
static void enable_disable_display_command (const char *args, int from_tty, bool enable)
 
static void enable_display_command (const char *args, int from_tty)
 
static void disable_display_command (const char *args, int from_tty)
 
static void clear_dangling_display_expressions (struct objfile *objfile)
 
void print_variable_and_value (const char *name, struct symbol *var, frame_info_ptr frame, struct ui_file *stream, int indent)
 
static void printf_c_string (struct ui_file *stream, const char *format, struct value *value)
 
static void printf_wide_c_string (struct ui_file *stream, const char *format, struct value *value)
 
static void printf_floating (struct ui_file *stream, const char *format, struct value *value, enum argclass argclass)
 
static void printf_pointer (struct ui_file *stream, const char *format, struct value *value)
 
static void ui_printf (const char *arg, struct ui_file *stream)
 
static void printf_command (const char *arg, int from_tty)
 
static void eval_command (const char *arg, int from_tty)
 
static void show_addr_not_tagged (CORE_ADDR address)
 
static void show_memory_tagging_unsupported (void)
 
static void memory_tag_command (const char *arg, int from_tty)
 
static void memory_tag_print_tag_command (const char *args, enum memtag_type tag_type)
 
static void memory_tag_print_logical_tag_command (const char *args, int from_tty)
 
static void memory_tag_print_allocation_tag_command (const char *args, int from_tty)
 
static void parse_with_logical_tag_input (const char *args, struct value **val, gdb::byte_vector &tags, value_print_options *print_opts)
 
static void memory_tag_with_logical_tag_command (const char *args, int from_tty)
 
static void parse_set_allocation_tag_input (const char *args, struct value **val, size_t *length, gdb::byte_vector &tags)
 
static void memory_tag_set_allocation_tag_command (const char *args, int from_tty)
 
static void memory_tag_check_command (const char *args, int from_tty)
 
void _initialize_printcmd ()
 

Variables

static struct cmd_list_elementmemory_tag_list
 
static char last_format = 0
 
static char last_size = 'w'
 
static int last_count
 
static bool last_print_tags = false
 
static struct gdbarchnext_gdbarch
 
static CORE_ADDR next_address
 
static int branch_delay_insns
 
static CORE_ADDR last_examine_address
 
static value_ref_ptr last_examine_value
 
static unsigned int max_symbolic_offset = UINT_MAX
 
static bool print_symbol_filename = false
 
static int current_display_number
 
static int display_number
 
static std::vector< std::unique_ptr< struct display > > all_displays
 

Function Documentation

◆ _initialize_printcmd()

void _initialize_printcmd ( )

Definition at line 3263 of file printcmd.c.

Referenced by initialize_all_files().

◆ build_address_symbolic()

int build_address_symbolic ( struct gdbarch * gdbarch,
CORE_ADDR addr,
bool do_demangle,
bool prefer_sym_over_minsym,
std::string * name,
int * offset,
std::string * filename,
int * line,
int * unmapped )

◆ call_command()

static void call_command ( const char * exp,
int from_tty )
static

Definition at line 1473 of file printcmd.c.

References print_command_1().

◆ clear_dangling_display_expressions()

static void clear_dangling_display_expressions ( struct objfile * objfile)
static

◆ clear_displays()

void clear_displays ( void )

Definition at line 2023 of file printcmd.c.

References all_displays.

Referenced by clear_symtab_users(), and undisplay_command().

◆ decode_format()

static struct format_data decode_format ( const char ** string_ptr,
int oformat,
int osize )
static

◆ delete_display()

static void delete_display ( struct display * display)
static

Definition at line 2031 of file printcmd.c.

References all_displays.

Referenced by undisplay_command().

◆ disable_current_display()

void disable_current_display ( void )

Definition at line 2274 of file printcmd.c.

References current_display_number, disable_display(), gdb_printf(), and gdb_stderr.

Referenced by normal_stop().

◆ disable_display()

void disable_display ( int num)

Definition at line 2262 of file printcmd.c.

References all_displays, and gdb_printf().

Referenced by disable_current_display().

◆ disable_display_command()

static void disable_display_command ( const char * args,
int from_tty )
static

Definition at line 2342 of file printcmd.c.

References enable_disable_display_command().

◆ display_and_x_command_completer()

static void display_and_x_command_completer ( struct cmd_list_element * ignore,
completion_tracker & tracker,
const char * text,
const char *  )
static

◆ display_command()

static void display_command ( const char * arg,
int from_tty )
static

◆ do_displays()

void do_displays ( void )

Definition at line 2252 of file printcmd.c.

References all_displays, and do_one_display().

Referenced by display_command(), print_stop_event(), and tfind_1().

◆ do_examine()

static void do_examine ( struct format_data fmt,
struct gdbarch * gdbarch,
CORE_ADDR addr )
static

◆ do_one_display()

static void do_one_display ( struct display * d)
static

◆ enable_disable_display_command()

static void enable_disable_display_command ( const char * args,
int from_tty,
bool enable )
static

◆ enable_display_command()

static void enable_display_command ( const char * args,
int from_tty )
static

Definition at line 2334 of file printcmd.c.

References enable_disable_display_command().

◆ eval_command()

static void eval_command ( const char * arg,
int from_tty )
static

◆ find_instruction_backward()

static CORE_ADDR find_instruction_backward ( struct gdbarch * gdbarch,
CORE_ADDR addr,
int inst_count,
int * inst_read )
static

◆ find_string_backward()

static CORE_ADDR find_string_backward ( struct gdbarch * gdbarch,
CORE_ADDR addr,
int count,
int char_size,
const struct value_print_options * options,
int * strings_counted )
static

Definition at line 938 of file printcmd.c.

References get_print_max_chars(), integer_is_zero(), and read_memory_backward().

Referenced by do_examine().

◆ float_type_from_length()

static struct type * float_type_from_length ( struct type * type)
static

◆ info_address_command()

static void info_address_command ( const char * exp,
int from_tty )
static

◆ info_display_command()

static void info_display_command ( const char * ignore,
int from_tty )
static

Definition at line 2288 of file printcmd.c.

References all_displays, gdb_printf(), gdb_puts(), and get_selected_block().

◆ info_symbol_command()

static void info_symbol_command ( const char * arg,
int from_tty )
static

◆ integer_is_zero()

static int integer_is_zero ( const gdb_byte * x,
int len )
static

Definition at line 922 of file printcmd.c.

Referenced by find_string_backward().

◆ map_display_numbers()

static void map_display_numbers ( const char * args,
gdb::function_view< void(struct display *)> function )
static

◆ memory_tag_check_command()

static void memory_tag_check_command ( const char * args,
int from_tty )
static

◆ memory_tag_command()

static void memory_tag_command ( const char * arg,
int from_tty )
static

Definition at line 2995 of file printcmd.c.

References all_commands, gdb_stdout, help_list(), and memory_tag_list.

◆ memory_tag_print_allocation_tag_command()

static void memory_tag_print_allocation_tag_command ( const char * args,
int from_tty )
static

◆ memory_tag_print_logical_tag_command()

static void memory_tag_print_logical_tag_command ( const char * args,
int from_tty )
static

◆ memory_tag_print_tag_command()

static void memory_tag_print_tag_command ( const char * args,
enum memtag_type tag_type )
static

◆ memory_tag_set_allocation_tag_command()

static void memory_tag_set_allocation_tag_command ( const char * args,
int from_tty )
static

◆ memory_tag_with_logical_tag_command()

static void memory_tag_with_logical_tag_command ( const char * args,
int from_tty )
static

◆ output_command()

void output_command ( const char * exp,
int from_tty )

◆ parse_set_allocation_tag_input()

static void parse_set_allocation_tag_input ( const char * args,
struct value ** val,
size_t * length,
gdb::byte_vector & tags )
static

◆ parse_with_logical_tag_input()

static void parse_with_logical_tag_input ( const char * args,
struct value ** val,
gdb::byte_vector & tags,
value_print_options * print_opts )
static

Definition at line 3064 of file printcmd.c.

References process_print_command_args().

Referenced by memory_tag_with_logical_tag_command().

◆ pc_prefix()

const char * pc_prefix ( CORE_ADDR addr)

◆ print_address()

void print_address ( struct gdbarch * gdbarch,
CORE_ADDR addr,
struct ui_file * stream )

◆ print_address_demangle()

int print_address_demangle ( const struct value_print_options * opts,
struct gdbarch * gdbarch,
CORE_ADDR addr,
struct ui_file * stream,
int do_demangle )

◆ print_address_symbolic()

int print_address_symbolic ( struct gdbarch * gdbarch,
CORE_ADDR addr,
struct ui_file * stream,
int do_demangle,
const char * leadin )

◆ print_command()

static void print_command ( const char * exp,
int from_tty )
static

Definition at line 1466 of file printcmd.c.

References print_command_1().

◆ print_command_1()

static void print_command_1 ( const char * args,
int voidprint )
static

◆ print_command_completer()

void print_command_completer ( struct cmd_list_element * ignore,
completion_tracker & tracker,
const char * text,
const char * word )

◆ print_command_parse_format()

void print_command_parse_format ( const char ** expp,
const char * cmdname,
value_print_options * opts )

◆ print_formatted()

static void print_formatted ( struct value * val,
int size,
const struct value_print_options * options,
struct ui_file * stream )
static

◆ print_scalar_formatted()

void print_scalar_formatted ( const gdb_byte * valaddr,
struct type * type,
const struct value_print_options * options,
int size,
struct ui_file * stream )

◆ print_value()

void print_value ( value * val,
const value_print_options & opts )

◆ print_variable_and_value()

void print_variable_and_value ( const char * name,
struct symbol * var,
frame_info_ptr frame,
struct ui_file * stream,
int indent )

◆ printf_c_string()

static void printf_c_string ( struct ui_file * stream,
const char * format,
struct value * value )
static

◆ printf_command()

static void printf_command ( const char * arg,
int from_tty )
static

Definition at line 2952 of file printcmd.c.

References gdb_stdout, and ui_printf().

◆ printf_floating()

static void printf_floating ( struct ui_file * stream,
const char * format,
struct value * value,
enum argclass argclass )
static

◆ printf_pointer()

static void printf_pointer ( struct ui_file * stream,
const char * format,
struct value * value )
static

Definition at line 2674 of file printcmd.c.

References gdb_printf(), and value_as_long().

Referenced by ui_printf().

◆ printf_wide_c_string()

static void printf_wide_c_string ( struct ui_file * stream,
const char * format,
struct value * value )
static

◆ process_print_command_args()

static struct value * process_print_command_args ( const char * args,
value_print_options * print_opts,
bool voidprint )
static

◆ read_memory_backward()

static int read_memory_backward ( struct gdbarch * gdbarch,
CORE_ADDR memaddr,
gdb_byte * myaddr,
int len )
static

Definition at line 886 of file printcmd.c.

References gdb_printf(), paddress(), and target_read_memory().

Referenced by find_string_backward().

◆ set_command()

static void set_command ( const char * exp,
int from_tty )
static

Definition at line 1521 of file printcmd.c.

References parse_expression().

◆ set_next_address()

void set_next_address ( struct gdbarch * gdbarch,
CORE_ADDR addr )

◆ should_validate_memtags()

static bool should_validate_memtags ( struct value * value)
static

◆ show_addr_not_tagged()

static void show_addr_not_tagged ( CORE_ADDR address)
static

◆ show_max_symbolic_offset()

static void show_max_symbolic_offset ( struct ui_file * file,
int from_tty,
struct cmd_list_element * c,
const char * value )
static

Definition at line 102 of file printcmd.c.

References gdb_printf().

◆ show_memory_tagging_unsupported()

static void show_memory_tagging_unsupported ( void )
static

◆ show_print_symbol_filename()

static void show_print_symbol_filename ( struct ui_file * file,
int from_tty,
struct cmd_list_element * c,
const char * value )
static

Definition at line 115 of file printcmd.c.

References gdb_printf().

◆ skip_over_slash_fmt()

static bool skip_over_slash_fmt ( completion_tracker & tracker,
const char ** args )
static

◆ ui_printf()

static void ui_printf ( const char * arg,
struct ui_file * stream )
static

◆ undisplay_command()

static void undisplay_command ( const char * args,
int from_tty )
static

◆ validate_format()

static void validate_format ( struct format_data fmt,
const char * cmdname )
static

◆ x_command()

static void x_command ( const char * exp,
int from_tty )
static

Variable Documentation

◆ all_displays

std::vector<std::unique_ptr<struct display> > all_displays
static

◆ branch_delay_insns

int branch_delay_insns
static

◆ current_display_number

int current_display_number
static

Definition at line 127 of file printcmd.c.

Referenced by disable_current_display(), and do_one_display().

◆ display_number

int display_number
static

Definition at line 131 of file printcmd.c.

◆ last_count

int last_count
static

Definition at line 73 of file printcmd.c.

Referenced by x_command().

◆ last_examine_address

CORE_ADDR last_examine_address
static

Definition at line 90 of file printcmd.c.

Referenced by do_examine(), and x_command().

◆ last_examine_value

value_ref_ptr last_examine_value
static

Definition at line 95 of file printcmd.c.

Referenced by do_examine(), and x_command().

◆ last_format

char last_format = 0
static

Definition at line 65 of file printcmd.c.

Referenced by print_command_parse_format(), and x_command().

◆ last_print_tags

bool last_print_tags = false
static

Definition at line 77 of file printcmd.c.

Referenced by x_command().

◆ last_size

char last_size = 'w'
static

Definition at line 69 of file printcmd.c.

Referenced by x_command().

◆ max_symbolic_offset

unsigned int max_symbolic_offset = UINT_MAX
static

Definition at line 100 of file printcmd.c.

Referenced by build_address_symbolic().

◆ memory_tag_list

struct cmd_list_element* memory_tag_list
static

Definition at line 61 of file printcmd.c.

Referenced by memory_tag_command().

◆ next_address

CORE_ADDR next_address
static

◆ next_gdbarch

struct gdbarch* next_gdbarch
static

Definition at line 81 of file printcmd.c.

Referenced by do_examine(), set_next_address(), and x_command().

◆ print_symbol_filename

bool print_symbol_filename = false
static

Definition at line 113 of file printcmd.c.

Referenced by build_address_symbolic(), and print_address_symbolic().