* Rename remote-es1800.c to remote-es.c
[deliverable/binutils-gdb.git] / gdb / stack.c
index e9757d05a55d802c87f0266c528b0979af75a4fb..4849e5d047a5969904013ef839fc7afd2f07cb00 100644 (file)
@@ -29,6 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "target.h"
 #include "breakpoint.h"
 #include "demangle.h"
+#include "inferior.h"
 
 static void
 return_command PARAMS ((char *, int));
@@ -142,9 +143,24 @@ print_frame_info (fi, level, source, args)
   enum language funlang = language_unknown;
   int numargs;
 
-#ifdef CORE_NEEDS_RELOCATION
-  CORE_NEEDS_RELOCATION(fi->pc);
-#endif
+  if (PC_IN_CALL_DUMMY (fi->pc, read_register (SP_REGNUM), fi->frame))
+    {
+      /* Do this regardless of SOURCE because we don't have any source
+        to list for this frame.  */
+      if (level >= 0)
+       printf_filtered ("#%-2d ", level);
+      printf_filtered ("<function called from gdb>\n");
+      return;
+    }
+  if (fi->signal_handler_caller)
+    {
+      /* Do this regardless of SOURCE because we don't have any source
+        to list for this frame.  */
+      if (level >= 0)
+       printf_filtered ("#%-2d ", level);
+      printf_filtered ("<signal handler called>\n");
+      return;
+    }
 
   sal = find_pc_line (fi->pc, fi->next_frame);
   func = find_pc_function (fi->pc);
@@ -201,7 +217,8 @@ print_frame_info (fi, level, source, args)
       if (addressprint)
        if (fi->pc != sal.pc || !sal.symtab)
          printf_filtered ("%s in ", local_hex_string(fi->pc));
-      fputs_demangled (funname ? funname : "??", stdout, 0, funlang);
+      fprintf_symbol_filtered (stdout, funname ? funname : "??", funlang,
+                              DMGL_NO_OPTS);
       wrap_here ("   ");
       fputs_filtered (" (", stdout);
       if (args)
@@ -371,7 +388,7 @@ frame_info (addr_exp, from_tty)
   enum language funlang = language_unknown;
 
   if (!target_has_stack)
-    error ("No inferior or core file.");
+    error ("No stack.");
 
   frame = parse_frame_specification (addr_exp);
   if (!frame)
@@ -413,7 +430,8 @@ frame_info (addr_exp, from_tty)
   if (funname)
     {
       printf_filtered (" in ");
-      fputs_demangled (funname, stdout, DMGL_ANSI | DMGL_PARAMS, funlang);
+      fprintf_symbol_filtered (stdout, funname, funlang,
+                              DMGL_ANSI | DMGL_PARAMS);
     }
   wrap_here ("   ");
   if (sal.symtab)
@@ -864,15 +882,24 @@ print_frame_arg_vars (frame, stream)
       if (SYMBOL_CLASS (sym) == LOC_ARG
          || SYMBOL_CLASS (sym) == LOC_LOCAL_ARG
          || SYMBOL_CLASS (sym) == LOC_REF_ARG
-         || SYMBOL_CLASS (sym) == LOC_REGPARM)
+         || SYMBOL_CLASS (sym) == LOC_REGPARM
+         || SYMBOL_CLASS (sym) == LOC_REGPARM_ADDR)
        {
          values_printed = 1;
          fputs_filtered (SYMBOL_SOURCE_NAME (sym), stream);
          fputs_filtered (" = ", stream);
-         /* We have to look up the symbol because arguments often have
-            two entries (one a parameter, one a register) and the one
-            we want is the register, which lookup_symbol will find for
-            us.  */
+
+         /* We have to look up the symbol because arguments can have
+            two entries (one a parameter, one a local) and the one we
+            want is the local, which lookup_symbol will find for us.
+            This includes gcc1 (not gcc2) on the sparc when passing a
+            small structure and gcc2 when the argument type is float
+            and it is passed as a double and converted to float by
+            the prologue (in the latter case the type of the LOC_ARG
+            symbol is double and the type of the LOC_LOCAL symbol is
+            float).  There are also LOC_ARG/LOC_REGISTER pairs which
+            are not combined in symbol-reading.  */
+
          sym2 = lookup_symbol (SYMBOL_NAME (sym),
                        b, VAR_NAMESPACE, (int *)NULL, (struct symtab **)NULL);
          print_variable_value (sym2, frame, stream);
This page took 0.02473 seconds and 4 git commands to generate.