/* MI Command Set - stack commands.
- Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007
+ Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "target.h"
#include "stack.h"
#include "dictionary.h"
#include "gdb_string.h"
+#include "language.h"
static void list_args_or_locals (int locals, int values, struct frame_info *fi);
specifying the frame numbers at which to start and stop the
display. If the two numbers are equal, a single frame will be
displayed. */
-enum mi_cmd_result
+void
mi_cmd_stack_list_frames (char *command, char **argv, int argc)
{
int frame_low;
}
do_cleanups (cleanup_stack);
-
- return MI_CMD_DONE;
}
-enum mi_cmd_result
+void
mi_cmd_stack_info_depth (char *command, char **argv, int argc)
{
int frame_high;
QUIT;
ui_out_field_int (uiout, "depth", i);
-
- return MI_CMD_DONE;
}
/* Print a list of the locals for the current frame. With argument of
0, print only the names, with argument of 1 print also the
values. */
-enum mi_cmd_result
+void
mi_cmd_stack_list_locals (char *command, char **argv, int argc)
{
struct frame_info *frame;
0 or \"%s\", 1 or \"%s\", 2 or \"%s\""),
mi_no_values, mi_all_values, mi_simple_values);
list_args_or_locals (1, print_values, frame);
- return MI_CMD_DONE;
}
/* Print a list of the arguments for the current frame. With argument
of 0, print only the names, with argument of 1 print also the
values. */
-enum mi_cmd_result
+void
mi_cmd_stack_list_args (char *command, char **argv, int argc)
{
int frame_low;
}
do_cleanups (cleanup_stack_args);
-
- return MI_CMD_DONE;
}
/* Print a list of the locals or the arguments for the currently
case LOC_ARG: /* argument */
case LOC_REF_ARG: /* reference arg */
- case LOC_REGPARM: /* register arg */
case LOC_REGPARM_ADDR: /* indirect register arg */
- case LOC_LOCAL_ARG: /* stack arg */
- case LOC_BASEREG_ARG: /* basereg arg */
- case LOC_COMPUTED_ARG: /* arg with computed location */
- if (!locals)
- print_me = 1;
- break;
-
case LOC_LOCAL: /* stack local */
- case LOC_BASEREG: /* basereg local */
case LOC_STATIC: /* static */
case LOC_REGISTER: /* register */
case LOC_COMPUTED: /* computed location */
- if (locals)
+ if (SYMBOL_IS_ARGUMENT (sym) ? !locals : locals)
print_me = 1;
break;
}
if (!locals)
sym2 = lookup_symbol (SYMBOL_NATURAL_NAME (sym),
block, VAR_DOMAIN,
- (int *) NULL,
- (struct symtab **) NULL);
+ (int *) NULL);
else
- sym2 = sym;
+ sym2 = sym;
switch (values)
{
case PRINT_SIMPLE_VALUES:
{
val = read_var_value (sym2, fi);
common_val_print
- (val, stb->stream, 0, 1, 0, Val_no_prettyprint);
+ (val, stb->stream, 0, 1, 0, Val_no_prettyprint,
+ language_def (SYMBOL_LANGUAGE (sym2)));
ui_out_field_stream (uiout, "value", stb);
}
do_cleanups (cleanup_tuple);
case PRINT_ALL_VALUES:
val = read_var_value (sym2, fi);
common_val_print
- (val, stb->stream, 0, 1, 0, Val_no_prettyprint);
+ (val, stb->stream, 0, 1, 0, Val_no_prettyprint,
+ language_def (SYMBOL_LANGUAGE (sym2)));
ui_out_field_stream (uiout, "value", stb);
do_cleanups (cleanup_tuple);
break;
ui_out_stream_delete (stb);
}
-enum mi_cmd_result
+void
mi_cmd_stack_select_frame (char *command, char **argv, int argc)
{
if (argc == 0 || argc > 1)
error (_("mi_cmd_stack_select_frame: Usage: FRAME_SPEC"));
select_frame_command (argv[0], 1 /* not used */ );
- return MI_CMD_DONE;
}
-enum mi_cmd_result
+void
mi_cmd_stack_info_frame (char *command, char **argv, int argc)
{
if (argc > 0)
error (_("mi_cmd_stack_info_frame: No arguments required"));
-
+
print_frame_info (get_selected_frame (NULL), 1, LOC_AND_ADDRESS, 0);
- return MI_CMD_DONE;
}