GDB (xrefs)
Loading...
Searching...
No Matches
mi-cmd-stack.c
Go to the documentation of this file.
1/* MI Command Set - stack commands.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
3 Contributed by Cygnus Solutions (a Red Hat company).
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20#include "defs.h"
21#include "target.h"
22#include "frame.h"
23#include "value.h"
24#include "mi-cmds.h"
25#include "ui-out.h"
26#include "symtab.h"
27#include "block.h"
28#include "stack.h"
29#include "dictionary.h"
30#include "language.h"
31#include "valprint.h"
32#include "utils.h"
33#include "mi-getopt.h"
34#include "extension.h"
35#include <ctype.h>
36#include "mi-parse.h"
37#include "gdbsupport/gdb_optional.h"
38#include "safe-ctype.h"
39#include "inferior.h"
40#include "observable.h"
41
43
44static void list_args_or_locals (const frame_print_options &fp_opts,
45 enum what_to_list what,
46 enum print_values values,
48 int skip_unavailable);
49
50/* True if we want to allow Python-based frame filters. */
51static int frame_filters = 0;
52
53void
54mi_cmd_enable_frame_filters (const char *command, char **argv, int argc)
55{
56 if (argc != 0)
57 error (_("-enable-frame-filters: no arguments allowed"));
58 frame_filters = 1;
59}
60
61/* Like apply_ext_lang_frame_filter, but take a print_values */
62
63static enum ext_lang_bt_status
65 frame_filter_flags flags,
67 struct ui_out *out,
68 int frame_low, int frame_high)
69{
70 /* ext_lang_frame_args's MI options are compatible with MI print
71 values. */
74 out,
75 frame_low, frame_high);
76}
77
78/* Print a list of the stack frames. Args can be none, in which case
79 we want to print the whole backtrace, or a pair of numbers
80 specifying the frame numbers at which to start and stop the
81 display. If the two numbers are equal, a single frame will be
82 displayed. */
83
84void
85mi_cmd_stack_list_frames (const char *command, char **argv, int argc)
86{
87 int frame_low;
88 int frame_high;
89 int i;
92 int raw_arg = 0;
93 int oind = 0;
94 enum opt
95 {
96 NO_FRAME_FILTERS
97 };
98 static const struct mi_opt opts[] =
99 {
100 {"-no-frame-filters", NO_FRAME_FILTERS, 0},
101 { 0, 0, 0 }
102 };
103
104 /* Parse arguments. In this instance we are just looking for
105 --no-frame-filters. */
106 while (1)
107 {
108 char *oarg;
109 int opt = mi_getopt ("-stack-list-frames", argc, argv,
110 opts, &oind, &oarg);
111 if (opt < 0)
112 break;
113 switch ((enum opt) opt)
114 {
115 case NO_FRAME_FILTERS:
116 raw_arg = oind;
117 break;
118 }
119 }
120
121 /* After the last option is parsed, there should either be low -
122 high range, or no further arguments. */
123 if ((argc - oind != 0) && (argc - oind != 2))
124 error (_("-stack-list-frames: Usage: [--no-frame-filters] [FRAME_LOW FRAME_HIGH]"));
125
126 /* If there is a range, set it. */
127 if (argc - oind == 2)
128 {
129 frame_low = atoi (argv[0 + oind]);
130 frame_high = atoi (argv[1 + oind]);
131 }
132 else
133 {
134 /* Called with no arguments, it means we want the whole
135 backtrace. */
136 frame_low = -1;
137 frame_high = -1;
138 }
139
140 /* Let's position fi on the frame at which to start the
141 display. Could be the innermost frame if the whole stack needs
142 displaying, or if frame_low is 0. */
143 for (i = 0, fi = get_current_frame ();
144 fi && i < frame_low;
145 i++, fi = get_prev_frame (fi));
146
147 if (fi == NULL)
148 error (_("-stack-list-frames: Not enough frames in stack."));
149
150 ui_out_emit_list list_emitter (current_uiout, "stack");
151
152 if (! raw_arg && frame_filters)
153 {
154 frame_filter_flags flags = PRINT_LEVEL | PRINT_FRAME_INFO;
155 int py_frame_low = frame_low;
156
157 /* We cannot pass -1 to frame_low, as that would signify a
158 relative backtrace from the tail of the stack. So, in the case
159 of frame_low == -1, assign and increment it. */
160 if (py_frame_low == -1)
161 py_frame_low++;
162
165 py_frame_low, frame_high);
166 }
167
168 /* Run the inbuilt backtrace if there are no filters registered, or
169 if "--no-frame-filters" has been specified from the command. */
170 if (! frame_filters || raw_arg || result == EXT_LANG_BT_NO_FILTERS)
171 {
172 /* Now let's print the frames up to frame_high, or until there are
173 frames in the stack. */
174 for (;
175 fi && (i <= frame_high || frame_high == -1);
176 i++, fi = get_prev_frame (fi))
177 {
178 QUIT;
179 fi.prepare_reinflate ();
180 /* Print the location and the address always, even for level 0.
181 If args is 0, don't print the arguments. */
183 fi, 1, LOC_AND_ADDRESS, 0 /* args */, 0);
184 fi.reinflate ();
185 }
186 }
187}
188
189void
190mi_cmd_stack_info_depth (const char *command, char **argv, int argc)
191{
192 int frame_high;
193 int i;
195
196 if (argc > 1)
197 error (_("-stack-info-depth: Usage: [MAX_DEPTH]"));
198
199 if (argc == 1)
200 frame_high = atoi (argv[0]);
201 else
202 /* Called with no arguments, it means we want the real depth of
203 the stack. */
204 frame_high = -1;
205
206 for (i = 0, fi = get_current_frame ();
207 fi && (i < frame_high || frame_high == -1);
208 i++, fi = get_prev_frame (fi))
209 QUIT;
210
211 current_uiout->field_signed ("depth", i);
212}
213
214/* Print a list of the locals for the current frame. With argument of
215 0, print only the names, with argument of 1 print also the
216 values. */
217
218void
219mi_cmd_stack_list_locals (const char *command, char **argv, int argc)
220{
221 frame_info_ptr frame;
222 int raw_arg = 0;
225 int oind = 0;
226 int skip_unavailable = 0;
227
228 if (argc > 1)
229 {
230 enum opt
231 {
232 NO_FRAME_FILTERS,
233 SKIP_UNAVAILABLE,
234 };
235 static const struct mi_opt opts[] =
236 {
237 {"-no-frame-filters", NO_FRAME_FILTERS, 0},
238 {"-skip-unavailable", SKIP_UNAVAILABLE, 0},
239 { 0, 0, 0 }
240 };
241
242 while (1)
243 {
244 char *oarg;
245 /* Don't parse 'print-values' as an option. */
246 int opt = mi_getopt ("-stack-list-locals", argc - 1, argv,
247 opts, &oind, &oarg);
248
249 if (opt < 0)
250 break;
251 switch ((enum opt) opt)
252 {
253 case NO_FRAME_FILTERS:
254 raw_arg = oind;
255 break;
256 case SKIP_UNAVAILABLE:
257 skip_unavailable = 1;
258 break;
259 }
260 }
261 }
262
263 /* After the last option is parsed, there should be only
264 'print-values'. */
265 if (argc - oind != 1)
266 error (_("-stack-list-locals: Usage: [--no-frame-filters] "
267 "[--skip-unavailable] PRINT_VALUES"));
268
269 frame = get_selected_frame (NULL);
270 print_value = mi_parse_print_values (argv[oind]);
271
272 if (! raw_arg && frame_filters)
273 {
274 frame_filter_flags flags = PRINT_LEVEL | PRINT_LOCALS;
275
277 current_uiout, 0, 0);
278 }
279
280 /* Run the inbuilt backtrace if there are no filters registered, or
281 if "--no-frame-filters" has been specified from the command. */
282 if (! frame_filters || raw_arg || result == EXT_LANG_BT_NO_FILTERS)
283 {
285 locals, print_value, frame,
286 skip_unavailable);
287 }
288}
289
290/* Print a list of the arguments for the current frame. With argument
291 of 0, print only the names, with argument of 1 print also the
292 values. */
293
294void
295mi_cmd_stack_list_args (const char *command, char **argv, int argc)
296{
297 int frame_low;
298 int frame_high;
299 int i;
302 struct ui_out *uiout = current_uiout;
303 int raw_arg = 0;
304 int oind = 0;
305 int skip_unavailable = 0;
307 enum opt
308 {
309 NO_FRAME_FILTERS,
310 SKIP_UNAVAILABLE,
311 };
312 static const struct mi_opt opts[] =
313 {
314 {"-no-frame-filters", NO_FRAME_FILTERS, 0},
315 {"-skip-unavailable", SKIP_UNAVAILABLE, 0},
316 { 0, 0, 0 }
317 };
318
319 while (1)
320 {
321 char *oarg;
322 int opt = mi_getopt_allow_unknown ("-stack-list-args", argc, argv,
323 opts, &oind, &oarg);
324
325 if (opt < 0)
326 break;
327 switch ((enum opt) opt)
328 {
329 case NO_FRAME_FILTERS:
330 raw_arg = oind;
331 break;
332 case SKIP_UNAVAILABLE:
333 skip_unavailable = 1;
334 break;
335 }
336 }
337
338 if (argc - oind != 1 && argc - oind != 3)
339 error (_("-stack-list-arguments: Usage: " \
340 "[--no-frame-filters] [--skip-unavailable] "
341 "PRINT_VALUES [FRAME_LOW FRAME_HIGH]"));
342
343 if (argc - oind == 3)
344 {
345 frame_low = atoi (argv[1 + oind]);
346 frame_high = atoi (argv[2 + oind]);
347 }
348 else
349 {
350 /* Called with no arguments, it means we want args for the whole
351 backtrace. */
352 frame_low = -1;
353 frame_high = -1;
354 }
355
356 print_values = mi_parse_print_values (argv[oind]);
357
358 /* Let's position fi on the frame at which to start the
359 display. Could be the innermost frame if the whole stack needs
360 displaying, or if frame_low is 0. */
361 for (i = 0, fi = get_current_frame ();
362 fi && i < frame_low;
363 i++, fi = get_prev_frame (fi));
364
365 if (fi == NULL)
366 error (_("-stack-list-arguments: Not enough frames in stack."));
367
368 ui_out_emit_list list_emitter (uiout, "stack-args");
369
370 if (! raw_arg && frame_filters)
371 {
372 frame_filter_flags flags = PRINT_LEVEL | PRINT_ARGS;
373 int py_frame_low = frame_low;
374
375 /* We cannot pass -1 to frame_low, as that would signify a
376 relative backtrace from the tail of the stack. So, in the case
377 of frame_low == -1, assign and increment it. */
378 if (py_frame_low == -1)
379 py_frame_low++;
380
383 py_frame_low, frame_high);
384 }
385
386 /* Run the inbuilt backtrace if there are no filters registered, or
387 if "--no-frame-filters" has been specified from the command. */
388 if (! frame_filters || raw_arg || result == EXT_LANG_BT_NO_FILTERS)
389 {
390 /* Now let's print the frames up to frame_high, or until there are
391 frames in the stack. */
392 for (;
393 fi && (i <= frame_high || frame_high == -1);
394 i++, fi = get_prev_frame (fi))
395 {
396 QUIT;
397 ui_out_emit_tuple tuple_emitter (uiout, "frame");
398 uiout->field_signed ("level", i);
400 arguments, print_values, fi, skip_unavailable);
401 }
402 }
403}
404
405/* Print a list of the local variables (including arguments) for the
406 current frame. ARGC must be 1 and ARGV[0] specify if only the names,
407 or both names and values of the variables must be printed. See
408 parse_print_value for possible values. */
409
410void
411mi_cmd_stack_list_variables (const char *command, char **argv, int argc)
412{
413 frame_info_ptr frame;
414 int raw_arg = 0;
417 int oind = 0;
418 int skip_unavailable = 0;
419
420 if (argc > 1)
421 {
422 enum opt
423 {
424 NO_FRAME_FILTERS,
425 SKIP_UNAVAILABLE,
426 };
427 static const struct mi_opt opts[] =
428 {
429 {"-no-frame-filters", NO_FRAME_FILTERS, 0},
430 {"-skip-unavailable", SKIP_UNAVAILABLE, 0},
431 { 0, 0, 0 }
432 };
433
434 while (1)
435 {
436 char *oarg;
437 /* Don't parse 'print-values' as an option. */
438 int opt = mi_getopt ("-stack-list-variables", argc - 1,
439 argv, opts, &oind, &oarg);
440 if (opt < 0)
441 break;
442 switch ((enum opt) opt)
443 {
444 case NO_FRAME_FILTERS:
445 raw_arg = oind;
446 break;
447 case SKIP_UNAVAILABLE:
448 skip_unavailable = 1;
449 break;
450 }
451 }
452 }
453
454 /* After the last option is parsed, there should be only
455 'print-values'. */
456 if (argc - oind != 1)
457 error (_("-stack-list-variables: Usage: [--no-frame-filters] " \
458 "[--skip-unavailable] PRINT_VALUES"));
459
460 frame = get_selected_frame (NULL);
461 print_value = mi_parse_print_values (argv[oind]);
462
463 if (! raw_arg && frame_filters)
464 {
465 frame_filter_flags flags = PRINT_LEVEL | PRINT_ARGS | PRINT_LOCALS;
466
467 result = mi_apply_ext_lang_frame_filter (frame, flags,
469 current_uiout, 0, 0);
470 }
471
472 /* Run the inbuilt backtrace if there are no filters registered, or
473 if "--no-frame-filters" has been specified from the command. */
474 if (! frame_filters || raw_arg || result == EXT_LANG_BT_NO_FILTERS)
475 {
477 all, print_value, frame,
478 skip_unavailable);
479 }
480}
481
482/* Print single local or argument. ARG must be already read in. For
483 WHAT and VALUES see list_args_or_locals.
484
485 Errors are printed as if they would be the parameter value. Use
486 zeroed ARG iff it should not be printed according to VALUES. If
487 SKIP_UNAVAILABLE is true, only print ARG if it is available. */
488
489static void
490list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
491 enum print_values values, int skip_unavailable)
492{
493 struct ui_out *uiout = current_uiout;
494
495 gdb_assert (!arg->val || !arg->error);
496 gdb_assert ((values == PRINT_NO_VALUES && arg->val == NULL
497 && arg->error == NULL)
498 || values == PRINT_SIMPLE_VALUES
499 || (values == PRINT_ALL_VALUES
500 && (arg->val != NULL || arg->error != NULL)));
501 gdb_assert (arg->entry_kind == print_entry_values_no
503 && (arg->val || arg->error)));
504
505 if (skip_unavailable && arg->val != NULL
507 /* A scalar object that does not have all bits available is
508 also considered unavailable, because all bits contribute
509 to its representation. */
511 && !value_bytes_available (arg->val,
513 value_type (arg->val)->length ()))))
514 return;
515
516 gdb::optional<ui_out_emit_tuple> tuple_emitter;
517 if (values != PRINT_NO_VALUES || what == all)
518 tuple_emitter.emplace (uiout, nullptr);
519
520 string_file stb;
521
522 stb.puts (arg->sym->print_name ());
524 stb.puts ("@entry");
525 uiout->field_stream ("name", stb);
526
527 if (what == all && arg->sym->is_argument ())
528 uiout->field_signed ("arg", 1);
529
530 if (values == PRINT_SIMPLE_VALUES)
531 {
532 check_typedef (arg->sym->type ());
533 type_print (arg->sym->type (), "", &stb, -1);
534 uiout->field_stream ("type", stb);
535 }
536
537 if (arg->val || arg->error)
538 {
539 if (arg->error)
540 stb.printf (_("<error reading variable: %s>"), arg->error.get ());
541 else
542 {
543 try
544 {
545 struct value_print_options opts;
546
548 opts.deref_ref = 1;
549 common_val_print (arg->val, &stb, 0, &opts,
550 language_def (arg->sym->language ()));
551 }
552 catch (const gdb_exception_error &except)
553 {
554 stb.printf (_("<error reading variable: %s>"),
555 except.what ());
556 }
557 }
558 uiout->field_stream ("value", stb);
559 }
560}
561
562/* Print a list of the objects for the frame FI in a certain form,
563 which is determined by VALUES. The objects can be locals,
564 arguments or both, which is determined by WHAT. If SKIP_UNAVAILABLE
565 is true, only print the arguments or local variables whose values
566 are available. */
567
568static void
570 enum what_to_list what, enum print_values values,
571 frame_info_ptr fi, int skip_unavailable)
572{
573 const struct block *block;
574 struct symbol *sym;
575 struct block_iterator iter;
576 struct type *type;
577 const char *name_of_result;
578 struct ui_out *uiout = current_uiout;
579
580 block = get_frame_block (fi, 0);
581
582 switch (what)
583 {
584 case locals:
585 name_of_result = "locals";
586 break;
587 case arguments:
588 name_of_result = "args";
589 break;
590 case all:
591 name_of_result = "variables";
592 break;
593 default:
594 internal_error ("unexpected what_to_list: %d", (int) what);
595 }
596
597 ui_out_emit_list list_emitter (uiout, name_of_result);
598
599 while (block != 0)
600 {
601 ALL_BLOCK_SYMBOLS (block, iter, sym)
602 {
603 int print_me = 0;
604
605 switch (sym->aclass ())
606 {
607 default:
608 case LOC_UNDEF: /* catches errors */
609 case LOC_CONST: /* constant */
610 case LOC_TYPEDEF: /* local typedef */
611 case LOC_LABEL: /* local label */
612 case LOC_BLOCK: /* local function */
613 case LOC_CONST_BYTES: /* loc. byte seq. */
614 case LOC_UNRESOLVED: /* unresolved static */
615 case LOC_OPTIMIZED_OUT: /* optimized out */
616 print_me = 0;
617 break;
618
619 case LOC_ARG: /* argument */
620 case LOC_REF_ARG: /* reference arg */
621 case LOC_REGPARM_ADDR: /* indirect register arg */
622 case LOC_LOCAL: /* stack local */
623 case LOC_STATIC: /* static */
624 case LOC_REGISTER: /* register */
625 case LOC_COMPUTED: /* computed location */
626 if (what == all)
627 print_me = 1;
628 else if (what == locals)
629 print_me = !sym->is_argument ();
630 else
631 print_me = sym->is_argument ();
632 break;
633 }
634 if (print_me)
635 {
636 struct symbol *sym2;
637 struct frame_arg arg, entryarg;
638
639 if (sym->is_argument ())
642 else
643 sym2 = sym;
644 gdb_assert (sym2 != NULL);
645
646 arg.sym = sym2;
648 entryarg.sym = sym2;
650
651 switch (values)
652 {
654 type = check_typedef (sym2->type ());
655 if (type->code () != TYPE_CODE_ARRAY
656 && type->code () != TYPE_CODE_STRUCT
657 && type->code () != TYPE_CODE_UNION)
658 {
659 case PRINT_ALL_VALUES:
660 if (sym->is_argument ())
661 read_frame_arg (fp_opts, sym2, fi, &arg, &entryarg);
662 else
663 read_frame_local (sym2, fi, &arg);
664 }
665 break;
666 }
667
669 list_arg_or_local (&arg, what, values, skip_unavailable);
670 if (entryarg.entry_kind != print_entry_values_no)
671 list_arg_or_local (&entryarg, what, values, skip_unavailable);
672 }
673 }
674
675 if (block->function ())
676 break;
677 else
678 block = block->superblock ();
679 }
680}
681
682/* Read a frame specification from FRAME_EXP and return the selected frame.
683 Call error() if the specification is in any way invalid (so this
684 function never returns NULL).
685
686 The frame specification is usually an integer level number, however if
687 the number does not match a valid frame level then it will be treated as
688 a frame address. The frame address will then be used to find a matching
689 frame in the stack. If no matching frame is found then a new frame will
690 be created.
691
692 The use of FRAME_EXP as an address is undocumented in the GDB user
693 manual, this feature is supported here purely for backward
694 compatibility. */
695
696static frame_info_ptr
697parse_frame_specification (const char *frame_exp)
698{
699 gdb_assert (frame_exp != NULL);
700
701 /* NOTE: Parse and evaluate expression, but do not use
702 functions such as parse_and_eval_long or
703 parse_and_eval_address to also extract the value.
704 Instead value_as_long and value_as_address are used.
705 This avoids problems with expressions that contain
706 side-effects. */
707 struct value *arg = parse_and_eval (frame_exp);
708
709 /* Assume ARG is an integer, and try using that to select a frame. */
710 frame_info_ptr fid;
711 int level = value_as_long (arg);
712
713 fid = find_relative_frame (get_current_frame (), &level);
714 if (level == 0)
715 /* find_relative_frame was successful. */
716 return fid;
717
718 /* Convert the value into a corresponding address. */
719 CORE_ADDR addr = value_as_address (arg);
720
721 /* Assume that ADDR is an address, use that to identify a frame with a
722 matching ID. */
723 struct frame_id id = frame_id_build_wild (addr);
724
725 /* If (s)he specifies the frame with an address, he deserves
726 what (s)he gets. Still, give the highest one that matches.
727 (NOTE: cagney/2004-10-29: Why highest, or outer-most, I don't
728 know). */
729 for (fid = get_current_frame ();
730 fid != NULL;
731 fid = get_prev_frame (fid))
732 {
733 if (id == get_frame_id (fid))
734 {
735 frame_info_ptr prev_frame;
736
737 while (1)
738 {
739 prev_frame = get_prev_frame (fid);
740 if (!prev_frame
741 || id != get_frame_id (prev_frame))
742 break;
743 fid = prev_frame;
744 }
745 return fid;
746 }
747 }
748
749 /* We couldn't identify the frame as an existing frame, but
750 perhaps we can create one with a single argument. */
751 return create_new_frame (addr, 0);
752}
753
754/* Implement the -stack-select-frame MI command. */
755
756void
757mi_cmd_stack_select_frame (const char *command, char **argv, int argc)
758{
759 if (argc == 0 || argc > 1)
760 error (_("-stack-select-frame: Usage: FRAME_SPEC"));
762}
763
764void
765mi_cmd_stack_info_frame (const char *command, char **argv, int argc)
766{
767 if (argc > 0)
768 error (_("-stack-info-frame: No arguments allowed"));
769
771 get_selected_frame (NULL), 1, LOC_AND_ADDRESS, 0, 1);
772}
#define ALL_BLOCK_SYMBOLS(block, iter, sym)
Definition: block.h:534
const struct block * get_frame_block(frame_info_ptr frame, CORE_ADDR *addr_in_block)
Definition: blockframe.c:55
virtual void puts(const char *str)
Definition: ui-file.h:74
void printf(const char *,...) ATTRIBUTE_PRINTF(2
Definition: ui-file.c:40
Definition: ui-out.h:160
void field_signed(const char *fldname, LONGEST value)
Definition: ui-out.c:437
void field_stream(const char *fldname, string_file &stream, const ui_file_style &style=ui_file_style())
Definition: ui-out.c:486
#define QUIT
Definition: defs.h:186
struct value * parse_and_eval(const char *exp)
Definition: eval.c:70
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)
Definition: extension.c:528
@ PRINT_ARGS
Definition: extension.h:96
@ PRINT_LOCALS
Definition: extension.h:99
@ PRINT_FRAME_INFO
Definition: extension.h:93
@ PRINT_LEVEL
Definition: extension.h:90
ext_lang_bt_status
Definition: extension.h:71
@ EXT_LANG_BT_ERROR
Definition: extension.h:74
@ EXT_LANG_BT_NO_FILTERS
Definition: extension.h:82
ext_lang_frame_args
Definition: extension.h:114
@ NO_VALUES
Definition: extension.h:116
void select_frame(frame_info_ptr fi)
Definition: frame.c:1852
struct frame_id frame_id_build_wild(CORE_ADDR stack_addr)
Definition: frame.c:725
frame_info_ptr get_selected_frame(const char *message)
Definition: frame.c:1813
frame_info_ptr get_current_frame(void)
Definition: frame.c:1615
frame_info_ptr create_new_frame(CORE_ADDR addr, CORE_ADDR pc)
Definition: frame.c:1929
struct frame_id get_frame_id(frame_info_ptr fi)
Definition: frame.c:607
frame_info_ptr get_prev_frame(frame_info_ptr this_frame)
Definition: frame.c:2494
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)
Definition: stack.c:1040
@ LOC_AND_ADDRESS
Definition: frame.h:597
void read_frame_arg(const frame_print_options &fp_opts, symbol *sym, frame_info_ptr frame, struct frame_arg *argp, struct frame_arg *entryargp)
Definition: stack.c:529
const char print_entry_values_only[]
Definition: stack.c:108
const char print_entry_values_no[]
Definition: stack.c:107
frame_info_ptr find_relative_frame(frame_info_ptr, int *)
Definition: stack.c:2620
frame_print_options user_frame_print_options
Definition: stack.c:127
void read_frame_local(struct symbol *sym, frame_info_ptr frame, struct frame_arg *argp)
Definition: stack.c:508
struct type * check_typedef(struct type *type)
Definition: gdbtypes.c:3010
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
Definition: gnu-nat.c:1862
const struct language_defn * language_def(enum language lang)
Definition: language.c:442
static frame_info_ptr parse_frame_specification(const char *frame_exp)
Definition: mi-cmd-stack.c:697
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)
Definition: mi-cmd-stack.c:64
what_to_list
Definition: mi-cmd-stack.c:42
@ locals
Definition: mi-cmd-stack.c:42
@ arguments
Definition: mi-cmd-stack.c:42
@ all
Definition: mi-cmd-stack.c:42
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)
Definition: mi-cmd-stack.c:569
static int frame_filters
Definition: mi-cmd-stack.c:51
static void list_arg_or_local(const struct frame_arg *arg, enum what_to_list what, enum print_values values, int skip_unavailable)
Definition: mi-cmd-stack.c:490
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
print_values
Definition: mi-cmds.h:29
@ PRINT_SIMPLE_VALUES
Definition: mi-cmds.h:32
@ PRINT_ALL_VALUES
Definition: mi-cmds.h:31
@ PRINT_NO_VALUES
Definition: mi-cmds.h:30
mi_cmd_argv_ftype mi_cmd_stack_list_args
int mi_getopt_allow_unknown(const char *prefix, int argc, char **argv, const struct mi_opt *opts, int *oind, char **oarg)
Definition: mi-getopt.c:91
int mi_getopt(const char *prefix, int argc, char **argv, const struct mi_opt *opts, int *oind, char **oarg)
Definition: mi-getopt.c:82
enum print_values mi_parse_print_values(const char *name)
Definition: mi-parse.c:375
void print_value(value *val, const value_print_options &opts)
Definition: printcmd.c:1242
struct symbol * symbol
Definition: symtab.h:1494
Definition: block.h:109
const block * superblock() const
Definition: block.h:135
symbol * function() const
Definition: block.h:127
const char * entry_kind
Definition: frame.h:742
struct value * val
Definition: frame.h:727
gdb::unique_xmalloc_ptr< char > error
Definition: frame.h:731
struct symbol * sym
Definition: frame.h:723
const char * print_name() const
Definition: symtab.h:474
const char * search_name() const
Definition: symtab.c:1077
enum language language() const
Definition: symtab.h:501
address_class aclass() const
Definition: symtab.h:1235
struct type * type() const
Definition: symtab.h:1285
bool is_argument() const
Definition: symtab.h:1260
Definition: gdbtypes.h:922
type_code code() const
Definition: gdbtypes.h:927
ULONGEST length() const
Definition: gdbtypes.h:954
Definition: value.c:181
struct block_symbol lookup_symbol_search_name(const char *search_name, const struct block *block, domain_enum domain)
Definition: symtab.c:1979
@ LOC_STATIC
Definition: symtab.h:950
@ LOC_BLOCK
Definition: symtab.h:999
@ LOC_LABEL
Definition: symtab.h:993
@ LOC_REGISTER
Definition: symtab.h:964
@ LOC_REF_ARG
Definition: symtab.h:972
@ LOC_UNRESOLVED
Definition: symtab.h:1028
@ LOC_LOCAL
Definition: symtab.h:984
@ LOC_CONST
Definition: symtab.h:946
@ LOC_CONST_BYTES
Definition: symtab.h:1004
@ LOC_UNDEF
Definition: symtab.h:942
@ LOC_OPTIMIZED_OUT
Definition: symtab.h:1033
@ LOC_TYPEDEF
Definition: symtab.h:989
@ LOC_REGPARM_ADDR
Definition: symtab.h:980
@ LOC_COMPUTED
Definition: symtab.h:1037
@ LOC_ARG
Definition: symtab.h:968
@ VAR_DOMAIN
Definition: symtab.h:881
void type_print(struct type *type, const char *varstring, struct ui_file *stream, int show)
Definition: typeprint.c:391
#define current_uiout
Definition: ui-out.h:40
void get_no_prettyformat_print_options(struct value_print_options *opts)
Definition: valprint.c:136
int val_print_scalar_type_p(struct type *type)
Definition: valprint.c:296
void common_val_print(struct value *value, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
Definition: valprint.c:1014
int value_bytes_available(const struct value *value, LONGEST offset, LONGEST length)
Definition: value.c:391
struct type * value_type(const struct value *value)
Definition: value.c:1109
LONGEST value_embedded_offset(const struct value *value)
Definition: value.c:1555
CORE_ADDR value_as_address(struct value *val)
Definition: value.c:2804
LONGEST value_as_long(struct value *val)
Definition: value.c:2791
int value_entirely_unavailable(struct value *value)
Definition: value.c:447