37#include "gdbsupport/gdb_optional.h"
38#include "gdbsupport/gdb-safe-ctype.h"
48 int skip_unavailable);
58 error (_(
"-enable-frame-filters: no arguments allowed"));
66 frame_filter_flags
flags,
69 int frame_low,
int frame_high)
76 frame_low, frame_high);
100 static const struct mi_opt opts[] =
102 {
"-no-frame-filters", NO_FRAME_FILTERS, 0},
111 int opt =
mi_getopt (
"-stack-list-frames", argc, argv,
115 switch ((
enum opt) opt)
117 case NO_FRAME_FILTERS:
125 if ((argc - oind != 0) && (argc - oind != 2))
126 error (_(
"-stack-list-frames: Usage: [--no-frame-filters] [FRAME_LOW FRAME_HIGH]"));
129 if (argc - oind == 2)
131 frame_low = atoi (argv[0 + oind]);
132 frame_high = atoi (argv[1 + oind]);
150 error (_(
"-stack-list-frames: Not enough frames in stack."));
157 int py_frame_low = frame_low;
162 if (py_frame_low == -1)
167 py_frame_low, frame_high);
177 fi && (i <= frame_high || frame_high == -1);
198 error (_(
"-stack-info-depth: Usage: [MAX_DEPTH]"));
201 frame_high = atoi (argv[0]);
208 fi && (i < frame_high || frame_high == -1);
228 int skip_unavailable = 0;
237 static const struct mi_opt opts[] =
239 {
"-no-frame-filters", NO_FRAME_FILTERS, 0},
240 {
"-skip-unavailable", SKIP_UNAVAILABLE, 0},
248 int opt =
mi_getopt (
"-stack-list-locals", argc - 1, argv,
253 switch ((
enum opt) opt)
255 case NO_FRAME_FILTERS:
258 case SKIP_UNAVAILABLE:
259 skip_unavailable = 1;
267 if (argc - oind != 1)
268 error (_(
"-stack-list-locals: Usage: [--no-frame-filters] "
269 "[--skip-unavailable] PRINT_VALUES"));
307 int skip_unavailable = 0;
314 static const struct mi_opt opts[] =
316 {
"-no-frame-filters", NO_FRAME_FILTERS, 0},
317 {
"-skip-unavailable", SKIP_UNAVAILABLE, 0},
329 switch ((
enum opt) opt)
331 case NO_FRAME_FILTERS:
334 case SKIP_UNAVAILABLE:
335 skip_unavailable = 1;
340 if (argc - oind != 1 && argc - oind != 3)
341 error (_(
"-stack-list-arguments: Usage: " \
342 "[--no-frame-filters] [--skip-unavailable] "
343 "PRINT_VALUES [FRAME_LOW FRAME_HIGH]"));
345 if (argc - oind == 3)
347 frame_low = atoi (argv[1 + oind]);
348 frame_high = atoi (argv[2 + oind]);
368 error (_(
"-stack-list-arguments: Not enough frames in stack."));
375 int py_frame_low = frame_low;
380 if (py_frame_low == -1)
385 py_frame_low, frame_high);
395 fi && (i <= frame_high || frame_high == -1);
421 int skip_unavailable = 0;
430 static const struct mi_opt opts[] =
432 {
"-no-frame-filters", NO_FRAME_FILTERS, 0},
433 {
"-skip-unavailable", SKIP_UNAVAILABLE, 0},
441 int opt =
mi_getopt (
"-stack-list-variables", argc - 1,
442 argv, opts, &oind, &oarg);
445 switch ((
enum opt) opt)
447 case NO_FRAME_FILTERS:
450 case SKIP_UNAVAILABLE:
451 skip_unavailable = 1;
459 if (argc - oind != 1)
460 error (_(
"-stack-list-variables: Usage: [--no-frame-filters] " \
461 "[--skip-unavailable] PRINT_VALUES"));
498 gdb_assert (!arg->
val || !arg->
error);
500 && arg->
error == NULL)
503 && (arg->
val != NULL || arg->
error != NULL)));
508 if (skip_unavailable && arg->
val != NULL
518 gdb::optional<ui_out_emit_tuple> tuple_emitter;
520 tuple_emitter.emplace (uiout,
nullptr);
542 stb.
printf (_(
"<error reading variable: %s>"), arg->
error.get ());
550 opts.deref_ref =
true;
554 catch (
const gdb_exception_error &except)
556 stb.
printf (_(
"<error reading variable: %s>"),
576 const char *name_of_result;
584 name_of_result =
"locals";
587 name_of_result =
"args";
590 name_of_result =
"variables";
593 internal_error (
"unexpected what_to_list: %d", (
int) what);
604 switch (sym->aclass ())
628 print_me = !sym->is_argument ();
630 print_me = sym->is_argument ();
643 gdb_assert (sym2 != NULL);
696 gdb_assert (frame_exp != NULL);
757 if (argc == 0 || argc > 1)
758 error (_(
"-stack-select-frame: Usage: FRAME_SPEC"));
767 error (_(
"-stack-info-frame: No arguments allowed"));
iterator_range< block_iterator_wrapper > block_iterator_range
const struct block * get_frame_block(frame_info_ptr frame, CORE_ADDR *addr_in_block)
virtual void puts(const char *str)
void printf(const char *,...) ATTRIBUTE_PRINTF(2
void field_signed(const char *fldname, LONGEST value)
void field_stream(const char *fldname, string_file &stream, const ui_file_style &style=ui_file_style())
struct value * parse_and_eval(const char *exp, parser_flags flags)
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)
void select_frame(frame_info_ptr fi)
struct frame_id frame_id_build_wild(CORE_ADDR stack_addr)
frame_info_ptr get_selected_frame(const char *message)
frame_info_ptr get_current_frame(void)
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)
void print_frame_info(const frame_print_options &fp_opts, frame_info_ptr, int print_level, enum print_what print_what, int args, int set_current_sal)
void read_frame_arg(const frame_print_options &fp_opts, symbol *sym, frame_info_ptr frame, struct frame_arg *argp, struct frame_arg *entryargp)
const char print_entry_values_only[]
const char print_entry_values_no[]
frame_info_ptr find_relative_frame(frame_info_ptr, int *)
frame_print_options user_frame_print_options
void read_frame_local(struct symbol *sym, frame_info_ptr frame, struct frame_arg *argp)
struct type * check_typedef(struct type *type)
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
const struct language_defn * language_def(enum language lang)
static frame_info_ptr parse_frame_specification(const char *frame_exp)
static enum ext_lang_bt_status mi_apply_ext_lang_frame_filter(frame_info_ptr frame, frame_filter_flags flags, enum print_values print_values, struct ui_out *out, int frame_low, int frame_high)
static void list_args_or_locals(const frame_print_options &fp_opts, enum what_to_list what, enum print_values values, frame_info_ptr fi, int skip_unavailable)
static void list_arg_or_local(const struct frame_arg *arg, enum what_to_list what, enum print_values values, int skip_unavailable)
bool mi_simple_type_p(struct type *type)
mi_cmd_argv_ftype mi_cmd_stack_info_frame
mi_cmd_argv_ftype mi_cmd_stack_list_variables
mi_cmd_argv_ftype mi_cmd_enable_frame_filters
mi_cmd_argv_ftype mi_cmd_stack_select_frame
mi_cmd_argv_ftype mi_cmd_stack_info_depth
mi_cmd_argv_ftype mi_cmd_stack_list_locals
mi_cmd_argv_ftype mi_cmd_stack_list_frames
mi_cmd_argv_ftype mi_cmd_stack_list_args
int mi_getopt(const char *prefix, int argc, const char *const *argv, const struct mi_opt *opts, int *oind, const char **oarg)
int mi_getopt_allow_unknown(const char *prefix, int argc, const char *const *argv, const struct mi_opt *opts, int *oind, const char **oarg)
enum print_values mi_parse_print_values(const char *name)
void print_value(value *val, const value_print_options &opts)
const block * superblock() const
symbol * function() const
gdb::unique_xmalloc_ptr< char > error
const char * print_name() const
const char * search_name() const
enum language language() const
struct type * type() const
bool bytes_available(LONGEST offset, ULONGEST length) const
bool entirely_unavailable()
LONGEST embedded_offset() const
struct type * type() const
struct block_symbol lookup_symbol_search_name(const char *search_name, const struct block *block, domain_enum domain)
void type_print(struct type *type, const char *varstring, struct ui_file *stream, int show)
void get_no_prettyformat_print_options(struct value_print_options *opts)
int val_print_scalar_type_p(struct type *type)
void common_val_print(struct value *value, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
CORE_ADDR value_as_address(struct value *val)
LONGEST value_as_long(struct value *val)