Add support to GDB for the Renesas rl78 architecture.
[external/binutils.git] / gdb / mi / mi-cmd-stack.c
index 2e32eff..4ad9f7c 100644 (file)
@@ -1,6 +1,6 @@
 /* MI Command Set - stack commands.
-   Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002-2005, 2007-2012 Free Software Foundation,
+   Inc.
    Contributed by Cygnus Solutions (a Red Hat company).
 
    This file is part of GDB.
@@ -256,11 +256,17 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
              || values == PRINT_SIMPLE_VALUES
              || (values == PRINT_ALL_VALUES
                  && (arg->val != NULL || arg->error != NULL)));
+  gdb_assert (arg->entry_kind == print_entry_values_no
+             || (arg->entry_kind == print_entry_values_only
+                 && (arg->val || arg->error)));
 
   if (values != PRINT_NO_VALUES || what == all)
     cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
 
-  ui_out_field_string (uiout, "name", SYMBOL_PRINT_NAME (arg->sym));
+  fputs_filtered (SYMBOL_PRINT_NAME (arg->sym), stb->stream);
+  if (arg->entry_kind == print_entry_values_only)
+    fputs_filtered ("@entry", stb->stream);
+  ui_out_field_stream (uiout, "name", stb);
 
   if (what == all && SYMBOL_IS_ARGUMENT (arg->sym))
     ui_out_field_int (uiout, "arg", 1);
@@ -380,17 +386,22 @@ list_args_or_locals (enum what_to_list what, enum print_values values,
          if (print_me)
            {
              struct symbol *sym2;
-             struct frame_arg arg;
+             struct frame_arg arg, entryarg;
 
              if (SYMBOL_IS_ARGUMENT (sym))
-               sym2 = lookup_symbol (SYMBOL_NATURAL_NAME (sym),
+               sym2 = lookup_symbol (SYMBOL_LINKAGE_NAME (sym),
                                      block, VAR_DOMAIN,
                                      (int *) NULL);
              else
                sym2 = sym;
+             gdb_assert (sym2 != NULL);
 
              memset (&arg, 0, sizeof (arg));
              arg.sym = sym2;
+             arg.entry_kind = print_entry_values_no;
+             memset (&entryarg, 0, sizeof (entryarg));
+             entryarg.sym = sym2;
+             entryarg.entry_kind = print_entry_values_no;
 
              switch (values)
                {
@@ -401,13 +412,17 @@ list_args_or_locals (enum what_to_list what, enum print_values values,
                      && TYPE_CODE (type) != TYPE_CODE_UNION)
                    {
                case PRINT_ALL_VALUES:
-                     read_frame_arg (sym2, fi, &arg);
+                     read_frame_arg (sym2, fi, &arg, &entryarg);
                    }
                  break;
                }
 
-             list_arg_or_local (&arg, what, values);
+             if (arg.entry_kind != print_entry_values_only)
+               list_arg_or_local (&arg, what, values);
+             if (entryarg.entry_kind != print_entry_values_no)
+               list_arg_or_local (&entryarg, what, values);
              xfree (arg.error);
+             xfree (entryarg.error);
            }
        }
       if (BLOCK_FUNCTION (block))