#include "symtab.h"
#include "opcode/hppa.h"
-char *control_reg[] = {"rctr", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",
- "pidr1", "pidr2", "ccr", "sar", "pidr3", "pidr4",
- "iva", "eiem", "itmr", "pcsq", "pcoq", "iir", "isr",
- "ior", "ipsw", "eirr", "tr0", "tr1", "tr2", "tr3",
- "tr4", "tr5", "tr6", "tr7"
- };
+static char *control_reg[] =
+{ "rctr", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",
+ "pidr1", "pidr2", "ccr", "sar", "pidr3", "pidr4",
+ "iva", "eiem", "itmr", "pcsq", "pcoq", "iir", "isr",
+ "ior", "ipsw", "eirr", "tr0", "tr1", "tr2", "tr3",
+ "tr4", "tr5", "tr6", "tr7"
+ };
-char *compare_cond_names[] = {"", ",=", ",<", ",<=", ",<<", ",<<=", ",sv",
- ",od", ",tr", ",<>", ",>=", ",>", ",>>=",
- ",>>", ",nsv", ",ev"
- };
-char *add_cond_names[] = {"", ",=", ",<", ",<=", ",nuv", ",znv", ",sv",
- ",od", ",tr", ",<>", ",>=", ",>", ",uv",
- ",vnz", ",nsv", ",ev"
- };
-char *logical_cond_names[] = {"", ",=", ",<", ",<=", 0, 0, 0, ",od",
- ",tr", ",<>", ",>=", ",>", 0, 0, 0, ",ev"};
-char *unit_cond_names[] = {"", 0, ",sbz", ",shz", ",sdc", 0, ",sbc", ",shc",
- ",tr", 0, ",nbz", ",nhz", ",ndc", 0, ",nbc", ",nhc"
- };
-char *shift_cond_names[] = {"", ",=", ",<", ",od", ",tr", ",<>", ",>=", ",ev"};
+static char *compare_cond_names[] =
+{ "", ",=", ",<", ",<=", ",<<", ",<<=", ",sv",
+ ",od", ",tr", ",<>", ",>=", ",>", ",>>=",
+ ",>>", ",nsv", ",ev"
+ };
-char *index_compl_names[] = {"", ",m", ",s", ",sm"};
-char *short_ldst_compl_names[] = {"", ",ma", "", ",mb"};
-char *short_bytes_compl_names[] = {"", ",b,m", ",e", ",e,m"};
-char *float_format_names[] = {",sgl", ",dbl", ",quad"};
-char *float_comp_names[] =
+static char *add_cond_names[] =
+{ "", ",=", ",<", ",<=", ",nuv", ",znv", ",sv",
+ ",od", ",tr", ",<>", ",>=", ",>", ",uv",
+ ",vnz", ",nsv", ",ev"
+ };
+
+static char *logical_cond_names[] =
+{ "", ",=", ",<", ",<=", 0, 0, 0, ",od",
+ ",tr", ",<>", ",>=", ",>", 0, 0, 0, ",ev"
+ };
+
+static char *unit_cond_names[] =
+{ "", 0, ",sbz", ",shz", ",sdc", 0, ",sbc", ",shc",
+ ",tr", 0, ",nbz", ",nhz", ",ndc", 0, ",nbc", ",nhc"
+ };
+
+static char *shift_cond_names[] =
+{"", ",=", ",<", ",od", ",tr", ",<>", ",>=", ",ev"};
+
+static char *index_compl_names[] = {"", ",m", ",s", ",sm"};
+static char *short_ldst_compl_names[] = {"", ",ma", "", ",mb"};
+static char *short_bytes_compl_names[] = {"", ",b,m", ",e", ",e,m"};
+static char *float_format_names[] = {",sgl", ",dbl", ",quad"};
+static char *float_comp_names[] =
{",false?", ",false", ",?", ",!<=>", ",=", ",=t", ",?=", ",!<>",
",!?>=", ",<", ",?<", ",!>=", ",!?>", ",<=", ",?<=", ",!>",
",!?<=", ",>", ",?>", ",!<=", ",!?<", ",>=", ",?>=", ",!<",
#define GET_COND(insn) (GET_FIELD ((insn), 16, 18) + \
(GET_FIELD ((insn), 19, 19) ? 8 : 0))
-void fput_reg (), fput_const ();
+static void fput_reg PARAMS ((unsigned reg, FILE *stream));
+static void fput_const PARAMS ((unsigned num, FILE *stream));
+static void fput_reg_r PARAMS ((unsigned reg, FILE *stream));
+static void fput_creg PARAMS ((unsigned reg, FILE *stream));
/* Print one instruction from MEMADDR on STREAM. */
int
/* Utility function to print registers */
-void
+static void
fput_reg (reg, stream)
unsigned reg;
FILE *stream;
#include "defs.h"
#include "inferior.h"
+#include "target.h"
+#include <sys/ptrace.h>
-#ifndef PT_ATTACH
-#define PT_ATTACH PTRACE_ATTACH
-#endif
-#ifndef PT_DETACH
-#define PT_DETACH PTRACE_DETACH
-#endif
+static void fetch_register ();
/* This function simply calls ptrace with the given arguments.
It exists so that all calls to ptrace are isolated in this
machine-dependent file. */
-#ifdef WANT_NATIVE_TARGET
int
call_ptrace (request, pid, addr, data)
int request, pid;
{
return ptrace (request, pid, addr, data, 0);
}
-#endif /* WANT_NATIVE_TARGET */
-
-#ifdef DEBUG_PTRACE
-/* For the rest of the file, use an extra level of indirection */
-/* This lets us breakpoint usefully on call_ptrace. */
-#define ptrace call_ptrace
-#endif
void
kill_inferior ()
{
if (inferior_pid == 0)
return;
- ptrace (PT_EXIT, inferior_pid, (PTRACE_ARG3_TYPE) 0, 0, 0); /* PT_EXIT = PT_KILL ? */
+ ptrace (PT_EXIT, inferior_pid, (PTRACE_ARG3_TYPE) 0, 0, 0);
wait ((int *)0);
target_mourn_inferior ();
}
-#ifdef ATTACH_DETACH
-/* Nonzero if we are debugging an attached process rather than
- an inferior. */
-extern int attach_flag;
-
/* Start debugging the process whose number is PID. */
int
attach (pid)
perror_with_name ("ptrace");
attach_flag = 0;
}
-#endif /* ATTACH_DETACH */
/* Fetch all registers, or just one, from the child process. */
fetch_register (regno);
}
-/* Registers we shouldn't try to store. */
-#if !defined (CANNOT_STORE_REGISTER)
-#define CANNOT_STORE_REGISTER(regno) 0
-#endif
-
/* 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). */
{
for (regno = 0; regno < NUM_REGS; regno++)
{
- if (CANNOT_STORE_REGISTER (regno))
- continue;
regaddr = register_addr (regno, offset);
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
{
/* KERNEL_U_ADDR is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */
-#if defined (KERNEL_U_ADDR_BSD)
-/* Get kernel_u_addr using BSD-style nlist(). */
-CORE_ADDR kernel_u_addr;
-
-#include <a.out.gnu.h> /* For struct nlist */
-
-void
-_initialize_kernel_u_addr ()
-{
- struct nlist names[2];
-
- names[0].n_un.n_name = "_u";
- names[1].n_un.n_name = NULL;
- if (nlist ("/vmunix", names) == 0)
- kernel_u_addr = names[0].n_value;
- else
- fatal ("Unable to get kernel u area address.");
-}
-#endif /* KERNEL_U_ADDR_BSD. */
-#if defined (KERNEL_U_ADDR_HPUX)
/* Get kernel_u_addr using HPUX-style nlist(). */
CORE_ADDR kernel_u_addr;
/* read the value of the u area from the hp-ux kernel */
void _initialize_kernel_u_addr ()
{
+#if 0
struct user u;
+#endif
nlist ("/hp-ux", &nl);
kernel_u_addr = nl[0].n_value;
}
-#endif /* KERNEL_U_ADDR_HPUX. */
#if !defined (offsetof)
#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
- KERNEL_U_ADDR
#endif
-/* Registers we shouldn't try to fetch. */
-#if !defined (CANNOT_FETCH_REGISTER)
-#define CANNOT_FETCH_REGISTER(regno) 0
-#endif
-
/* Fetch one register. */
static void
/* Offset of registers within the u area. */
unsigned int offset;
- if (CANNOT_FETCH_REGISTER (regno))
- {
- bzero (buf, REGISTER_RAW_SIZE (regno)); /* Supply zeroes */
- supply_register (regno, buf);
- return;
- }
-
offset = U_REGS_OFFSET;
regaddr = register_addr (regno, offset);
address (previous FP). */
#define FRAME_CHAIN(thisframe) \
- (inside_entry_file ((thisframe)->pc) ? \
+ (!inside_entry_file ((thisframe)->pc) ? \
read_memory_integer ((thisframe)->frame, 4) :\
0)
{ register CORE_ADDR sp = read_register (SP_REGNUM); \
register int regnum; \
int int_buffer; \
- double freg_buffer; \
+ char freg_buffer[8]; \
/* Space for "arguments"; the RP goes in here. */ \
sp += 48; \
int_buffer = read_register (RP_REGNUM) | 0x3; \
- write_memory (sp - 20, &int_buffer, 4); \
+ write_memory (sp - 20, (char *)&int_buffer, 4); \
int_buffer = read_register (FP_REGNUM); \
- write_memory (sp, &int_buffer, 4); \
+ write_memory (sp, (char *)&int_buffer, 4); \
write_register (FP_REGNUM, sp); \
sp += 4; \
for (regnum = 1; regnum < 31; regnum++) \
if (regnum != RP_REGNUM && regnum != FP_REGNUM) \
sp = push_word (sp, read_register (regnum)); \
for (regnum = FP0_REGNUM; regnum < NUM_REGS; regnum++) \
- { read_register_bytes (REGISTER_BYTE (regnum), &freg_buffer, 8); \
- sp = push_bytes (sp, &freg_buffer, 8);} \
+ { read_register_bytes (REGISTER_BYTE (regnum), freg_buffer, 8); \
+ sp = push_bytes (sp, freg_buffer, 8);} \
sp = push_word (sp, read_register (IPSW_REGNUM)); \
sp = push_word (sp, read_register (SAR_REGNUM)); \
sp = push_word (sp, read_register (PCOQ_TAIL_REGNUM)); \
register int regnum; \
struct frame_saved_regs fsr; \
struct frame_info *fi; \
- double freg_buffer; \
+ char freg_buffer[8]; \
fi = get_frame_info (frame); \
fp = fi->frame; \
get_frame_saved_regs (fi, &fsr); \
write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \
for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM ; regnum--) \
if (fsr.regs[regnum]) \
- { read_memory (fsr.regs[regnum], &freg_buffer, 8); \
- write_register_bytes (REGISTER_BYTE (regnum), &freg_buffer, 8); }\
+ { read_memory (fsr.regs[regnum], freg_buffer, 8); \
+ write_register_bytes (REGISTER_BYTE (regnum), freg_buffer, 8); }\
if (fsr.regs[IPSW_REGNUM]) \
write_register (IPSW_REGNUM, \
read_memory_integer (fsr.regs[IPSW_REGNUM], 4)); \