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);
373 catch (
const gdb_exception_error &e)
385 int first,
struct ui_file *stream)
393 for (i = 0; i < num; i++)
400 sizeof (
int), byte_order);
405 start +=
sizeof (int);
423 gdb_assert (!arg->
val || !arg->
error);
454 stb.
printf (_(
"<error reading variable: %s>"), arg->
error.get ());
489 catch (
const gdb_exception_error &except)
491 stb.
printf (_(
"<error reading variable: %s>"),
517 catch (
const gdb_exception_error &except)
519 argp->
error.reset (xstrdup (except.what ()));
531 struct value *val = NULL, *entryval = NULL;
532 char *val_error = NULL, *entryval_error = NULL;
542 catch (
const gdb_exception_error &except)
544 val_error = (
char *) alloca (except.message->size () + 1);
545 strcpy (val_error, except.what ());
562 catch (
const gdb_exception_error &except)
564 if (except.error != NO_ENTRY_VALUE_ERROR)
566 entryval_error = (
char *) alloca (except.message->size () + 1);
567 strcpy (entryval_error, except.what ());
571 if (entryval != NULL && entryval->optimized_out ())
585 if (entryval->lazy ())
586 entryval->fetch_lazy ();
591 struct value *val_deref = NULL, *entryval_deref;
599 struct type *type_deref;
602 if (val_deref->
lazy ())
604 type_deref = val_deref->
type ();
607 if (entryval_deref->lazy ())
608 entryval_deref->fetch_lazy ();
618 catch (
const gdb_exception_error &except)
622 if (except.error == NO_ENTRY_VALUE_ERROR)
624 else if (except.message != NULL)
627 = (
char *) alloca (except.message->size () + 1);
628 strcpy (entryval_error, except.what ());
633 if (val == val_deref)
644 if (val_error && entryval_error
645 && strcmp (val_error, entryval_error) == 0)
647 entryval_error = NULL;
656 if (entryval == NULL)
660 gdb_assert (val == NULL);
666 catch (
const gdb_exception_error &except)
668 val_error = (
char *) alloca (except.message->size () + 1);
669 strcpy (val_error, except.what ());
678 entryval_error = NULL;
692 argp->
error.reset (val_error ? xstrdup (val_error) : NULL);
693 if (!val && !val_error)
705 entryargp->
sym = sym;
706 entryargp->
val = entryval;
707 entryargp->
error.reset (entryval_error ? xstrdup (entryval_error) : NULL);
708 if (!entryval && !entryval_error)
726 int num,
struct ui_file *stream)
733 long highest_offset = -1;
735 int args_printed = 0;
747 const struct block *b =
func->value_block ();
779 ((current_offset + arg_size +
sizeof (int) - 1)
780 & ~(
sizeof (int) - 1));
784 if (highest_offset == -1
785 || (current_offset > highest_offset))
786 highest_offset = current_offset;
790 args_printed += (arg_size +
sizeof (int) - 1) /
sizeof (int);
822 gdb_assert (nsym != NULL);
906 if (highest_offset == -1)
909 start = highest_offset;
911 if (!print_names && !first && num > 0)
945 _(
"Debugger's willingness to use "
946 "disassemble-next-line is %s.\n"),
955 int how_many, CORE_ADDR low, CORE_ADDR high)
964 catch (
const gdb_exception_error &exception)
976static gdb::optional<enum print_what>
983 internal_error (
"Unexpected print frame-info value `%s'.",
1027 int set_current_sal)
1068 uiout->
field_string (
"func",
"<function called from gdb>",
1074 uiout->
field_string (
"func",
"<signal handler called>",
1079 uiout->
field_string (
"func",
"<cross-architecture call>",
1107 if (location_print || !sal.
symtab)
1116 && source_print && !sal.
symtab)
1120 if (source_print && sal.
symtab)
1158 if (opts.addressprint && mid_statement)
1173 if (set_current_sal)
1258gdb::unique_xmalloc_ptr<char>
1263 gdb::unique_xmalloc_ptr<char> funname;
1274 *funlang =
func->language ();
1289 if (funname == NULL)
1301 if (msymbol.
minsym != NULL)
1327 gdb::unique_xmalloc_ptr<char> funname
1343 if (
opts.addressprint)
1355 uiout->
text (
" in ");
1360 gdb_puts (funname ? funname.get () :
"??", &stb);
1373 gdb_assert (numargs >= 0);
1384 catch (
const gdb_exception_error &e)
1396 const char *filename_display;
1401 uiout->
text (
" at ");
1419 && pc_p && (funname == NULL || sal.
symtab == NULL))
1429 uiout->
text (
" from ");
1448 const char *text,
const char *word)
1474 const char *funname = 0;
1476 const char *pc_regname;
1481 CORE_ADDR caller_pc = 0;
1482 int caller_pc_p = 0;
1504 gdb::unique_xmalloc_ptr<char> func_only;
1507 funname =
func->print_name ();
1519 funname = func_only.get ();
1522 else if (frame_pc_p)
1527 if (msymbol.
minsym != NULL)
1578 catch (
const gdb_exception_error &ex)
1582 case NOT_AVAILABLE_ERROR:
1585 case OPTIMIZED_OUT_ERROR:
1601 if (calling_frame_info == NULL)
1606 if (reason != UNWIND_NO_REASON)
1642 gdb_printf (
" Arglist at unknown address.\n");
1657 gdb_assert (numargs >= 0);
1660 else if (numargs == 1)
1701 gdb_assert (
value != NULL);
1739 for (i = 0; i < numregs; i++)
1752 &
lval, &addr, &realnum, NULL);
1768 if (count || need_nl)
1782 gdb_assert (level >= 0);
1784 while (leading !=
nullptr && level)
1804 gdb_assert (count > 0);
1807 while (current !=
nullptr && count--)
1815 while (current !=
nullptr)
1866template <
void (*FPTR) (frame_info_ptr fi,
bool selected_frame_p)>
1874 level (
const char *arg,
int from_tty)
1880 error (_(
"No frame at level %s."), arg);
1889 address (
const char *arg,
int from_tty)
1894 error (_(
"No frame at address %s."), arg);
1903 view (
const char *args,
int from_tty)
1908 error (_(
"Missing address argument to view a frame"));
1910 gdb_argv argv (args);
1912 if (argv.count () == 2)
1933 function (
const char *arg,
int from_tty)
1936 error (_(
"Missing function name argument"));
1939 error (_(
"No frame for function \"%s\"."), arg);
1956 level (arg, from_tty);
1963static frame_command_helper <info_frame_command_core>
info_frame_cmd;
1964static frame_command_helper <frame_command_core>
frame_cmd;
1973 const char *count_exp,
int from_tty)
1978 int py_start = 0, py_end = 0;
1982 error (_(
"No stack."));
2003 frame_filter_flags
flags = 0;
2045 if (count_exp != NULL && count < 0)
2072 gdb_printf (_(
"(More stack frames follow...)\n"));
2076 if (fi == NULL && trailing != NULL)
2081 if (reason >= UNWIND_FIRST_ERROR)
2091static inline std::array<gdb::option::option_def_group, 3>
2113 const char *save_arg = arg;
2116 if (this_arg.empty ())
2119 if (startswith (
"no-filters", this_arg))
2121 if (bt_cmd_opts !=
nullptr)
2122 bt_cmd_opts->no_filters =
true;
2124 else if (startswith (
"full", this_arg))
2126 if (bt_cmd_opts !=
nullptr)
2127 bt_cmd_opts->full =
true;
2129 else if (startswith (
"hide", this_arg))
2131 if (bt_cmd_opts !=
nullptr)
2132 bt_cmd_opts->hide =
true;
2165 scoped_restore restore_set_backtrace_options
2176 const char *text,
const char *)
2186 const char *p = skip_to_space (text);
2189 static const char *
const backtrace_cmd_qualifier_choices[] = {
2190 "full",
"no-filters",
"hide",
nullptr,
2218 switch (sym->aclass ())
2226 if (sym->is_argument ())
2230 cb (sym->print_name (), sym);
2264 gdb::optional<compiled_regex>
preg;
2265 gdb::optional<compiled_regex>
treg;
2282 if (
preg.has_value ()
2285 if (
treg.has_value ()
2294 warning (_(
"Unable to restore previously selected frame."));
2310prepare_reg (
const char *regexp, gdb::optional<compiled_regex> *reg)
2316 reg->emplace (regexp, cflags, _(
"Invalid regexp"));
2336 const char *regexp,
const char *t_regexp,
2337 int num_tabs,
struct ui_file *stream)
2347 _(
"PC unavailable, cannot determine locals.\n"));
2355 gdb_printf (stream,
"No symbol table info available.\n");
2376 if (regexp == NULL && t_regexp == NULL)
2379 gdb_printf (stream, _(
"No matching locals.\n"));
2425 const char *text,
const char * )
2446 if (args !=
nullptr && *args ==
'\0')
2452 opts.type_regexp.empty () ?
nullptr : opts.type_regexp.c_str (),
2465 if (sym->is_argument ())
2481 cb (sym->print_name (), sym2);
2500 const char *regexp,
const char *t_regexp,
2506 gdb::optional<compiled_regex> preg;
2507 gdb::optional<compiled_regex> treg;
2513 _(
"PC unavailable, cannot determine args.\n"));
2521 gdb_printf (stream, _(
"No symbol table info available.\n"));
2539 if (regexp == NULL && t_regexp == NULL)
2542 gdb_printf (stream, _(
"No matching arguments.\n"));
2555 if (args !=
nullptr && *args ==
'\0')
2561 opts.type_regexp.empty () ?
nullptr : opts.type_regexp.c_str (),
2595 while (*level_offset_ptr > 0)
2601 (*level_offset_ptr)--;
2606 while (*level_offset_ptr < 0)
2612 (*level_offset_ptr)++;
2632 if (count != 0 && count_exp == NULL)
2633 error (_(
"Initial frame selected; you cannot go up."));
2644up_command (
const char *count_exp,
int from_tty)
2663 if (count != 0 && count_exp == NULL)
2670 error (_(
"Bottom (innermost) frame selected; you cannot go down."));
2697 struct value *return_value = NULL;
2698 struct value *function = NULL;
2699 std::string query_prefix;
2706 error (_(
"Can not force return from an inlined function."));
2719 return_value = retval_expr->evaluate ();
2723 if (thisfun != NULL)
2727 if (retval_expr->first_opcode () != UNOP_CAST
2728 && retval_expr->first_opcode () != UNOP_CAST_TYPE)
2729 error (_(
"Return value type not available for selected "
2731 "Please use an explicit cast of the value to return."));
2739 if (return_value->
lazy ())
2742 if (thisfun != NULL)
2752 return_value = NULL;
2753 else if (thisfun != NULL)
2758 string_printf (
"Function '%s' does not follow the target "
2759 "calling convention.\n"
2760 "If you continue, setting the return value "
2761 "will probably lead to unpredictable "
2770 query_prefix =
"The location at which to store the "
2771 "function's return value is unknown.\n"
2772 "If you continue, the return value "
2773 "that you specified will be ignored.\n";
2774 return_value = NULL;
2786 if (thisfun == NULL)
2787 confirmed =
query (_(
"%sMake selected stack frame return now? "),
2788 query_prefix.c_str ());
2792 warning (_(
"Function does not return normally to caller."));
2793 confirmed =
query (_(
"%sMake %s return now? "),
2794 query_prefix.c_str (),
2798 error (_(
"Not confirmed"));
2805 if (return_value != NULL)
2813 (cache_arch, function, return_type,
2815 return_value->
contents ().data () );
2837 struct function_bounds
2839 CORE_ADDR low, high;
2845 gdb_assert (function_name != NULL);
2848 std::vector<symtab_and_line> sals
2851 gdb::def_vector<function_bounds> func_bounds (sals.size ());
2852 for (
size_t i = 0; i < sals.size (); i++)
2855 func_bounds[i].low = func_bounds[i].high = 0;
2856 else if (sals[i].pc == 0
2858 &func_bounds[i].low,
2859 &func_bounds[i].high) == 0)
2860 func_bounds[i].low = func_bounds[i].high = 0;
2865 for (
size_t i = 0; (i < sals.size () && !found); i++)
2874 while (!found && level == 0);
2890 "q", [] (
qcs_flags *opt) {
return &opt->quiet; },
2891 N_(
"Disables printing the frame location information."),
2895 "c", [] (
qcs_flags *opt) {
return &opt->cont; },
2896 N_(
"Print any error raised by COMMAND and continue."),
2900 "s", [] (
qcs_flags *opt) {
return &opt->silent; },
2901 N_(
"Silently ignore any errors or empty output produced by COMMAND."),
2908static inline std::array<gdb::option::option_def_group, 2>
2943 const char *cmd,
int from_tty,
2955 if (cmd == NULL || *cmd ==
'\0')
2956 error (_(
"Please specify a command to apply on the selected frames"));
2966 scoped_restore restore_set_backtrace_options
2976 std::string cmd_result;
2984 (cmd_result, cmd, from_tty,
gdb_stdout->term_out ());
2987 "unable to get selected frame."));
2988 if (!
flags.silent || cmd_result.length () > 0)
2995 catch (
const gdb_exception_error &ex)
2998 "unable to get selected frame."));
3030 const char *text,
const char *)
3049 catch (
const gdb_exception_error &ex)
3056 const char *cmd = levels.
cur_tok ();
3066 && cmd > text && !isspace (cmd[-1]))
3081 const char *text,
const char *)
3091 const char *text,
const char *)
3093 const char *cmd = text;
3100 if (cmd > text && !isspace (cmd[-1]))
3116 error (_(
"No stack."));
3118 bool level_found =
false;
3119 const char *levels_str = cmd;
3134 error (_(
"Missing or invalid LEVEL... argument"));
3139 levels.
init (levels_str);
3147 n_frames = levels.
end_value () - level_beg + 1;
3164 error (_(
"No stack."));
3179 error (_(
"No stack."));
3182 error (_(
"Missing COUNT argument."));
3185 error (_(
"Invalid COUNT argument."));
3204 if (cmd == NULL || *cmd ==
'\0')
3205 error (_(
"Please specify a command to apply on all frames"));
3206 std::string expanded = std::string (
"frame apply all -s ") + cmd;
3269Make selected stack frame return to its caller.\n\
3270Control remains in the debugger, but when you continue\n\
3271execution will resume in the frame above the one now selected.\n\
3272If an argument is given, it is an expression for the value to return."));
3275Select and print stack frame that called this one.\n\
3276An argument says how many frames up to go."));
3278Same as the `up' command, but does not print anything.\n\
3279This is useful in command scripts."));
3283Select and print stack frame called by this one.\n\
3284An argument says how many frames down to go."));
3288Same as the `down' command, but does not print anything.\n\
3289This is useful in command scripts."));
3294Select and print a stack frame.\n\
3295With no argument, print the selected stack frame. (See also \"info frame\").\n\
3296A single numerical argument specifies the frame to select."),
3300#define FRAME_APPLY_OPTION_HELP "\
3301Prints the frame location information followed by COMMAND output.\n\
3303By default, an error raised during the execution of COMMAND\n\
3304aborts \"frame apply\".\n\
3309 const auto frame_apply_opts
3313Apply a command to a number of frames.\n\
3314Usage: frame apply COUNT [OPTION]... COMMAND\n\
3315With a negative COUNT argument, applies the command on outermost -COUNT frames.\n"
3320 frame_apply_cmd_help.c_str (),
3326Apply a command to all frames.\n\
3328Usage: frame apply all [OPTION]... COMMAND\n"
3333 frame_apply_all_cmd_help.c_str (),
3338Apply a command to a list of frames.\n\
3340Usage: frame apply level LEVEL... [OPTION]... COMMAND\n\
3341LEVEL is a space-separated list of levels of frames to apply COMMAND on.\n"
3346 frame_apply_level_cmd_help.c_str (),
3351Apply a command to all frames (ignoring errors and empty output).\n\
3352Usage: faas [OPTION]... COMMAND\n\
3353shortcut for 'frame apply all -s [OPTION]... COMMAND'\n\
3354See \"help frame apply all\" for available options."));
3359Select and print a stack frame by stack address.\n\
3361Usage: frame address STACK-ADDRESS"),
3366View a stack frame that might be outside the current backtrace.\n\
3368Usage: frame view STACK-ADDRESS\n\
3369 frame view STACK-ADDRESS PC-ADDRESS"),
3374Select and print a stack frame by function name.\n\
3376Usage: frame function NAME\n\
3378The innermost frame that visited function NAME is selected."),
3385Select and print a stack frame by level.\n\
3387Usage: frame level LEVEL"),
3392Select a stack frame without printing anything.\n\
3393A single numerical argument specifies the frame to select."),
3399Select a stack frame by stack address.\n\
3401Usage: select-frame address STACK-ADDRESS"),
3408Select a stack frame that might be outside the current backtrace.\n\
3410Usage: select-frame view STACK-ADDRESS\n\
3411 select-frame view STACK-ADDRESS PC-ADDRESS"),
3417Select a stack frame by function name.\n\
3419Usage: select-frame function NAME"),
3426Select a stack frame by level.\n\
3428Usage: select-frame level LEVEL"),
3432 const auto backtrace_opts
3435 static std::string backtrace_help
3437Print backtrace of all stack frames, or innermost COUNT frames.\n\
3438Usage: backtrace [OPTION]... [QUALIFIER]... [COUNT | -COUNT]\n\
3443For backward compatibility, the following qualifiers are supported:\n\
3445 full - same as -full option.\n\
3446 no-filters - same as -no-filters option.\n\
3447 hide - same as -hide.\n\
3449With a negative COUNT, print outermost -COUNT frames."),
3454 backtrace_help.c_str ());
3462 _(
"Backtrace of the stack, or innermost COUNT frames."));
3467 _(
"All about the selected stack frame.\n\
3468With no arguments, displays information about the currently selected stack\n\
3469frame. Alternatively a frame specification may be provided (See \"frame\")\n\
3470the information is then printed about the specified frame."),
3476Print information about a stack frame selected by stack address.\n\
3478Usage: info frame address STACK-ADDRESS"),
3483Print information about a stack frame outside the current backtrace.\n\
3485Usage: info frame view STACK-ADDRESS\n\
3486 info frame view STACK-ADDRESS PC-ADDRESS"),
3491Print information about a stack frame selected by function name.\n\
3493Usage: info frame function NAME"),
3499Print information about a stack frame selected by level.\n\
3501Usage: info frame level LEVEL"),
3506All local variables of current stack frame or those matching REGEXPs.\n\
3507Usage: info locals [-q] [-t TYPEREGEXP] [NAMEREGEXP]\n\
3508Prints the local variables of the current stack frame.\n"),
3509 _(
"local variables"),
3514All argument variables of current stack frame or those matching REGEXPs.\n\
3515Usage: info args [-q] [-t TYPEREGEXP] [NAMEREGEXP]\n\
3516Prints the argument variables of the current stack frame.\n"),
3517 _(
"argument variables"),
3528Set whether to print frame arguments in raw form."), _(
"\
3529Show whether to print frame arguments in raw form."), _(
"\
3530If set, frame arguments are printed in raw form, bypassing any\n\
3531pretty-printers for that value."),
3538Set whether to disassemble next source line or insn when execution stops."),
3540Show whether to disassemble next source line or insn when execution stops."),
3542If ON, GDB will display disassembly of the next source line, in addition\n\
3543to displaying the source line itself. If the next source line cannot\n\
3544be displayed (e.g., source is unavailable or there's no line info), GDB\n\
3545will display disassembly of next instruction instead of showing the\n\
3547If AUTO, display disassembly of next instruction only if the source line\n\
3548cannot be displayed.\n\
3549If 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)
iterator_range< block_iterator_wrapper > block_iterator_range
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 * parse_and_eval(const char *exp, parser_flags flags)
LONGEST parse_and_eval_long(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, parser_flags flags=0)
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)
CORE_ADDR get_frame_address_in_block(frame_info_ptr this_frame)
static frame_info_ptr create_new_frame(frame_id id)
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_as_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, struct value **read_value, 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
void notify_user_selected_context_changed(user_selected_what selection)
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)
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
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
LONGEST value_longest() const
struct program_space * pspace
enum language language() const
struct type * target_type() const
static struct value * allocate_optimized_out(struct type *type)
gdb::array_view< const gdb_byte > contents_all()
gdb::array_view< const gdb_byte > contents()
bool entirely_available()
struct type * type() const
bool contents_eq(LONGEST offset1, const struct value *val2, LONGEST offset2, LONGEST length) const
enum lval_type lval() const
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)
enum return_value_convention struct_return_convention(struct gdbarch *gdbarch, struct value *function, struct type *value_type)
CORE_ADDR value_as_address(struct value *val)
struct value * coerce_ref(struct value *arg)
LONGEST value_as_long(struct value *val)
value_ref_ptr release_value(struct value *val)
#define VALUE_REGNUM(val)