55#include "gdbsupport/def-vector.h"
58#include "gdbsupport/buildargv.h"
144 N_(
"Set printing of function arguments at function entry."),
145 N_(
"Show printing of function arguments at function entry."),
146 N_(
"GDB can sometimes determine the values of function arguments at entry,\n\
147in addition to their current values. This option tells GDB whether\n\
148to print the current value, the value at entry (marked as val@entry),\n\
149or both. Note that one or both of these values may be <optimized out>."),
157 N_(
"Set printing of non-scalar frame arguments."),
158 N_(
"Show printing of non-scalar frame arguments."),
163 "raw-frame-arguments",
166 N_(
"Set whether to print frame arguments in raw form."),
167 N_(
"Show whether to print frame arguments in raw form."),
168 N_(
"If set, frame arguments are printed in raw form, bypassing any\n\
169pretty-printers for that value.")
177 N_(
"Set printing of frame information."),
178 N_(
"Show printing of frame information."),
200 N_(
"Print values of local variables.")
206 N_(
"Prohibit frame filters from executing on a backtrace."),
212 N_(
"Causes Python frame filter elided frames to not be printed."),
220 const char *regexp,
const char *t_regexp,
221 int num_tabs,
struct ui_file *stream);
282 gdb_assert (
pspace !=
nullptr);
325 if (sal.
line != 0 && sal.
pc == 0 && sal.
end == 0)
344 scoped_restore save_uiout = make_scoped_restore (&
current_uiout, uiout);
375 catch (
const gdb_exception_error &e)
387 int first,
struct ui_file *stream)
395 for (i = 0; i < num; i++)
402 sizeof (
int), byte_order);
407 start +=
sizeof (int);
425 gdb_assert (!arg->
val || !arg->
error);
456 stb.
printf (_(
"<error reading variable: %s>"), arg->
error.get ());
491 catch (
const gdb_exception_error &except)
493 stb.
printf (_(
"<error reading variable: %s>"),
519 catch (
const gdb_exception_error &except)
521 argp->
error.reset (xstrdup (except.what ()));
533 struct value *val = NULL, *entryval = NULL;
534 char *val_error = NULL, *entryval_error = NULL;
544 catch (
const gdb_exception_error &except)
546 val_error = (
char *) alloca (except.message->size () + 1);
547 strcpy (val_error, except.what ());
564 catch (
const gdb_exception_error &except)
566 if (except.error != NO_ENTRY_VALUE_ERROR)
568 entryval_error = (
char *) alloca (except.message->size () + 1);
569 strcpy (entryval_error, except.what ());
593 struct value *val_deref = NULL, *entryval_deref;
601 struct type *type_deref;
620 catch (
const gdb_exception_error &except)
624 if (except.error == NO_ENTRY_VALUE_ERROR)
626 else if (except.message != NULL)
629 = (
char *) alloca (except.message->size () + 1);
630 strcpy (entryval_error, except.what ());
635 if (val == val_deref)
646 if (val_error && entryval_error
647 && strcmp (val_error, entryval_error) == 0)
649 entryval_error = NULL;
658 if (entryval == NULL)
662 gdb_assert (val == NULL);
668 catch (
const gdb_exception_error &except)
670 val_error = (
char *) alloca (except.message->size () + 1);
671 strcpy (val_error, except.what ());
680 entryval_error = NULL;
694 argp->
error.reset (val_error ? xstrdup (val_error) : NULL);
695 if (!val && !val_error)
707 entryargp->
sym = sym;
708 entryargp->
val = entryval;
709 entryargp->
error.reset (entryval_error ? xstrdup (entryval_error) : NULL);
710 if (!entryval && !entryval_error)
728 int num,
struct ui_file *stream)
735 long highest_offset = -1;
737 int args_printed = 0;
760 const struct block *b =
func->value_block ();
794 ((current_offset + arg_size +
sizeof (int) - 1)
795 & ~(
sizeof (int) - 1));
799 if (highest_offset == -1
800 || (current_offset > highest_offset))
801 highest_offset = current_offset;
805 args_printed += (arg_size +
sizeof (int) - 1) /
sizeof (int);
837 gdb_assert (nsym != NULL);
922 if (highest_offset == -1)
925 start = highest_offset;
927 if (!print_names && !first && num > 0)
961 _(
"Debugger's willingness to use "
962 "disassemble-next-line is %s.\n"),
971 int how_many, CORE_ADDR low, CORE_ADDR high)
980 catch (
const gdb_exception_error &exception)
992static gdb::optional<enum print_what>
999 internal_error (
"Unexpected print frame-info value `%s'.",
1012 if (!
flags.empty ())
1043 int set_current_sal)
1086 uiout->
field_string (
"func",
"<function called from gdb>",
1092 uiout->
field_string (
"func",
"<signal handler called>",
1097 uiout->
field_string (
"func",
"<cross-architecture call>",
1125 if (location_print || !sal.
symtab)
1134 && source_print && !sal.
symtab)
1138 if (source_print && sal.
symtab)
1176 if (opts.addressprint && mid_statement)
1192 if (set_current_sal)
1277gdb::unique_xmalloc_ptr<char>
1282 gdb::unique_xmalloc_ptr<char> funname;
1293 *funlang =
func->language ();
1308 if (funname == NULL)
1320 if (msymbol.
minsym != NULL)
1346 gdb::unique_xmalloc_ptr<char> funname
1362 if (opts.addressprint)
1374 uiout->
text (
" in ");
1379 gdb_puts (funname ? funname.get () :
"??", &stb);
1392 gdb_assert (numargs >= 0);
1403 catch (
const gdb_exception_error &e)
1415 const char *filename_display;
1420 uiout->
text (
" at ");
1438 && pc_p && (funname == NULL || sal.
symtab == NULL))
1448 uiout->
text (
" from ");
1467 const char *text,
const char *word)
1493 const char *funname = 0;
1495 const char *pc_regname;
1500 CORE_ADDR caller_pc = 0;
1501 int caller_pc_p = 0;
1523 gdb::unique_xmalloc_ptr<char> func_only;
1526 funname =
func->print_name ();
1527 funlang =
func->language ();
1538 funname = func_only.get ();
1541 else if (frame_pc_p)
1546 if (msymbol.
minsym != NULL)
1597 catch (
const gdb_exception_error &ex)
1601 case NOT_AVAILABLE_ERROR:
1604 case OPTIMIZED_OUT_ERROR:
1620 if (calling_frame_info == NULL)
1625 if (reason != UNWIND_NO_REASON)
1661 gdb_printf (
" Arglist at unknown address.\n");
1676 gdb_assert (numargs >= 0);
1679 else if (numargs == 1)
1723 gdb_assert (
value != NULL);
1761 for (i = 0; i < numregs; i++)
1774 &
lval, &addr, &realnum, NULL);
1790 if (count || need_nl)
1804 gdb_assert (level >= 0);
1806 while (leading !=
nullptr && level)
1826 gdb_assert (count > 0);
1829 while (current !=
nullptr && count--)
1837 while (current !=
nullptr)
1888template <
void (*FPTR) (frame_info_ptr fi,
bool selected_frame_p)>
1902 error (_(
"No frame at level %s."), arg);
1916 error (_(
"No frame at address %s."), arg);
1925 view (
const char *args,
int from_tty)
1930 error (_(
"Missing address argument to view a frame"));
1932 gdb_argv argv (args);
1934 if (argv.count () == 2)
1958 error (_(
"Missing function name argument"));
1961 error (_(
"No frame for function \"%s\"."), arg);
1978 level (arg, from_tty);
1995 const char *count_exp,
int from_tty)
2000 int py_start = 0, py_end = 0;
2004 error (_(
"No stack."));
2025 frame_filter_flags
flags = 0;
2067 if (count_exp != NULL && count < 0)
2096 gdb_printf (_(
"(More stack frames follow...)\n"));
2100 if (fi == NULL && trailing != NULL)
2105 if (reason >= UNWIND_FIRST_ERROR)
2115static inline std::array<gdb::option::option_def_group, 3>
2137 const char *save_arg = arg;
2140 if (this_arg.empty ())
2143 if (startswith (
"no-filters", this_arg))
2145 if (bt_cmd_opts !=
nullptr)
2146 bt_cmd_opts->no_filters =
true;
2148 else if (startswith (
"full", this_arg))
2150 if (bt_cmd_opts !=
nullptr)
2151 bt_cmd_opts->full =
true;
2153 else if (startswith (
"hide", this_arg))
2155 if (bt_cmd_opts !=
nullptr)
2156 bt_cmd_opts->hide =
true;
2189 scoped_restore restore_set_backtrace_options
2200 const char *text,
const char *)
2210 const char *p = skip_to_space (text);
2213 static const char *
const backtrace_cmd_qualifier_choices[] = {
2214 "full",
"no-filters",
"hide",
nullptr,
2291 gdb::optional<compiled_regex>
preg;
2292 gdb::optional<compiled_regex>
treg;
2309 if (
preg.has_value ()
2312 if (
treg.has_value ()
2321 warning (_(
"Unable to restore previously selected frame."));
2343 reg->emplace (regexp, cflags, _(
"Invalid regexp"));
2363 const char *regexp,
const char *t_regexp,
2364 int num_tabs,
struct ui_file *stream)
2374 _(
"PC unavailable, cannot determine locals.\n"));
2382 gdb_printf (stream,
"No symbol table info available.\n");
2403 if (regexp == NULL && t_regexp == NULL)
2406 gdb_printf (stream, _(
"No matching locals.\n"));
2452 const char *text,
const char * )
2473 if (args !=
nullptr && *args ==
'\0')
2479 opts.type_regexp.empty () ?
nullptr : opts.type_regexp.c_str (),
2490 struct symbol *sym, *sym2;
2529 const char *regexp,
const char *t_regexp,
2535 gdb::optional<compiled_regex> preg;
2536 gdb::optional<compiled_regex> treg;
2542 _(
"PC unavailable, cannot determine args.\n"));
2550 gdb_printf (stream, _(
"No symbol table info available.\n"));
2568 if (regexp == NULL && t_regexp == NULL)
2571 gdb_printf (stream, _(
"No matching arguments.\n"));
2584 if (args !=
nullptr && *args ==
'\0')
2590 opts.type_regexp.empty () ?
nullptr : opts.type_regexp.c_str (),
2624 while (*level_offset_ptr > 0)
2630 (*level_offset_ptr)--;
2635 while (*level_offset_ptr < 0)
2641 (*level_offset_ptr)++;
2661 if (count != 0 && count_exp == NULL)
2662 error (_(
"Initial frame selected; you cannot go up."));
2692 if (count != 0 && count_exp == NULL)
2699 error (_(
"Bottom (innermost) frame selected; you cannot go down."));
2726 struct value *return_value = NULL;
2727 struct value *function = NULL;
2728 std::string query_prefix;
2735 error (_(
"Can not force return from an inlined function."));
2744 struct type *return_type = NULL;
2752 if (thisfun != NULL)
2754 if (return_type == NULL)
2756 if (retval_expr->first_opcode () != UNOP_CAST
2757 && retval_expr->first_opcode () != UNOP_CAST_TYPE)
2758 error (_(
"Return value type not available for selected "
2760 "Please use an explicit cast of the value to return."));
2764 return_value =
value_cast (return_type, return_value);
2771 if (thisfun != NULL)
2775 if (return_type->code () == TYPE_CODE_VOID)
2781 return_value = NULL;
2782 else if (thisfun != NULL)
2787 string_printf (
"Function '%s' does not follow the target "
2788 "calling convention.\n"
2789 "If you continue, setting the return value "
2790 "will probably lead to unpredictable "
2799 query_prefix =
"The location at which to store the "
2800 "function's return value is unknown.\n"
2801 "If you continue, the return value "
2802 "that you specified will be ignored.\n";
2803 return_value = NULL;
2815 if (thisfun == NULL)
2816 confirmed =
query (_(
"%sMake selected stack frame return now? "),
2817 query_prefix.c_str ());
2821 warning (_(
"Function does not return normally to caller."));
2822 confirmed =
query (_(
"%sMake %s return now? "),
2823 query_prefix.c_str (),
2827 error (_(
"Not confirmed"));
2834 if (return_value != NULL)
2865 struct function_bounds
2867 CORE_ADDR low, high;
2873 gdb_assert (function_name != NULL);
2876 std::vector<symtab_and_line> sals
2879 gdb::def_vector<function_bounds> func_bounds (sals.size ());
2880 for (
size_t i = 0; i < sals.size (); i++)
2883 func_bounds[i].low = func_bounds[i].high = 0;
2884 else if (sals[i].pc == 0
2886 &func_bounds[i].low,
2887 &func_bounds[i].high) == 0)
2888 func_bounds[i].low = func_bounds[i].high = 0;
2893 for (
size_t i = 0; (i < sals.size () && !found); i++)
2902 while (!found && level == 0);
2918 "q", [] (
qcs_flags *opt) {
return &opt->quiet; },
2919 N_(
"Disables printing the frame location information."),
2923 "c", [] (
qcs_flags *opt) {
return &opt->cont; },
2924 N_(
"Print any error raised by COMMAND and continue."),
2928 "s", [] (
qcs_flags *opt) {
return &opt->silent; },
2929 N_(
"Silently ignore any errors or empty output produced by COMMAND."),
2936static inline std::array<gdb::option::option_def_group, 2>
2971 const char *cmd,
int from_tty,
2983 if (cmd == NULL || *cmd ==
'\0')
2984 error (_(
"Please specify a command to apply on the selected frames"));
2994 scoped_restore restore_set_backtrace_options
3004 std::string cmd_result;
3012 (cmd_result, cmd, from_tty,
gdb_stdout->term_out ());
3015 "unable to get selected frame."));
3016 if (!
flags.silent || cmd_result.length () > 0)
3023 catch (
const gdb_exception_error &ex)
3026 "unable to get selected frame."));
3058 const char *text,
const char *)
3077 catch (
const gdb_exception_error &ex)
3084 const char *cmd = levels.
cur_tok ();
3094 && cmd > text && !isspace (cmd[-1]))
3109 const char *text,
const char *)
3119 const char *text,
const char *)
3121 const char *cmd = text;
3128 if (cmd > text && !isspace (cmd[-1]))
3144 error (_(
"No stack."));
3146 bool level_found =
false;
3147 const char *levels_str = cmd;
3162 error (_(
"Missing or invalid LEVEL... argument"));
3167 levels.
init (levels_str);
3175 n_frames = levels.
end_value () - level_beg + 1;
3192 error (_(
"No stack."));
3207 error (_(
"No stack."));
3210 error (_(
"Missing COUNT argument."));
3213 error (_(
"Invalid COUNT argument."));
3232 if (cmd == NULL || *cmd ==
'\0')
3233 error (_(
"Please specify a command to apply on all frames"));
3234 std::string expanded = std::string (
"frame apply all -s ") + cmd;
3297Make selected stack frame return to its caller.\n\
3298Control remains in the debugger, but when you continue\n\
3299execution will resume in the frame above the one now selected.\n\
3300If an argument is given, it is an expression for the value to return."));
3303Select and print stack frame that called this one.\n\
3304An argument says how many frames up to go."));
3306Same as the `up' command, but does not print anything.\n\
3307This is useful in command scripts."));
3311Select and print stack frame called by this one.\n\
3312An argument says how many frames down to go."));
3316Same as the `down' command, but does not print anything.\n\
3317This is useful in command scripts."));
3322Select and print a stack frame.\n\
3323With no argument, print the selected stack frame. (See also \"info frame\").\n\
3324A single numerical argument specifies the frame to select."),
3328#define FRAME_APPLY_OPTION_HELP "\
3329Prints the frame location information followed by COMMAND output.\n\
3331By default, an error raised during the execution of COMMAND\n\
3332aborts \"frame apply\".\n\
3337 const auto frame_apply_opts
3341Apply a command to a number of frames.\n\
3342Usage: frame apply COUNT [OPTION]... COMMAND\n\
3343With a negative COUNT argument, applies the command on outermost -COUNT frames.\n"
3348 frame_apply_cmd_help.c_str (),
3354Apply a command to all frames.\n\
3356Usage: frame apply all [OPTION]... COMMAND\n"
3361 frame_apply_all_cmd_help.c_str (),
3366Apply a command to a list of frames.\n\
3368Usage: frame apply level LEVEL... [OPTION]... COMMAND\n\
3369LEVEL is a space-separated list of levels of frames to apply COMMAND on.\n"
3374 frame_apply_level_cmd_help.c_str (),
3379Apply a command to all frames (ignoring errors and empty output).\n\
3380Usage: faas [OPTION]... COMMAND\n\
3381shortcut for 'frame apply all -s [OPTION]... COMMAND'\n\
3382See \"help frame apply all\" for available options."));
3387Select and print a stack frame by stack address.\n\
3389Usage: frame address STACK-ADDRESS"),
3394View a stack frame that might be outside the current backtrace.\n\
3396Usage: frame view STACK-ADDRESS\n\
3397 frame view STACK-ADDRESS PC-ADDRESS"),
3402Select and print a stack frame by function name.\n\
3404Usage: frame function NAME\n\
3406The innermost frame that visited function NAME is selected."),
3413Select and print a stack frame by level.\n\
3415Usage: frame level LEVEL"),
3420Select a stack frame without printing anything.\n\
3421A single numerical argument specifies the frame to select."),
3427Select a stack frame by stack address.\n\
3429Usage: select-frame address STACK-ADDRESS"),
3436Select a stack frame that might be outside the current backtrace.\n\
3438Usage: select-frame view STACK-ADDRESS\n\
3439 select-frame view STACK-ADDRESS PC-ADDRESS"),
3445Select a stack frame by function name.\n\
3447Usage: select-frame function NAME"),
3454Select a stack frame by level.\n\
3456Usage: select-frame level LEVEL"),
3460 const auto backtrace_opts
3463 static std::string backtrace_help
3465Print backtrace of all stack frames, or innermost COUNT frames.\n\
3466Usage: backtrace [OPTION]... [QUALIFIER]... [COUNT | -COUNT]\n\
3471For backward compatibility, the following qualifiers are supported:\n\
3473 full - same as -full option.\n\
3474 no-filters - same as -no-filters option.\n\
3475 hide - same as -hide.\n\
3477With a negative COUNT, print outermost -COUNT frames."),
3482 backtrace_help.c_str ());
3490 _(
"Backtrace of the stack, or innermost COUNT frames."));
3495 _(
"All about the selected stack frame.\n\
3496With no arguments, displays information about the currently selected stack\n\
3497frame. Alternatively a frame specification may be provided (See \"frame\")\n\
3498the information is then printed about the specified frame."),
3504Print information about a stack frame selected by stack address.\n\
3506Usage: info frame address STACK-ADDRESS"),
3511Print information about a stack frame outside the current backtrace.\n\
3513Usage: info frame view STACK-ADDRESS\n\
3514 info frame view STACK-ADDRESS PC-ADDRESS"),
3519Print information about a stack frame selected by function name.\n\
3521Usage: info frame function NAME"),
3527Print information about a stack frame selected by level.\n\
3529Usage: info frame level LEVEL"),
3534All local variables of current stack frame or those matching REGEXPs.\n\
3535Usage: info locals [-q] [-t TYPEREGEXP] [NAMEREGEXP]\n\
3536Prints the local variables of the current stack frame.\n"),
3537 _(
"local variables"),
3542All argument variables of current stack frame or those matching REGEXPs.\n\
3543Usage: info args [-q] [-t TYPEREGEXP] [NAMEREGEXP]\n\
3544Prints the argument variables of the current stack frame.\n"),
3545 _(
"argument variables"),
3556Set whether to print frame arguments in raw form."), _(
"\
3557Show whether to print frame arguments in raw form."), _(
"\
3558If set, frame arguments are printed in raw form, bypassing any\n\
3559pretty-printers for that value."),
3566Set whether to disassemble next source line or insn when execution stops."),
3568Show whether to disassemble next source line or insn when execution stops."),
3570If ON, GDB will display disassembly of the next source line, in addition\n\
3571to displaying the source line itself. If the next source line cannot\n\
3572be displayed (e.g., source is unavailable or there's no line info), GDB\n\
3573will display disassembly of next instruction instead of showing the\n\
3575If AUTO, display disassembly of next instruction only if the source line\n\
3576cannot be displayed.\n\
3577If OFF (which is the default), never display the disassembly of the next\n\
void annotate_frame_source_file_end(void)
void annotate_function_call(void)
void annotate_frame_function_name(void)
void annotate_frame_end(void)
void annotate_frame_address_end(void)
bool annotate_source_line(struct symtab *s, int line, int mid_statement, CORE_ADDR pc)
void annotate_frame_address(void)
void annotate_frame_source_file(void)
void annotate_arg_name_end(void)
void annotate_frame_source_line(void)
void annotate_frame_where(void)
void annotate_frame_source_begin(void)
void annotate_frame_source_end(void)
void annotate_signal_handler_caller(void)
void annotate_arg_value(struct type *type)
void annotate_frame_args(void)
void annotate_frame_begin(int level, struct gdbarch *gdbarch, CORE_ADDR pc)
#define ALL_BLOCK_SYMBOLS(block, iter, sym)
const struct block * get_frame_block(frame_info_ptr frame, CORE_ADDR *addr_in_block)
bool find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr, const struct block **block)
struct symbol * get_frame_function(frame_info_ptr frame)
ui_file_style style() const
bool have_completions() const
void advance_custom_word_point_by(int len)
void set_use_custom_word_point(bool enable)
static void function(const char *arg, int from_tty)
static void base_command(const char *arg, int from_tty)
static void address(const char *arg, int from_tty)
static void view(const char *args, int from_tty)
static void level(const char *arg, int from_tty)
struct symtab * symtab() const
struct program_space * m_pspace
void set(struct program_space *pspace, CORE_ADDR address, struct symtab *symtab, int line)
CORE_ADDR address() const
struct program_space * pspace() const
const char * cur_tok() const
void init(const char *string)
virtual void puts(const char *str)
void printf(const char *,...) ATTRIBUTE_PRINTF(2
void field_fmt_signed(int width, ui_align align, const char *fldname, LONGEST value)
void field_core_addr(const char *fldname, struct gdbarch *gdbarch, CORE_ADDR address)
void field_string(const char *fldname, const char *string, const ui_file_style &style=ui_file_style())
void field_signed(const char *fldname, LONGEST value)
void text(const char *string)
void field_stream(const char *fldname, string_file &stream, const ui_file_style &style=ui_file_style())
bool is_mi_like_p() const
void void void wrap_hint(int indent)
struct cmd_list_element * showlist
struct cmd_list_element * showprintlist
struct cmd_list_element * infolist
struct cmd_list_element * cmdlist
struct cmd_list_element * setprintlist
struct cmd_list_element * setlist
struct cmd_list_element * showprintrawlist
struct cmd_list_element * setprintrawlist
struct cmd_list_element * add_cmd_suppress_notification(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc, struct cmd_list_element **list, bool *suppress_notification)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
void set_cmd_completer_handle_brkchars(struct cmd_list_element *cmd, completer_handle_brkchars_ftype *func)
cmd_list_element * add_com_alias(const char *name, cmd_list_element *target, command_class theclass, int abbrev_flag)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc)
struct cmd_list_element * deprecate_cmd(struct cmd_list_element *cmd, const char *replacement)
struct cmd_list_element * add_prefix_cmd_suppress_notification(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc, struct cmd_list_element **subcommands, int allow_unknown, struct cmd_list_element **list, bool *suppress_notification)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc, struct cmd_list_element **subcommands, int allow_unknown, struct cmd_list_element **list)
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
cmd_list_element * add_info_alias(const char *name, cmd_list_element *target, int abbrev_flag)
set_show_commands add_setshow_auto_boolean_cmd(const char *name, enum command_class theclass, enum auto_boolean *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void complete_on_enum(completion_tracker &tracker, const char *const *enumlist, const char *text, const char *word)
struct cmd_list_element * add_info(const char *name, cmd_simple_func_ftype *fun, const char *doc)
cli_style_option function_name_style
cli_style_option variable_name_style
cli_style_option file_name_style
cli_style_option metadata_style
const char * info_print_args_help(const char *prefix, const char *entity_kind, bool document_n_flag)
void validate_flags_qcs(const char *which_command, qcs_flags *flags)
std::string extract_arg(const char **arg)
int get_number_trailer(const char **pp, int trailer)
void expression_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
const char * advance_to_expression_complete_word_point(completion_tracker &tracker, const char *text)
void complete_nested_command_line(completion_tracker &tracker, const char *text)
void symbol_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
LONGEST read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
gdb::unique_xmalloc_ptr< char > cp_remove_params(const char *demangled_name)
void(* deprecated_print_frame_info_listing_hook)(struct symtab *s, int line, int stopline, int noerror)
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
@ RETURN_VALUE_ABI_RETURNS_ADDRESS
@ RETURN_VALUE_REGISTER_CONVENTION
@ RETURN_VALUE_STRUCT_CONVENTION
void gdb_disassembly(struct gdbarch *gdbarch, struct ui_out *uiout, gdb_disassembly_flags flags, int how_many, CORE_ADDR low, CORE_ADDR high)
struct value * evaluate_expression(struct expression *exp, struct type *expect_type)
LONGEST parse_and_eval_long(const char *exp)
struct value * parse_and_eval(const char *exp)
void exception_print(struct ui_file *file, const struct gdb_exception &e)
std::unique_ptr< expression > expression_up
expression_up parse_expression(const char *, innermost_block_tracker *=nullptr, bool void_context_p=false)
enum ext_lang_bt_status apply_ext_lang_frame_filter(frame_info_ptr frame, frame_filter_flags flags, enum ext_lang_frame_args args_type, struct ui_out *out, int frame_low, int frame_high)
struct value * read_var_value(struct symbol *var, const struct block *var_block, frame_info_ptr frame)
frame_info_ptr get_next_frame(frame_info_ptr this_frame)
enum unwind_stop_reason get_frame_unwind_stop_reason(frame_info_ptr frame)
struct program_space * get_frame_program_space(frame_info_ptr frame)
int frame_relative_level(frame_info_ptr fi)
const char * frame_stop_reason_string(frame_info_ptr fi)
void restore_selected_frame(frame_id frame_id, int frame_level) noexcept
void select_frame(frame_info_ptr fi)
CORE_ADDR frame_unwind_caller_pc(frame_info_ptr this_frame)
CORE_ADDR get_frame_pc(frame_info_ptr frame)
void frame_pop(frame_info_ptr this_frame)
set_backtrace_options user_set_backtrace_options
bool frame_id_p(frame_id l)
struct frame_id frame_id_build_wild(CORE_ADDR stack_addr)
const gdb::option::option_def set_backtrace_option_defs[]
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
struct value * frame_unwind_register_value(frame_info_ptr next_frame, int regnum)
enum frame_type get_frame_type(frame_info_ptr frame)
struct frame_id frame_unwind_caller_id(frame_info_ptr next_frame)
bool get_frame_pc_if_available(frame_info_ptr frame, CORE_ADDR *pc)
CORE_ADDR get_frame_args_address(frame_info_ptr fi)
bool get_frame_address_in_block_if_available(frame_info_ptr this_frame, CORE_ADDR *pc)
CORE_ADDR get_frame_locals_address(frame_info_ptr fi)
frame_info_ptr get_selected_frame(const char *message)
frame_info_ptr frame_find_by_id(struct frame_id id)
void frame_register_unwind(frame_info_ptr next_frame, int regnum, int *optimizedp, int *unavailablep, enum lval_type *lvalp, CORE_ADDR *addrp, int *realnump, gdb_byte *bufferp)
frame_info_ptr get_current_frame(void)
frame_info_ptr create_new_frame(CORE_ADDR addr, CORE_ADDR pc)
struct frame_id get_frame_id(frame_info_ptr fi)
frame_info_ptr get_prev_frame(frame_info_ptr this_frame)
symtab_and_line find_frame_sal(frame_info_ptr frame)
CORE_ADDR get_frame_base(frame_info_ptr fi)
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
enum return_value_convention gdbarch_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
int gdbarch_frame_num_args(struct gdbarch *gdbarch, frame_info_ptr frame)
CORE_ADDR gdbarch_frame_args_skip(struct gdbarch *gdbarch)
bool gdbarch_frame_num_args_p(struct gdbarch *gdbarch)
int gdbarch_register_reggroup_p(struct gdbarch *gdbarch, int regnum, const struct reggroup *reggroup)
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
std::string gdbarch_get_pc_address_flags(struct gdbarch *gdbarch, frame_info_ptr frame, CORE_ADDR pc)
static int gdbarch_num_cooked_regs(gdbarch *arch)
void execute_command_to_string(std::string &res, const char *p, int from_tty, bool term_out)
void execute_command(const char *, int)
void print_selected_thread_frame(struct ui_out *uiout, user_selected_what selection)
struct thread_info * inferior_thread(void)
static void print_args(struct field *args, int nargs, int spaces)
bool is_nocall_function(const struct type *type)
struct type * check_typedef(struct type *type)
#define TYPE_NO_RETURN(thistype)
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
int inline_skipped_frames(thread_info *thread)
const char * language_str(enum language lang)
const struct language_defn * language_def(enum language lang)
const struct language_defn * current_language
std::vector< symtab_and_line > decode_line_with_current_source(const char *string, int flags)
@ DECODE_LINE_FUNFIRSTLINE
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
observable< user_selected_what > user_selected_context_changed
bool process_options(const char **args, process_options_mode mode, gdb::array_view< const option_def_group > options_group)
@ PROCESS_OPTIONS_UNKNOWN_IS_OPERAND
std::string build_help(const char *help_tmpl, gdb::array_view< const option_def_group > options_group)
bool complete_options(completion_tracker &tracker, const char **args, process_options_mode mode, gdb::array_view< const option_def_group > options_group)
void add_setshow_cmds_for_options(command_class cmd_class, void *data, gdb::array_view< const option_def > options, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void print_variable_and_value(const char *name, struct symbol *var, frame_info_ptr frame, struct ui_file *stream, int indent)
struct program_space * current_program_space
int register_size(struct gdbarch *gdbarch, int regnum)
struct regcache * get_current_regcache(void)
const reggroup *const all_reggroup
void(* func)(remote_target *remote, char *)
const char * solib_name_from_address(struct program_space *pspace, CORE_ADDR address)
const char * symtab_to_fullname(struct symtab *s)
const char * symtab_to_filename_for_display(struct symtab *symtab)
void print_source_lines(struct symtab *s, int line, int stopline, print_source_lines_flags flags)
struct symtab_and_line set_current_source_symtab_and_line(const symtab_and_line &sal)
bool frame_show_address(frame_info_ptr frame, struct symtab_and_line sal)
void info_locals_command(const char *args, int from_tty)
struct symtab * get_last_displayed_symtab(void)
static const gdb::option::option_def info_print_options_defs[]
static frame_info_ptr trailing_outermost_frame(int count)
void get_user_print_what_frame_info(gdb::optional< enum print_what > *what)
const char print_entry_values_both[]
gdb::unique_xmalloc_ptr< char > find_frame_funname(frame_info_ptr frame, enum language *funlang, struct symbol **funcp)
#define FRAME_APPLY_OPTION_HELP
struct program_space * get_last_displayed_pspace(void)
static void down_command(const char *count_exp, int from_tty)
static frame_command_helper< select_frame_command_core > select_frame_cmd
static void print_frame_nameless_args(frame_info_ptr frame, long start, int num, int first, struct ui_file *stream)
static void frame_command_core(frame_info_ptr fi, bool ignored)
static frame_info_ptr find_frame_for_function(const char *)
const char print_frame_info_source_line[]
static void print_frame_arg_vars(frame_info_ptr frame, bool quiet, const char *regexp, const char *t_regexp, struct ui_file *stream)
static std::array< gdb::option::option_def_group, 2 > make_frame_apply_options_def_group(qcs_flags *flags, set_backtrace_options *set_bt_opts)
static const gdb::option::option_def fr_qcs_flags_option_defs[]
const struct block * get_selected_block(CORE_ADDR *addr_in_block)
const char print_frame_info_source_and_location[]
static void frame_selection_by_function_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
static void iterate_over_block_locals(const struct block *b, iterate_over_block_arg_local_vars_cb cb)
static void show_disassemble_next_line(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void down_silently_command(const char *count_exp, int from_tty)
void frame_apply_all_cmd_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *)
static const char * parse_backtrace_qualifiers(const char *arg, backtrace_cmd_options *bt_cmd_opts=nullptr)
CORE_ADDR get_last_displayed_addr(void)
static void do_gdb_disassembly(struct gdbarch *gdbarch, int how_many, CORE_ADDR low, CORE_ADDR high)
const char print_entry_values_preferred[]
const char print_frame_info_short_location[]
static void print_pc(struct ui_out *uiout, struct gdbarch *gdbarch, frame_info_ptr frame, CORE_ADDR pc)
static void print_frame(const frame_print_options &opts, frame_info_ptr frame, int print_level, enum print_what print_what, int print_args, struct symtab_and_line sal)
static last_displayed_symtab_info_type last_displayed_symtab_info
static const char *const print_frame_arguments_choices[]
void print_stack_frame_to_uiout(struct ui_out *uiout, frame_info_ptr frame, int print_level, enum print_what print_what, int set_current_sal)
void print_frame_info(const frame_print_options &fp_opts, frame_info_ptr frame, int print_level, enum print_what print_what, int print_args, int set_current_sal)
const char print_entry_values_compact[]
static frame_info_ptr find_frame_for_address(CORE_ADDR)
const char print_entry_values_default[]
const char print_frame_arguments_scalars[]
const char print_frame_info_location[]
static void prepare_reg(const char *regexp, gdb::optional< compiled_regex > *reg)
void print_stack_frame(frame_info_ptr frame, int print_level, enum print_what print_what, int set_current_sal)
const char print_frame_arguments_all[]
static frame_command_helper< frame_command_core > frame_cmd
static void frame_apply_level_cmd_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *)
static void backtrace_command_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *)
static gdb::optional< enum print_what > print_frame_info_to_print_what(const char *print_frame_info)
symtab_and_line get_last_displayed_sal()
static void backtrace_command_1(const frame_print_options &fp_opts, const backtrace_cmd_options &bt_opts, const char *count_exp, int from_tty)
static void select_frame_command_core(frame_info_ptr fi, bool ignored)
int get_last_displayed_line(void)
static struct cmd_list_element * select_frame_cmd_list
static void backtrace_command(const char *arg, int from_tty)
void set_current_sal_from_frame(frame_info_ptr frame)
static void print_frame_arg(const frame_print_options &fp_opts, const struct frame_arg *arg)
static void frame_apply_cmd_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *)
void clear_last_displayed_sal(void)
static frame_info_ptr leading_innermost_frame(int level)
static void frame_apply_command(const char *cmd, int from_tty)
const char print_entry_values_if_needed[]
const char print_frame_info_location_and_address[]
static struct cmd_list_element * frame_apply_cmd_list
static const char *const print_frame_info_choices[]
const char print_frame_arguments_none[]
static void print_frame_args(const frame_print_options &fp_opts, struct symbol *func, frame_info_ptr frame, int num, struct ui_file *stream)
static const gdb::option::option_def frame_print_option_defs[]
void iterate_over_block_local_vars(const struct block *block, iterate_over_block_arg_local_vars_cb cb)
static void faas_command(const char *cmd, int from_tty)
void read_frame_arg(const frame_print_options &fp_opts, symbol *sym, frame_info_ptr frame, struct frame_arg *argp, struct frame_arg *entryargp)
static std::array< gdb::option::option_def_group, 3 > make_backtrace_options_def_group(frame_print_options *fp_opts, backtrace_cmd_options *bt_cmd_opts, set_backtrace_options *set_bt_opts)
const char print_frame_info_auto[]
bool last_displayed_sal_is_valid(void)
static const gdb::optional< enum print_what > print_frame_info_print_what[]
const char print_entry_values_only[]
frame_info_ptr find_relative_frame(frame_info_ptr frame, int *level_offset_ptr)
static void info_frame_command_core(frame_info_ptr fi, bool selected_frame_p)
const char print_entry_values_no[]
static frame_command_helper< info_frame_command_core > info_frame_cmd
static const gdb::option::option_def backtrace_command_option_defs[]
static void down_silently_base(const char *count_exp)
static void print_frame_local_vars(frame_info_ptr frame, bool quiet, const char *regexp, const char *t_regexp, int num_tabs, struct ui_file *stream)
void iterate_over_block_arg_vars(const struct block *b, iterate_over_block_arg_local_vars_cb cb)
void info_args_command(const char *args, int from_tty)
const char print_frame_arguments_presence[]
static void frame_apply_level_command(const char *cmd, int from_tty)
static struct cmd_list_element * info_frame_cmd_list
static const char *const print_entry_values_choices[]
static void frame_apply_all_command(const char *cmd, int from_tty)
static void up_silently_command(const char *count_exp, int from_tty)
static void frame_apply_command_count(const char *which_command, const char *cmd, int from_tty, frame_info_ptr trailing, int count)
void return_command(const char *retval_exp, int from_tty)
static void up_command(const char *count_exp, int from_tty)
static void frame_apply_completer(completion_tracker &tracker, const char *text)
frame_print_options user_frame_print_options
static enum auto_boolean disassemble_next_line
static void info_print_command_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *)
static struct cmd_list_element * frame_cmd_list
static gdb::option::option_def_group make_info_print_options_def_group(info_print_options *opts)
void read_frame_local(struct symbol *sym, frame_info_ptr frame, struct frame_arg *argp)
static void up_silently_base(const char *count_exp)
gdb::function_view< void(const char *print_name, struct symbol *sym)> iterate_over_block_arg_local_vars_cb
const block * superblock() const
symbol * function() const
struct minimal_symbol * minsym
bool user_selected_context
gdb::unique_xmalloc_ptr< char > error
const char * print_frame_arguments
const char * print_entry_values
const char * print_frame_info
bool print_raw_frame_arguments
const char * natural_name() const
const char * print_name() const
const char * search_name() const
enum language language() const
const char * linkage_name() const
virtual bool symbol_printing_suppressed(struct symbol *symbol) const
gdb::optional< compiled_regex > treg
void operator()(const char *print_name, struct symbol *sym)
gdb::optional< compiled_regex > preg
struct value *(* read_variable_at_entry)(struct symbol *symbol, frame_info_ptr frame)
address_class aclass() const
struct type * type() const
domain_enum domain() const
LONGEST value_longest() const
struct program_space * pspace
enum language language() const
struct type * target_type() const
std::vector< range > unavailable
bool treg_matches_sym_type_name(const compiled_regex &treg, const struct symbol *sym)
struct block_symbol lookup_symbol_search_name(const char *search_name, const struct block *block, domain_enum domain)
void collect_symbol_completion_matches(completion_tracker &tracker, complete_symbol_mode mode, symbol_name_match_type name_match_type, const char *text, const char *word)
#define SYMBOL_COMPUTED_OPS(symbol)
static styled_string_s * styled_string(const ui_file_style &style, const char *str, styled_string_s &&tmp={})
int query(const char *ctlstr,...)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void fprintf_styled(struct ui_file *stream, const ui_file_style &style, const char *format,...)
void gdb_printf(struct ui_file *stream, const char *format,...)
void fputs_styled(const char *linebuffer, const ui_file_style &style, struct ui_file *stream)
void gdb_flush(struct ui_file *stream)
void gdb_puts(const char *linebuffer, struct ui_file *stream)
struct value * value_cast(struct type *type, struct value *arg2)
void get_no_prettyformat_print_options(struct value_print_options *opts)
void val_print_unavailable(struct ui_file *stream)
void get_user_print_options(struct value_print_options *opts)
void common_val_print_checked(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
void val_print_not_saved(struct ui_file *stream)
struct type * value_type(const struct value *value)
enum return_value_convention struct_return_convention(struct gdbarch *gdbarch, struct value *function, struct type *value_type)
int value_entirely_available(struct value *value)
gdb::array_view< const gdb_byte > value_contents_all(struct value *value)
int value_lazy(const struct value *value)
CORE_ADDR value_as_address(struct value *val)
void value_fetch_lazy(struct value *val)
struct value * allocate_optimized_out_value(struct type *type)
CORE_ADDR value_address(const struct value *value)
struct value * coerce_ref(struct value *arg)
gdb::array_view< const gdb_byte > value_contents(struct value *value)
LONGEST value_as_long(struct value *val)
bool value_contents_eq(const struct value *val1, LONGEST offset1, const struct value *val2, LONGEST offset2, LONGEST length)
int value_optimized_out(struct value *value)
value_ref_ptr release_value(struct value *val)
#define VALUE_REGNUM(val)