* Rename remote-es1800.c to remote-es.c
[deliverable/binutils-gdb.git] / gdb / infcmd.c
index 89859fe0527fbe78b8b2eed6582bc6a936fa7076..666be8eecb369284bb63bbabdda19d546c30be97 100644 (file)
@@ -365,20 +365,36 @@ step_1 (skip_subroutines, single_inst, count_string)
            {
              struct minimal_symbol *msymbol;
 
+             /* FIXME: This should be using containing_function_bounds or a
+                cleaned-up version thereof, to deal with things like the
+                end of the text segment.  */
+
              msymbol = lookup_minimal_symbol_by_pc (stop_pc);
              target_terminal_ours ();
              printf_filtered ("Current function has no line number information.\n");
              fflush (stdout);
 
-             /* No info or after _etext ("Can't happen") */
-             if (msymbol == NULL || (msymbol + 1) -> name == NULL)
-               error ("No data available on pc function.");
+             if (msymbol == NULL || SYMBOL_NAME (msymbol + 1) == NULL)
+               {
+                 /* If sigtramp is in the u area, check for it.  */
+#if defined SIGTRAMP_START
+                 if (IN_SIGTRAMP (stop_pc, (char *)NULL))
+                   {
+                     step_range_start = SIGTRAMP_START;
+                     step_range_end = SIGTRAMP_END;
+                   }
+                 else
+#endif
+                   error ("Cannot find bounds of current function.");
+               }
+             else
+               {
+                 step_range_start = SYMBOL_VALUE_ADDRESS (msymbol);
+                 step_range_end = SYMBOL_VALUE_ADDRESS (msymbol + 1);
+               }
 
              printf_filtered ("Single stepping until function exit.\n");
              fflush (stdout);
-
-             step_range_start = msymbol -> address;
-             step_range_end = (msymbol + 1) -> address;
            }
        }
       else
@@ -420,8 +436,6 @@ jump_command (arg, from_tty)
   struct symtab_and_line sal;
   struct symbol *fn;
   struct symbol *sfn;
-  char *fname;
-  struct cleanup *back_to;
 
   ERROR_NO_INFERIOR;
 
@@ -447,14 +461,12 @@ jump_command (arg, from_tty)
   sfn = find_pc_function (sal.pc);
   if (fn != NULL && sfn != fn)
     {
-      fname = strdup_demangled (SYMBOL_NAME (fn));
-      back_to = make_cleanup (free, fname);
-      if (!query ("Line %d is not in `%s'.  Jump anyway? ", sal.line, fname))
+      if (!query ("Line %d is not in `%s'.  Jump anyway? ", sal.line,
+                 SYMBOL_SOURCE_NAME (fn)))
        {
          error ("Not confirmed.");
          /* NOTREACHED */
        }
-      do_cleanups (back_to);
     }
 
   addr = ADDR_BITS_SET (sal.pc);
@@ -572,7 +584,7 @@ until_next_command (from_tty)
       if (msymbol == NULL)
        error ("Execution is not within a known function.");
       
-      step_range_start = msymbol -> address;
+      step_range_start = SYMBOL_VALUE_ADDRESS (msymbol);
       step_range_end = pc;
     }
   else
@@ -847,7 +859,7 @@ unset_environment_command (var, from_tty)
 
 /* Handle the execution path (PATH variable) */
 
-const static char path_var_name[] = "PATH";
+static const char path_var_name[] = "PATH";
 
 /* ARGSUSED */
 static void
@@ -878,10 +890,25 @@ path_command (dirname, from_tty)
     path_info ((char *)NULL, from_tty);
 }
 \f
+/* XXX - This routine is getting awfully cluttered with #if's.  It's probably
+   time to turn this into target_read_pc.  Ditto for write_pc.  */
+
 CORE_ADDR
 read_pc ()
 {
+#ifdef GDB_TARGET_IS_HPPA
+  int flags = read_register(FLAGS_REGNUM);
+
+  if (flags & 2)
+    return read_register(31) & ~0x3; /* User PC is here when in sys call */
+  return read_register (PC_REGNUM) & ~0x3;
+#else
+#ifdef GDB_TARGET_IS_H8500
+  return (read_register (SEG_C_REGNUM) << 16) | read_register (PC_REGNUM);
+#else
   return ADDR_BITS_REMOVE ((CORE_ADDR) read_register (PC_REGNUM));
+#endif
+#endif
 }
 
 void
@@ -890,7 +917,13 @@ write_pc (val)
 {
   write_register (PC_REGNUM, (long) val);
 #ifdef NPC_REGNUM
-  write_register (NPC_REGNUM, (long) val+4);
+  write_register (NPC_REGNUM, (long) val + 4);
+#ifdef NNPC_REGNUM
+  write_register (NNPC_REGNUM, (long) val + 8);
+#endif
+#endif
+#ifdef GDB_TARGET_IS_H8500
+  write_register (SEG_C_REGNUM, val >> 16);
 #endif
   pc_changed = 0;
 }
@@ -1076,7 +1109,7 @@ attach_command (args, from_tty)
       if (query ("A program is being debugged already.  Kill it? "))
        target_kill ();
       else
-       error ("Inferior not killed.");
+       error ("Not killed.");
     }
 
   target_attach (args, from_tty);
This page took 0.024294 seconds and 4 git commands to generate.