1993-07-30 16:42:31 +02:00
|
|
|
/* Functions specific to running gdb native on a Motorola Delta Series sysV68.
|
|
|
|
Copyright (C) 1993, Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
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 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
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 this program; if not, write to the Free Software
|
1995-08-02 05:41:12 +02:00
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
1993-07-30 16:42:31 +02:00
|
|
|
|
1993-07-02 21:18:14 +02:00
|
|
|
#include "defs.h"
|
|
|
|
#include <sys/signal.h> /* for MAXSIG in sys/user.h */
|
|
|
|
#include <sys/types.h> /* for ushort in sys/dir.h */
|
|
|
|
#include <sys/dir.h> /* for struct direct in sys/user.h */
|
|
|
|
#include <sys/user.h>
|
|
|
|
|
|
|
|
#include <nlist.h>
|
|
|
|
|
|
|
|
#if !defined (offsetof)
|
|
|
|
#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Return the address in the core dump or inferior of register REGNO.
|
|
|
|
BLOCKEND is the address of the end of the user structure. */
|
|
|
|
|
1996-09-09 05:01:49 +02:00
|
|
|
CORE_ADDR
|
1993-07-02 21:18:14 +02:00
|
|
|
register_addr (regno, blockend)
|
|
|
|
int regno;
|
1996-09-09 05:01:49 +02:00
|
|
|
CORE_ADDR blockend;
|
1993-07-02 21:18:14 +02:00
|
|
|
{
|
|
|
|
static int sysv68reg[] =
|
|
|
|
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, 15, 16 };
|
|
|
|
|
|
|
|
if (regno >= 0 && regno < sizeof(sysv68reg) / sizeof(sysv68reg[0]))
|
|
|
|
return blockend + sysv68reg[regno] * 4;
|
|
|
|
else if (regno < FPC_REGNUM)
|
1993-11-11 20:24:46 +01:00
|
|
|
return offsetof (struct user, u_fpu.regs.reg[regno - FP0_REGNUM][0]);
|
1993-07-02 21:18:14 +02:00
|
|
|
else if (regno == FPC_REGNUM)
|
|
|
|
return offsetof (struct user, u_fpu.regs.control);
|
|
|
|
else if (regno == FPS_REGNUM)
|
|
|
|
return offsetof (struct user, u_fpu.regs.status);
|
|
|
|
else if (regno == FPI_REGNUM)
|
|
|
|
return offsetof (struct user, u_fpu.regs.iaddr);
|
|
|
|
else
|
|
|
|
{
|
1993-11-01 23:25:23 +01:00
|
|
|
fprintf_unfiltered (gdb_stderr, "\
|
1993-07-02 21:18:14 +02:00
|
|
|
Internal error: invalid register number %d in REGISTER_U_ADDR\n",
|
|
|
|
regno);
|
|
|
|
return blockend;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CORE_ADDR kernel_u_addr;
|
|
|
|
|
|
|
|
/* Read the value of the u area from the kernel. */
|
* Makefile.in (init.c): Generate using the source, not munch. This
cleans up all kinds of hassles (which nm to use in munch, etc). The
new formatting conventions (mostly already followed) are that
the name of the _initialize_* routines must start in column zero,
and must not be inside #if.
* munch: Removed.
* Makefile.in: Remove references to munch.
* serial.c, remote.c, infptrace.c, maint.c, convex-tdep.c,
alpha-tdep.c, hp300ux-nat.c, hppab-nat.c, osfsolib.c, remote-es.c,
procfs.c, remote-udi.c, ser-go32.c, ultra3-xdep.c, sh-tdep.c,
i960-tdep.c, hppa-tdep.c, h8500-tdep.c, dpx2-nat.c, delta68-nat.c,
z8k-tdep.c: Make sure the above conventions are followed. Make
sure they are all declared as returning void. Clean up
miscellaneous comments and such.
1993-10-22 06:55:58 +01:00
|
|
|
void
|
|
|
|
_initialize_delta68_nat ()
|
1993-07-02 21:18:14 +02:00
|
|
|
{
|
1993-11-11 20:24:46 +01:00
|
|
|
struct nlist nl[2];
|
1993-08-20 01:18:03 +02:00
|
|
|
|
|
|
|
nl[0].n_name = "u";
|
|
|
|
nl[1].n_name = NULL;
|
|
|
|
if (nlist ("/sysV68", nl) == 0 && nl[0].n_scnum != 0)
|
1993-07-02 21:18:14 +02:00
|
|
|
kernel_u_addr = nl[0].n_value;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
perror ("Cannot get kernel u area address");
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
}
|
1998-02-10 21:14:43 +01:00
|
|
|
|
|
|
|
clear_insn_cache ()
|
|
|
|
{
|
|
|
|
#ifdef MCT_TEXT /* in sys/signal.h on sysV68 R3V7.1 */
|
|
|
|
memctl(0, 4096, MCT_TEXT);
|
|
|
|
#endif
|
|
|
|
}
|