* defs.h: Incorporate param.h. All users changed.
* param-no-tm.h: Change users to define TM_FILE_OVERRIDE instead.
* param.h, param-no-tm.h: Removed.
* Update copyrights in all changed files.
* dbxread.c, dwarfread.c, inflow.c, infrun.c, m2-exp.y, putenv.c,
solib.c, symtab.h, tm-umax.h, valprint.c: Lint.
* tm-convex.h, tm-hp300hpux.h, tm-merlin.h, tm-sparc.h,
xm-merlin.h: Avoid host include files in target descriptions.
* getpagesize.h: Removed, libiberty copes now.
1991-11-22 02:42:05 +08:00
|
|
|
|
/* Host-dependent code for SPARC host systems, for GDB, the GNU debugger.
|
1992-02-21 09:33:14 +08:00
|
|
|
|
Copyright 1986, 1987, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
|
1991-03-29 00:28:29 +08:00
|
|
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
1991-06-04 16:31:55 +09:00
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
1991-03-29 00:28:29 +08:00
|
|
|
|
it under the terms of the GNU General Public License as published by
|
1991-06-04 16:31:55 +09:00
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
1991-03-29 00:28:29 +08:00
|
|
|
|
|
1991-06-04 16:31:55 +09:00
|
|
|
|
This program is distributed in the hope that it will be useful,
|
1991-03-29 00:28:29 +08:00
|
|
|
|
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
|
1991-06-04 16:31:55 +09:00
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
1991-03-29 00:28:29 +08:00
|
|
|
|
|
1991-12-04 09:26:05 +08:00
|
|
|
|
/* This code only compiles when we have the definitions in tm-sparc.h. */
|
|
|
|
|
|
|
|
|
|
#define TM_FILE_OVERRIDE
|
1991-03-29 00:28:29 +08:00
|
|
|
|
#include "defs.h"
|
1991-12-04 09:26:05 +08:00
|
|
|
|
#include "tm-sparc.h"
|
|
|
|
|
|
1991-03-29 00:28:29 +08:00
|
|
|
|
#include "inferior.h"
|
|
|
|
|
#include "target.h"
|
|
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
|
#include <sys/ptrace.h>
|
|
|
|
|
#include <machine/reg.h>
|
|
|
|
|
|
|
|
|
|
#include "gdbcore.h"
|
|
|
|
|
#include <sys/core.h>
|
|
|
|
|
|
1991-05-19 21:49:37 +09:00
|
|
|
|
/* We don't store all registers immediately when requested, since they
|
|
|
|
|
get sent over in large chunks anyway. Instead, we accumulate most
|
|
|
|
|
of the changes and send them over once. "deferred_stores" keeps
|
|
|
|
|
track of which sets of registers we have locally-changed copies of,
|
|
|
|
|
so we only need send the groups that have changed. */
|
|
|
|
|
|
|
|
|
|
#define INT_REGS 1
|
|
|
|
|
#define STACK_REGS 2
|
|
|
|
|
#define FP_REGS 4
|
|
|
|
|
|
1991-05-19 16:27:02 +09:00
|
|
|
|
int deferred_stores = 0; /* Cumulates stores we want to do eventually. */
|
|
|
|
|
|
1991-03-29 00:28:29 +08:00
|
|
|
|
/* Fetch one or more registers from the inferior. REGNO == -1 to get
|
|
|
|
|
them all. We actually fetch more than requested, when convenient,
|
|
|
|
|
marking them as valid so we won't fetch them again. */
|
|
|
|
|
void
|
|
|
|
|
fetch_inferior_registers (regno)
|
|
|
|
|
int regno;
|
|
|
|
|
{
|
|
|
|
|
struct regs inferior_registers;
|
|
|
|
|
struct fp_status inferior_fp_registers;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
/* We should never be called with deferred stores, because a prerequisite
|
|
|
|
|
for writing regs is to have fetched them all (PREPARE_TO_STORE), sigh. */
|
|
|
|
|
if (deferred_stores) abort();
|
|
|
|
|
|
|
|
|
|
DO_DEFERRED_STORES;
|
|
|
|
|
|
|
|
|
|
/* Global and Out regs are fetched directly, as well as the control
|
|
|
|
|
registers. If we're getting one of the in or local regs,
|
|
|
|
|
and the stack pointer has not yet been fetched,
|
|
|
|
|
we have to do that first, since they're found in memory relative
|
|
|
|
|
to the stack pointer. */
|
|
|
|
|
if (regno < O7_REGNUM /* including -1 */
|
|
|
|
|
|| regno >= Y_REGNUM
|
|
|
|
|
|| (!register_valid[SP_REGNUM] && regno < I7_REGNUM))
|
|
|
|
|
{
|
* Makefile.in (VERSION): Bump to 4.5.6.
* coffread.c (coff_end_symtab): Cast 2nd arg of complain() to
correct type.
* defs.h (NORETURN): Define away for Lucid compiler.
* remote.c (remote_timer, remote_interrupt): Signal handlers
take one int arg.
* ser-termios.c (serial_write, serial_close): Return whatever
value the write/close call returns, rather than falling off end.
* inferior.h (PTRACE_ARG3_TYPE): Third arg to ptrace is int on
more systems than it is "char *". Define PTRACE_ARG3_TYPE to
default to int.
* infptrace.c, hppabsd-xdep.c, hppahpux-xdep.c, i386-xdep.c,
inferior.h (call_ptrace): Use PTRACE_ARG3_TYPE to declare type
of third arg.
* a68v-xdep.c, arm-xdep.c, convex-xdep.c, hp300ux-xdep.c, infrun.c,
m88k-xdep.c, mach386-xdep.c, mips-xdep.c, os68k-xdep.c, pyr-tdep.c,
pyr-xdep.c, rs6000-xdep.c, sparc-xdep.c, sun3-xdep.c, sun386-xdep.c,
symm-xdep.c, ultra3-xdep.c: Use PTRACE_ARG3_TYPE to cast ptrace
argument 3.
* sparc-xdep.c, a68v-xdep.c (fetch_inferior_registers,
store_inferior_registers): Supply missing fourth argument to
ptrace().
1992-06-24 12:49:48 +08:00
|
|
|
|
if (0 != ptrace (PTRACE_GETREGS, inferior_pid,
|
|
|
|
|
(PTRACE_ARG3_TYPE) &inferior_registers, 0))
|
|
|
|
|
perror("ptrace_getregs");
|
1991-03-29 00:28:29 +08:00
|
|
|
|
|
|
|
|
|
registers[REGISTER_BYTE (0)] = 0;
|
* breakpoint.c, buildsym.c, c-exp.y, coffread.c, command.c,
core.c, cplus-dem.c, dbxread.c, dwarfread.c, elfread.c, environ.c,
eval.c, findvar.c, gdbtypes.c, hppabsd-tdep.c, hppahpux-tdep.c,
i386-tdep.c, ieee-float.c, infcmd.c, inflow.c, infptrace.c,
infrun.c, m2-exp.y, mipsread.c, objfiles.c, parse.c, procfs.c,
putenv.c, remote-mm.c, remote-vx.c, solib.c, sparc-tdep.c,
sparc-xdep.c, stack.c, symfile.c, symtab.c, symtab.h, target.c,
tm-i386v.h, tm-sparc.h, utils.c, valarith.c, valops.c, valprint.c,
values.c, xcoffread.c:
Remove "(void)" casts from function calls where the return value
is ignored, in accordance with GNU coding standards.
1992-07-04 11:22:08 +08:00
|
|
|
|
memcpy (®isters[REGISTER_BYTE (1)], &inferior_registers.r_g1,
|
|
|
|
|
15 * REGISTER_RAW_SIZE (G0_REGNUM));
|
1991-03-29 00:28:29 +08:00
|
|
|
|
*(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
|
|
|
|
|
*(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
|
|
|
|
|
*(int *)®isters[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc;
|
|
|
|
|
*(int *)®isters[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
|
|
|
|
|
|
|
|
|
|
for (i = G0_REGNUM; i <= O7_REGNUM; i++)
|
|
|
|
|
register_valid[i] = 1;
|
|
|
|
|
register_valid[Y_REGNUM] = 1;
|
|
|
|
|
register_valid[PS_REGNUM] = 1;
|
|
|
|
|
register_valid[PC_REGNUM] = 1;
|
|
|
|
|
register_valid[NPC_REGNUM] = 1;
|
|
|
|
|
/* If we don't set these valid, read_register_bytes() rereads
|
|
|
|
|
all the regs every time it is called! FIXME. */
|
|
|
|
|
register_valid[WIM_REGNUM] = 1; /* Not true yet, FIXME */
|
|
|
|
|
register_valid[TBR_REGNUM] = 1; /* Not true yet, FIXME */
|
|
|
|
|
register_valid[FPS_REGNUM] = 1; /* Not true yet, FIXME */
|
|
|
|
|
register_valid[CPS_REGNUM] = 1; /* Not true yet, FIXME */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Floating point registers */
|
|
|
|
|
if (regno == -1 || (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31))
|
|
|
|
|
{
|
* Makefile.in (VERSION): Bump to 4.5.6.
* coffread.c (coff_end_symtab): Cast 2nd arg of complain() to
correct type.
* defs.h (NORETURN): Define away for Lucid compiler.
* remote.c (remote_timer, remote_interrupt): Signal handlers
take one int arg.
* ser-termios.c (serial_write, serial_close): Return whatever
value the write/close call returns, rather than falling off end.
* inferior.h (PTRACE_ARG3_TYPE): Third arg to ptrace is int on
more systems than it is "char *". Define PTRACE_ARG3_TYPE to
default to int.
* infptrace.c, hppabsd-xdep.c, hppahpux-xdep.c, i386-xdep.c,
inferior.h (call_ptrace): Use PTRACE_ARG3_TYPE to declare type
of third arg.
* a68v-xdep.c, arm-xdep.c, convex-xdep.c, hp300ux-xdep.c, infrun.c,
m88k-xdep.c, mach386-xdep.c, mips-xdep.c, os68k-xdep.c, pyr-tdep.c,
pyr-xdep.c, rs6000-xdep.c, sparc-xdep.c, sun3-xdep.c, sun386-xdep.c,
symm-xdep.c, ultra3-xdep.c: Use PTRACE_ARG3_TYPE to cast ptrace
argument 3.
* sparc-xdep.c, a68v-xdep.c (fetch_inferior_registers,
store_inferior_registers): Supply missing fourth argument to
ptrace().
1992-06-24 12:49:48 +08:00
|
|
|
|
if (0 != ptrace (PTRACE_GETFPREGS, inferior_pid,
|
|
|
|
|
(PTRACE_ARG3_TYPE) &inferior_fp_registers,
|
|
|
|
|
0))
|
1991-03-29 00:28:29 +08:00
|
|
|
|
perror("ptrace_getfpregs");
|
* breakpoint.c, buildsym.c, c-exp.y, coffread.c, command.c,
core.c, cplus-dem.c, dbxread.c, dwarfread.c, elfread.c, environ.c,
eval.c, findvar.c, gdbtypes.c, hppabsd-tdep.c, hppahpux-tdep.c,
i386-tdep.c, ieee-float.c, infcmd.c, inflow.c, infptrace.c,
infrun.c, m2-exp.y, mipsread.c, objfiles.c, parse.c, procfs.c,
putenv.c, remote-mm.c, remote-vx.c, solib.c, sparc-tdep.c,
sparc-xdep.c, stack.c, symfile.c, symtab.c, symtab.h, target.c,
tm-i386v.h, tm-sparc.h, utils.c, valarith.c, valops.c, valprint.c,
values.c, xcoffread.c:
Remove "(void)" casts from function calls where the return value
is ignored, in accordance with GNU coding standards.
1992-07-04 11:22:08 +08:00
|
|
|
|
memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
|
|
|
|
|
sizeof inferior_fp_registers.fpu_fr);
|
1991-03-29 00:28:29 +08:00
|
|
|
|
/* bcopy (&inferior_fp_registers.Fpu_fsr,
|
|
|
|
|
®isters[REGISTER_BYTE (FPS_REGNUM)],
|
|
|
|
|
sizeof (FPU_FSR_TYPE)); FIXME??? -- gnu@cyg */
|
|
|
|
|
for (i = FP0_REGNUM; i <= FP0_REGNUM+31; i++)
|
|
|
|
|
register_valid[i] = 1;
|
|
|
|
|
register_valid[FPS_REGNUM] = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* These regs are saved on the stack by the kernel. Only read them
|
|
|
|
|
all (16 ptrace calls!) if we really need them. */
|
|
|
|
|
if (regno == -1)
|
|
|
|
|
{
|
|
|
|
|
target_xfer_memory (*(CORE_ADDR*)®isters[REGISTER_BYTE (SP_REGNUM)],
|
|
|
|
|
®isters[REGISTER_BYTE (L0_REGNUM)],
|
|
|
|
|
16*REGISTER_RAW_SIZE (L0_REGNUM), 0);
|
|
|
|
|
for (i = L0_REGNUM; i <= I7_REGNUM; i++)
|
|
|
|
|
register_valid[i] = 1;
|
|
|
|
|
}
|
|
|
|
|
else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
|
|
|
|
|
{
|
|
|
|
|
CORE_ADDR sp = *(CORE_ADDR*)®isters[REGISTER_BYTE (SP_REGNUM)];
|
|
|
|
|
i = REGISTER_BYTE (regno);
|
|
|
|
|
if (register_valid[regno])
|
|
|
|
|
printf("register %d valid and read\n", regno);
|
|
|
|
|
target_xfer_memory (sp + i - REGISTER_BYTE (L0_REGNUM),
|
|
|
|
|
®isters[i], REGISTER_RAW_SIZE (regno), 0);
|
|
|
|
|
register_valid[regno] = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Store our register values back into the inferior.
|
|
|
|
|
If REGNO is -1, do this for all registers.
|
|
|
|
|
Otherwise, REGNO specifies which register (so we can save time). */
|
|
|
|
|
|
1992-02-21 09:33:14 +08:00
|
|
|
|
void
|
1991-03-29 00:28:29 +08:00
|
|
|
|
store_inferior_registers (regno)
|
|
|
|
|
int regno;
|
|
|
|
|
{
|
|
|
|
|
struct regs inferior_registers;
|
|
|
|
|
struct fp_status inferior_fp_registers;
|
|
|
|
|
int wanna_store = INT_REGS + STACK_REGS + FP_REGS;
|
|
|
|
|
|
|
|
|
|
/* First decide which pieces of machine-state we need to modify.
|
|
|
|
|
Default for regno == -1 case is all pieces. */
|
|
|
|
|
if (regno >= 0)
|
|
|
|
|
if (FP0_REGNUM <= regno && regno < FP0_REGNUM + 32)
|
|
|
|
|
{
|
|
|
|
|
wanna_store = FP_REGS;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (regno == SP_REGNUM)
|
|
|
|
|
wanna_store = INT_REGS + STACK_REGS;
|
|
|
|
|
else if (regno < L0_REGNUM || regno > I7_REGNUM)
|
|
|
|
|
wanna_store = INT_REGS;
|
|
|
|
|
else
|
|
|
|
|
wanna_store = STACK_REGS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* See if we're forcing the stores to happen now, or deferring. */
|
|
|
|
|
if (regno == -2)
|
|
|
|
|
{
|
|
|
|
|
wanna_store = deferred_stores;
|
|
|
|
|
deferred_stores = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (wanna_store == STACK_REGS)
|
|
|
|
|
{
|
|
|
|
|
/* Fall through and just store one stack reg. If we deferred
|
|
|
|
|
it, we'd have to store them all, or remember more info. */
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
deferred_stores |= wanna_store;
|
1992-02-21 09:33:14 +08:00
|
|
|
|
return;
|
1991-03-29 00:28:29 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (wanna_store & STACK_REGS)
|
|
|
|
|
{
|
|
|
|
|
CORE_ADDR sp = *(CORE_ADDR *)®isters[REGISTER_BYTE (SP_REGNUM)];
|
|
|
|
|
|
|
|
|
|
if (regno < 0 || regno == SP_REGNUM)
|
|
|
|
|
{
|
|
|
|
|
if (!register_valid[L0_REGNUM+5]) abort();
|
|
|
|
|
target_xfer_memory (sp,
|
|
|
|
|
®isters[REGISTER_BYTE (L0_REGNUM)],
|
|
|
|
|
16*REGISTER_RAW_SIZE (L0_REGNUM), 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!register_valid[regno]) abort();
|
|
|
|
|
target_xfer_memory (sp + REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM),
|
|
|
|
|
®isters[REGISTER_BYTE (regno)],
|
|
|
|
|
REGISTER_RAW_SIZE (regno), 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (wanna_store & INT_REGS)
|
|
|
|
|
{
|
|
|
|
|
if (!register_valid[G1_REGNUM]) abort();
|
|
|
|
|
|
* breakpoint.c, buildsym.c, c-exp.y, coffread.c, command.c,
core.c, cplus-dem.c, dbxread.c, dwarfread.c, elfread.c, environ.c,
eval.c, findvar.c, gdbtypes.c, hppabsd-tdep.c, hppahpux-tdep.c,
i386-tdep.c, ieee-float.c, infcmd.c, inflow.c, infptrace.c,
infrun.c, m2-exp.y, mipsread.c, objfiles.c, parse.c, procfs.c,
putenv.c, remote-mm.c, remote-vx.c, solib.c, sparc-tdep.c,
sparc-xdep.c, stack.c, symfile.c, symtab.c, symtab.h, target.c,
tm-i386v.h, tm-sparc.h, utils.c, valarith.c, valops.c, valprint.c,
values.c, xcoffread.c:
Remove "(void)" casts from function calls where the return value
is ignored, in accordance with GNU coding standards.
1992-07-04 11:22:08 +08:00
|
|
|
|
memcpy (&inferior_registers.r_g1, ®isters[REGISTER_BYTE (G1_REGNUM)],
|
|
|
|
|
15 * REGISTER_RAW_SIZE (G1_REGNUM));
|
1991-03-29 00:28:29 +08:00
|
|
|
|
|
|
|
|
|
inferior_registers.r_ps =
|
|
|
|
|
*(int *)®isters[REGISTER_BYTE (PS_REGNUM)];
|
|
|
|
|
inferior_registers.r_pc =
|
|
|
|
|
*(int *)®isters[REGISTER_BYTE (PC_REGNUM)];
|
|
|
|
|
inferior_registers.r_npc =
|
|
|
|
|
*(int *)®isters[REGISTER_BYTE (NPC_REGNUM)];
|
|
|
|
|
inferior_registers.r_y =
|
|
|
|
|
*(int *)®isters[REGISTER_BYTE (Y_REGNUM)];
|
|
|
|
|
|
* Makefile.in (VERSION): Bump to 4.5.6.
* coffread.c (coff_end_symtab): Cast 2nd arg of complain() to
correct type.
* defs.h (NORETURN): Define away for Lucid compiler.
* remote.c (remote_timer, remote_interrupt): Signal handlers
take one int arg.
* ser-termios.c (serial_write, serial_close): Return whatever
value the write/close call returns, rather than falling off end.
* inferior.h (PTRACE_ARG3_TYPE): Third arg to ptrace is int on
more systems than it is "char *". Define PTRACE_ARG3_TYPE to
default to int.
* infptrace.c, hppabsd-xdep.c, hppahpux-xdep.c, i386-xdep.c,
inferior.h (call_ptrace): Use PTRACE_ARG3_TYPE to declare type
of third arg.
* a68v-xdep.c, arm-xdep.c, convex-xdep.c, hp300ux-xdep.c, infrun.c,
m88k-xdep.c, mach386-xdep.c, mips-xdep.c, os68k-xdep.c, pyr-tdep.c,
pyr-xdep.c, rs6000-xdep.c, sparc-xdep.c, sun3-xdep.c, sun386-xdep.c,
symm-xdep.c, ultra3-xdep.c: Use PTRACE_ARG3_TYPE to cast ptrace
argument 3.
* sparc-xdep.c, a68v-xdep.c (fetch_inferior_registers,
store_inferior_registers): Supply missing fourth argument to
ptrace().
1992-06-24 12:49:48 +08:00
|
|
|
|
if (0 != ptrace (PTRACE_SETREGS, inferior_pid,
|
|
|
|
|
(PTRACE_ARG3_TYPE) &inferior_registers, 0))
|
1991-03-29 00:28:29 +08:00
|
|
|
|
perror("ptrace_setregs");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (wanna_store & FP_REGS)
|
|
|
|
|
{
|
|
|
|
|
if (!register_valid[FP0_REGNUM+9]) abort();
|
* breakpoint.c, buildsym.c, c-exp.y, coffread.c, command.c,
core.c, cplus-dem.c, dbxread.c, dwarfread.c, elfread.c, environ.c,
eval.c, findvar.c, gdbtypes.c, hppabsd-tdep.c, hppahpux-tdep.c,
i386-tdep.c, ieee-float.c, infcmd.c, inflow.c, infptrace.c,
infrun.c, m2-exp.y, mipsread.c, objfiles.c, parse.c, procfs.c,
putenv.c, remote-mm.c, remote-vx.c, solib.c, sparc-tdep.c,
sparc-xdep.c, stack.c, symfile.c, symtab.c, symtab.h, target.c,
tm-i386v.h, tm-sparc.h, utils.c, valarith.c, valops.c, valprint.c,
values.c, xcoffread.c:
Remove "(void)" casts from function calls where the return value
is ignored, in accordance with GNU coding standards.
1992-07-04 11:22:08 +08:00
|
|
|
|
memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)],
|
|
|
|
|
sizeof inferior_fp_registers.fpu_fr);
|
1991-03-29 00:28:29 +08:00
|
|
|
|
|
* breakpoint.c, buildsym.c, c-exp.y, coffread.c, command.c,
core.c, cplus-dem.c, dbxread.c, dwarfread.c, elfread.c, environ.c,
eval.c, findvar.c, gdbtypes.c, hppabsd-tdep.c, hppahpux-tdep.c,
i386-tdep.c, ieee-float.c, infcmd.c, inflow.c, infptrace.c,
infrun.c, m2-exp.y, mipsread.c, objfiles.c, parse.c, procfs.c,
putenv.c, remote-mm.c, remote-vx.c, solib.c, sparc-tdep.c,
sparc-xdep.c, stack.c, symfile.c, symtab.c, symtab.h, target.c,
tm-i386v.h, tm-sparc.h, utils.c, valarith.c, valops.c, valprint.c,
values.c, xcoffread.c:
Remove "(void)" casts from function calls where the return value
is ignored, in accordance with GNU coding standards.
1992-07-04 11:22:08 +08:00
|
|
|
|
/* memcpy (&inferior_fp_registers.Fpu_fsr,
|
|
|
|
|
®isters[REGISTER_BYTE (FPS_REGNUM)], sizeof (FPU_FSR_TYPE));
|
1991-03-29 00:28:29 +08:00
|
|
|
|
****/
|
|
|
|
|
if (0 !=
|
* Makefile.in (VERSION): Bump to 4.5.6.
* coffread.c (coff_end_symtab): Cast 2nd arg of complain() to
correct type.
* defs.h (NORETURN): Define away for Lucid compiler.
* remote.c (remote_timer, remote_interrupt): Signal handlers
take one int arg.
* ser-termios.c (serial_write, serial_close): Return whatever
value the write/close call returns, rather than falling off end.
* inferior.h (PTRACE_ARG3_TYPE): Third arg to ptrace is int on
more systems than it is "char *". Define PTRACE_ARG3_TYPE to
default to int.
* infptrace.c, hppabsd-xdep.c, hppahpux-xdep.c, i386-xdep.c,
inferior.h (call_ptrace): Use PTRACE_ARG3_TYPE to declare type
of third arg.
* a68v-xdep.c, arm-xdep.c, convex-xdep.c, hp300ux-xdep.c, infrun.c,
m88k-xdep.c, mach386-xdep.c, mips-xdep.c, os68k-xdep.c, pyr-tdep.c,
pyr-xdep.c, rs6000-xdep.c, sparc-xdep.c, sun3-xdep.c, sun386-xdep.c,
symm-xdep.c, ultra3-xdep.c: Use PTRACE_ARG3_TYPE to cast ptrace
argument 3.
* sparc-xdep.c, a68v-xdep.c (fetch_inferior_registers,
store_inferior_registers): Supply missing fourth argument to
ptrace().
1992-06-24 12:49:48 +08:00
|
|
|
|
ptrace (PTRACE_SETFPREGS, inferior_pid,
|
|
|
|
|
(PTRACE_ARG3_TYPE) &inferior_fp_registers, 0))
|
1991-03-29 00:28:29 +08:00
|
|
|
|
perror("ptrace_setfpregs");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
1992-03-30 07:26:47 +08:00
|
|
|
|
fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
|
1991-03-29 00:28:29 +08:00
|
|
|
|
char *core_reg_sect;
|
|
|
|
|
unsigned core_reg_size;
|
|
|
|
|
int which;
|
1992-03-30 07:26:47 +08:00
|
|
|
|
unsigned int ignore; /* reg addr, unused in this version */
|
1991-03-29 00:28:29 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (which == 0) {
|
|
|
|
|
|
|
|
|
|
/* Integer registers */
|
|
|
|
|
|
|
|
|
|
#define gregs ((struct regs *)core_reg_sect)
|
|
|
|
|
/* G0 *always* holds 0. */
|
|
|
|
|
*(int *)®isters[REGISTER_BYTE (0)] = 0;
|
|
|
|
|
|
|
|
|
|
/* The globals and output registers. */
|
* breakpoint.c, buildsym.c, c-exp.y, coffread.c, command.c,
core.c, cplus-dem.c, dbxread.c, dwarfread.c, elfread.c, environ.c,
eval.c, findvar.c, gdbtypes.c, hppabsd-tdep.c, hppahpux-tdep.c,
i386-tdep.c, ieee-float.c, infcmd.c, inflow.c, infptrace.c,
infrun.c, m2-exp.y, mipsread.c, objfiles.c, parse.c, procfs.c,
putenv.c, remote-mm.c, remote-vx.c, solib.c, sparc-tdep.c,
sparc-xdep.c, stack.c, symfile.c, symtab.c, symtab.h, target.c,
tm-i386v.h, tm-sparc.h, utils.c, valarith.c, valops.c, valprint.c,
values.c, xcoffread.c:
Remove "(void)" casts from function calls where the return value
is ignored, in accordance with GNU coding standards.
1992-07-04 11:22:08 +08:00
|
|
|
|
memcpy (®isters[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1,
|
|
|
|
|
15 * REGISTER_RAW_SIZE (G1_REGNUM));
|
1991-03-29 00:28:29 +08:00
|
|
|
|
*(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
|
|
|
|
|
*(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
|
|
|
|
|
*(int *)®isters[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
|
|
|
|
|
*(int *)®isters[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
|
|
|
|
|
|
|
|
|
|
/* My best guess at where to get the locals and input
|
|
|
|
|
registers is exactly where they usually are, right above
|
|
|
|
|
the stack pointer. If the core dump was caused by a bus error
|
|
|
|
|
from blowing away the stack pointer (as is possible) then this
|
|
|
|
|
won't work, but it's worth the try. */
|
|
|
|
|
{
|
|
|
|
|
int sp;
|
|
|
|
|
|
|
|
|
|
sp = *(int *)®isters[REGISTER_BYTE (SP_REGNUM)];
|
|
|
|
|
if (0 != target_read_memory (sp, ®isters[REGISTER_BYTE (L0_REGNUM)],
|
|
|
|
|
16 * REGISTER_RAW_SIZE (L0_REGNUM)))
|
|
|
|
|
{
|
|
|
|
|
/* fprintf so user can still use gdb */
|
|
|
|
|
fprintf (stderr,
|
|
|
|
|
"Couldn't read input and local registers from core file\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (which == 2) {
|
|
|
|
|
|
|
|
|
|
/* Floating point registers */
|
|
|
|
|
|
|
|
|
|
#define fpuregs ((struct fpu *) core_reg_sect)
|
|
|
|
|
if (core_reg_size >= sizeof (struct fpu))
|
|
|
|
|
{
|
* breakpoint.c, buildsym.c, c-exp.y, coffread.c, command.c,
core.c, cplus-dem.c, dbxread.c, dwarfread.c, elfread.c, environ.c,
eval.c, findvar.c, gdbtypes.c, hppabsd-tdep.c, hppahpux-tdep.c,
i386-tdep.c, ieee-float.c, infcmd.c, inflow.c, infptrace.c,
infrun.c, m2-exp.y, mipsread.c, objfiles.c, parse.c, procfs.c,
putenv.c, remote-mm.c, remote-vx.c, solib.c, sparc-tdep.c,
sparc-xdep.c, stack.c, symfile.c, symtab.c, symtab.h, target.c,
tm-i386v.h, tm-sparc.h, utils.c, valarith.c, valops.c, valprint.c,
values.c, xcoffread.c:
Remove "(void)" casts from function calls where the return value
is ignored, in accordance with GNU coding standards.
1992-07-04 11:22:08 +08:00
|
|
|
|
memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], fpuregs->fpu_regs,
|
|
|
|
|
sizeof (fpuregs->fpu_regs));
|
|
|
|
|
memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr,
|
|
|
|
|
sizeof (FPU_FSR_TYPE));
|
1991-03-29 00:28:29 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
fprintf (stderr, "Couldn't read float regs from core file\n");
|
|
|
|
|
}
|
|
|
|
|
}
|