Kill the return value for all MI command functions.
[deliverable/binutils-gdb.git] / gdb / mi / mi-cmd-stack.c
index 690a4e4c00942ef3726aed0aca12a2d425013ea2..baf9b6dbd68af0b902ccd322ac55a96234a15672 100644 (file)
@@ -1,5 +1,5 @@
 /* MI Command Set - stack commands.
 /* 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).
 
    Free Software Foundation, Inc.
    Contributed by Cygnus Solutions (a Red Hat company).
 
@@ -7,7 +7,7 @@
 
    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
 
    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,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,9 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    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 "defs.h"
 #include "target.h"
@@ -31,6 +29,7 @@
 #include "stack.h"
 #include "dictionary.h"
 #include "gdb_string.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);
 
 
 static void list_args_or_locals (int locals, int values, struct frame_info *fi);
 
@@ -39,7 +38,7 @@ 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. */
    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;
 mi_cmd_stack_list_frames (char *command, char **argv, int argc)
 {
   int frame_low;
@@ -89,11 +88,9 @@ mi_cmd_stack_list_frames (char *command, char **argv, int argc)
     }
 
   do_cleanups (cleanup_stack);
     }
 
   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;
 mi_cmd_stack_info_depth (char *command, char **argv, int argc)
 {
   int frame_high;
@@ -116,14 +113,12 @@ mi_cmd_stack_info_depth (char *command, char **argv, int argc)
     QUIT;
 
   ui_out_field_int (uiout, "depth", i);
     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. */
 }
 
 /* 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;
 mi_cmd_stack_list_locals (char *command, char **argv, int argc)
 {
   struct frame_info *frame;
@@ -148,13 +143,12 @@ mi_cmd_stack_list_locals (char *command, char **argv, int argc)
 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);
 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. */
 }
 
 /* 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;
 mi_cmd_stack_list_args (char *command, char **argv, int argc)
 {
   int frame_low;
@@ -206,8 +200,6 @@ mi_cmd_stack_list_args (char *command, char **argv, int argc)
     }
 
   do_cleanups (cleanup_stack_args);
     }
 
   do_cleanups (cleanup_stack_args);
-
-  return MI_CMD_DONE;
 }
 
 /* Print a list of the locals or the arguments for the currently
 }
 
 /* Print a list of the locals or the arguments for the currently
@@ -253,21 +245,12 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
 
            case LOC_ARG:       /* argument              */
            case LOC_REF_ARG:   /* reference arg         */
 
            case LOC_ARG:       /* argument              */
            case LOC_REF_ARG:   /* reference arg         */
-           case LOC_REGPARM:   /* register arg          */
            case LOC_REGPARM_ADDR:      /* indirect 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_LOCAL:     /* stack local           */
-           case LOC_BASEREG:   /* basereg local         */
            case LOC_STATIC:    /* static                */
            case LOC_REGISTER:  /* register              */
            case LOC_COMPUTED:  /* computed location     */
            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;
            }
                print_me = 1;
              break;
            }
@@ -284,10 +267,9 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
              if (!locals)
                sym2 = lookup_symbol (SYMBOL_NATURAL_NAME (sym),
                                      block, VAR_DOMAIN,
              if (!locals)
                sym2 = lookup_symbol (SYMBOL_NATURAL_NAME (sym),
                                      block, VAR_DOMAIN,
-                                     (int *) NULL,
-                                     (struct symtab **) NULL);
+                                     (int *) NULL);
              else
              else
-                   sym2 = sym;
+               sym2 = sym;
              switch (values)
                {
                case PRINT_SIMPLE_VALUES:
              switch (values)
                {
                case PRINT_SIMPLE_VALUES:
@@ -300,7 +282,8 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
                    {
                      val = read_var_value (sym2, fi);
                      common_val_print
                    {
                      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);
                      ui_out_field_stream (uiout, "value", stb);
                    }
                  do_cleanups (cleanup_tuple);
@@ -308,7 +291,8 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
                case PRINT_ALL_VALUES:
                  val = read_var_value (sym2, fi);
                  common_val_print
                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_field_stream (uiout, "value", stb);
                  do_cleanups (cleanup_tuple);
                  break;
@@ -324,22 +308,20 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
   ui_out_stream_delete (stb);
 }
 
   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 */ );
 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"));
 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);
   print_frame_info (get_selected_frame (NULL), 1, LOC_AND_ADDRESS, 0);
-  return MI_CMD_DONE;
 }
 }
This page took 0.030901 seconds and 4 git commands to generate.