GDB (xrefs)
Classes | Macros | Functions | Variables
/tmp/gdb-8.1/gdb/printcmd.c File Reference
#include "defs.h"
#include "frame.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "value.h"
#include "language.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 "observer.h"
#include "solist.h"
#include "parser-defs.h"
#include "charset.h"
#include "arch-utils.h"
#include "cli/cli-utils.h"
#include "cli/cli-script.h"
#include "format.h"
#include "source.h"
#include "common/byte-vector.h"

Go to the source code of this file.

Classes

struct  display
 

Macros

#define ALL_DISPLAYS(B)   for (B = display_chain; B; B = B->next)
 
#define ALL_DISPLAYS_SAFE(B, TMP)
 

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, int do_demangle, char **name, int *offset, char **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, struct format_data *fmtp)
 
void print_value (struct value *val, const struct format_data *fmtp)
 
static void print_command_1 (const char *exp, int voidprint)
 
static void print_command (const char *exp, int from_tty)
 
static void call_command (const char *exp, int from_tty)
 
static void output_command (const char *exp, int from_tty)
 
void output_command_const (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_command (const char *arg, int from_tty)
 
static void free_display (struct display *d)
 
void clear_displays (void)
 
static void delete_display (struct display *display)
 
static void map_display_numbers (const char *args, void(*function)(struct display *, void *), void *data)
 
static void do_delete_display (struct display *d, void *data)
 
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 do_enable_disable_display (struct display *d, void *data)
 
static void enable_disable_display_command (const char *args, int from_tty, int 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, struct frame_info *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)
 
void _initialize_printcmd (void)
 

Variables

static char last_format = 0
 
static char last_size = 'w'
 
static struct gdbarchnext_gdbarch
 
static CORE_ADDR next_address
 
static int branch_delay_insns
 
static CORE_ADDR last_examine_address
 
static struct valuelast_examine_value
 
static unsigned int max_symbolic_offset = UINT_MAX
 
static int print_symbol_filename = 0
 
static int current_display_number
 
static struct displaydisplay_chain
 
static int display_number
 

Macro Definition Documentation

◆ ALL_DISPLAYS

#define ALL_DISPLAYS (   B)    for (B = display_chain; B; B = B->next)

Definition at line 153 of file printcmd.c.

Referenced by delete_display(), and enable_disable_display_command().

◆ ALL_DISPLAYS_SAFE

#define ALL_DISPLAYS_SAFE (   B,
  TMP 
)
Value:
for (B = display_chain; \
B ? (TMP = B->next, 1): 0; \
B = TMP)
Definition: aarch64-insn.h:36
static struct display * display_chain
Definition: printcmd.c:145

Definition at line 156 of file printcmd.c.

Referenced by map_display_numbers().

Function Documentation

◆ _initialize_printcmd()

void _initialize_printcmd ( void  )

◆ build_address_symbolic()

int build_address_symbolic ( struct gdbarch gdbarch,
CORE_ADDR  addr,
int  do_demangle,
char **  name,
int *  offset,
char **  filename,
int *  line,
int *  unmapped 
)

◆ call_command()

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

Definition at line 1224 of file printcmd.c.

References print_command_1().

Referenced by _initialize_printcmd().

◆ clear_dangling_display_expressions()

static void clear_dangling_display_expressions ( struct objfile objfile)
static

◆ clear_displays()

void clear_displays ( void  )

Definition at line 1768 of file printcmd.c.

References display_chain, free_display(), and display::next.

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 1782 of file printcmd.c.

References ALL_DISPLAYS, display_chain, free_display(), gdb_assert, and display::next.

Referenced by do_delete_display().

◆ disable_current_display()

void disable_current_display ( void  )

Definition at line 2042 of file printcmd.c.

References _, current_display_number, disable_display(), fprintf_unfiltered(), and gdb_stderr.

Referenced by normal_stop().

◆ disable_display()

void disable_display ( int  num)

◆ disable_display_command()

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

Definition at line 2120 of file printcmd.c.

References enable_disable_display_command().

Referenced by _initialize_printcmd().

◆ display_command()

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

◆ do_delete_display()

static void do_delete_display ( struct display d,
void *  data 
)
static

Definition at line 1842 of file printcmd.c.

References delete_display().

Referenced by undisplay_command().

◆ do_displays()

void do_displays ( void  )

Definition at line 2016 of file printcmd.c.

References display_chain, do_one_display(), and display::next.

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

◆ do_enable_disable_display()

static void do_enable_disable_display ( struct display d,
void *  data 
)
static

Definition at line 2086 of file printcmd.c.

References display::enabled_p.

Referenced by enable_disable_display_command().

◆ 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,
int  enable 
)
static

◆ enable_display_command()

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

Definition at line 2112 of file printcmd.c.

References enable_disable_display_command().

Referenced by _initialize_printcmd().

◆ 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

◆ float_type_from_length()

static struct type* float_type_from_length ( struct type type)
static

◆ free_display()

static void free_display ( struct display d)
static

Definition at line 1758 of file printcmd.c.

References display::exp_string, and xfree().

Referenced by clear_displays(), and delete_display().

◆ 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

◆ 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 889 of file printcmd.c.

Referenced by find_string_backward().

◆ map_display_numbers()

static void map_display_numbers ( const char *  args,
void(*)(struct display *, void *)  function,
void *  data 
)
static

◆ output_command()

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

Definition at line 1232 of file printcmd.c.

References output_command_const().

Referenced by _initialize_printcmd().

◆ output_command_const()

void output_command_const ( const char *  exp,
int  from_tty 
)

◆ 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 1217 of file printcmd.c.

References print_command_1().

Referenced by _initialize_printcmd().

◆ print_command_1()

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

◆ print_command_parse_format()

void print_command_parse_format ( const char **  expp,
const char *  cmdname,
struct format_data fmtp 
)

◆ 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 ( struct value val,
const struct format_data fmtp 
)

◆ print_variable_and_value()

void print_variable_and_value ( const char *  name,
struct symbol var,
struct frame_info 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

Definition at line 2215 of file printcmd.c.

References value_print_options::format, fprintf_filtered(), QUIT, read_memory(), and value_as_address().

Referenced by ui_printf().

◆ printf_command()

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

Definition at line 2588 of file printcmd.c.

References gdb_flush(), gdb_stdout, and ui_printf().

Referenced by _initialize_printcmd().

◆ 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 2364 of file printcmd.c.

References fprintf_filtered(), gdb_assert, 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

◆ read_memory_backward()

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

Definition at line 853 of file printcmd.c.

References _, paddress(), printf_filtered(), 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 1275 of file printcmd.c.

References _, evaluate_expression(), parse_expression(), and warning().

Referenced by _initialize_printcmd().

◆ set_next_address()

void set_next_address ( struct gdbarch gdbarch,
CORE_ADDR  addr 
)

◆ 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 88 of file printcmd.c.

References _, and fprintf_filtered().

Referenced by _initialize_printcmd().

◆ 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 101 of file printcmd.c.

References _, and fprintf_filtered().

Referenced by _initialize_printcmd().

◆ 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

◆ branch_delay_insns

int branch_delay_insns
static

◆ current_display_number

int current_display_number
static

Definition at line 113 of file printcmd.c.

Referenced by _initialize_printcmd(), disable_current_display(), and do_one_display().

◆ display_chain

struct display* display_chain
static

◆ display_number

int display_number
static

Definition at line 147 of file printcmd.c.

Referenced by display_command().

◆ last_examine_address

CORE_ADDR last_examine_address
static

Definition at line 76 of file printcmd.c.

Referenced by do_examine(), and x_command().

◆ last_examine_value

struct value* last_examine_value
static

Definition at line 81 of file printcmd.c.

Referenced by do_examine(), and x_command().

◆ last_format

char last_format = 0
static

Definition at line 59 of file printcmd.c.

Referenced by print_command_parse_format(), and x_command().

◆ last_size

char last_size = 'w'
static

Definition at line 63 of file printcmd.c.

Referenced by x_command().

◆ max_symbolic_offset

unsigned int max_symbolic_offset = UINT_MAX
static

Definition at line 86 of file printcmd.c.

Referenced by _initialize_printcmd(), and build_address_symbolic().

◆ next_address

CORE_ADDR next_address
static

◆ next_gdbarch

struct gdbarch* next_gdbarch
static

Definition at line 67 of file printcmd.c.

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

◆ print_symbol_filename

int print_symbol_filename = 0
static

Definition at line 99 of file printcmd.c.

Referenced by _initialize_printcmd(), build_address_symbolic(), and print_address_symbolic().