This file is part of GDB.
-GDB is free software; you can redistribute it and/or modify
+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 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
-GDB is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#if defined (GDB_TARGET_IS_SUN386)
-#include <stdio.h>
#include "defs.h"
-#include "param.h"
#include "frame.h"
#include "inferior.h"
-#include "signame.h"
#include "gdbcore.h"
#include <sys/param.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/core.h>
+
\f
void
-fetch_inferior_registers ()
+fetch_inferior_registers (regno)
+ int regno;
{
struct regs inferior_registers;
struct fp_state inferior_fp_registers;
registers_fetched ();
- ptrace (PTRACE_GETREGS, inferior_pid, &inferior_registers);
- ptrace (PTRACE_GETFPREGS, inferior_pid, &inferior_fp_registers);
+ ptrace (PTRACE_GETREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) &inferior_registers);
+ ptrace (PTRACE_GETFPREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) &inferior_fp_registers);
bcopy (&inferior_registers, registers, sizeof inferior_registers);
If REGNO is -1, do this for all registers.
Otherwise, REGNO specifies which register (so we can save time). */
+void
store_inferior_registers (regno)
int regno;
{
instruction that moves eax into ebp gets single-stepped. */
{
int stack = inferior_registers.r_reg[SP_REGNUM];
- int stuff = ptrace (PTRACE_PEEKDATA, inferior_pid, stack);
+ int stuff = ptrace (PTRACE_PEEKDATA, inferior_pid,
+ (PTRACE_ARG3_TYPE) stack);
int reg = inferior_registers.r_reg[EAX];
inferior_registers.r_reg[EAX] =
inferior_registers.r_reg[FP_REGNUM];
- ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers);
- ptrace (PTRACE_POKEDATA, inferior_pid, stack, 0xc589);
- ptrace (PTRACE_SINGLESTEP, inferior_pid, stack, 0);
+ ptrace (PTRACE_SETREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) &inferior_registers);
+ ptrace (PTRACE_POKEDATA, inferior_pid, (PTRACE_ARG3_TYPE) stack,
+ 0xc589);
+ ptrace (PTRACE_SINGLESTEP, inferior_pid, (PTRACE_ARG3_TYPE) stack,
+ 0);
wait (0);
- ptrace (PTRACE_POKEDATA, inferior_pid, stack, stuff);
+ ptrace (PTRACE_POKEDATA, inferior_pid, (PTRACE_ARG3_TYPE) stack,
+ stuff);
inferior_registers.r_reg[EAX] = reg;
}
#endif
- ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers);
- ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers);
+ ptrace (PTRACE_SETREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) &inferior_registers);
+ ptrace (PTRACE_SETFPREGS, inferior_pid,
+ (PTRACE_ARG3_TYPE) &inferior_fp_registers);
}
/* Machine-dependent code which would otherwise be in core.c */
printf ("Core file is from \"%s\".\n", corestr.c_cmdname);
if (corestr.c_signo > 0)
printf ("Program terminated with signal %d, %s.\n",
- corestr.c_signo,
- corestr.c_signo < NSIG
- ? sys_siglist[corestr.c_signo]
- : "(undocumented)");
+ corestr.c_signo, safe_strsignal (corestr.c_signo));
}
if (filename[0] == '/')
corefile = savestring (filename, strlen (filename));
else
{
- corefile = concat (current_directory, "/", filename);
+ corefile = concat (current_directory, "/", filename, NULL);
}
set_current_frame ( create_new_frame (read_register (FP_REGNUM),
asm ("fstpt (%eax)");
asm ("fwait");
}
+#else /* Not sun386 target. */
+
+/* These functions shouldn't be called when we're cross-debugging. */
+
+/* ARGSUSED */
+void
+fetch_inferior_registers (regno)
+ int regno;
+{
+}
+
+/* ARGSUSED */
+void
+store_inferior_registers (regno)
+ int regno;
+{
+}
+
+/* ARGSUSED */
+void
+fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
+ char *core_reg_sect;
+ unsigned core_reg_size;
+ int which;
+ unsigned int reg_addr; /* Unused in this version */
+{
+}
+
+#endif /* Not sun386 target. */