* convex-xdep.c, hppab-nat.c, i860-tdep.c, infptrace.c: Remove

decl for attach_flag, it now lives in inferior.h.
* hppa-pinsn.c:  Reformat opcode tables.  Add function prototypes.
Make most functions static.
* hppah-nat.c:  General cleanups, remove BSD specific code (since
that all lives in hppab-nat.c).
* hppah-tdep.c (frame_chain_valid), tm-hppa.h (FRAME_CHAIN):
Change sense of test against inside_entry_file().  This fix is
from U. of Utah.
* tm-hppa.h (PUSH_DUMMY_FRAME, POP_FRAME):  Use char * for 2nd arg
to read/write_register_bytes().
This commit is contained in:
Stu Grossman 1992-12-15 01:45:15 +00:00
parent 764c960db4
commit 01d1590bab
9 changed files with 78 additions and 114 deletions

View file

@ -1,14 +1,30 @@
Mon Dec 14 17:18:42 1992 Stu Grossman (grossman at cygnus.com)
* convex-xdep.c, hppab-nat.c, i860-tdep.c, infptrace.c: Remove
decl for attach_flag, it now lives in inferior.h.
* hppa-pinsn.c: Reformat opcode tables. Add function prototypes.
Make most functions static.
* hppah-nat.c: General cleanups, remove BSD specific code (since
that all lives in hppab-nat.c).
* hppah-tdep.c (frame_chain_valid), tm-hppa.h (FRAME_CHAIN):
Change sense of test against inside_entry_file(). This fix is
from U. of Utah.
* tm-hppa.h (PUSH_DUMMY_FRAME, POP_FRAME): Use char * for 2nd arg
to read/write_register_bytes().
Wed Dec 9 19:53:25 1992 John Gilmore (gnu@cygnus.com) Wed Dec 9 19:53:25 1992 John Gilmore (gnu@cygnus.com)
* mipsread.c (parse_symbol): When checking whether a structured * mipsread.c (parse_symbol): When checking whether a structured
type is an enum, check qualifiers of its first member, as well as type is an enum, check qualifiers of its first member, as well as
the base type of the member. Bug found and fixed by John M. the base type of the member. Bug found and fixed by John M.
Farrell, <farrell@fjort.reo.dec.com>. Farrell, <farrell@fjord.reo.dec.com>.
* vx-share/{reg.h,xdr_regs.h,xdr_regs.c}: Remove, unused. * vx-share/{reg.h,xdr_regs.h,xdr_regs.c}: Remove, unused.
* remote-vx.c: Don't include vx-share/reg.h. * remote-vx.c: Don't include vx-share/reg.h.
* vx-share/ptrace.h: Reproduce from scratch. * vx-share/ptrace.h: Reproduce from scratch.
* config/{vxworks68,vxworks960}: Don't include xdr_regs.o. * config/{vxworks68,vxworks960}: Don't include xdr_regs.o.
* Makefile.in: Remove references to removed files, and to removed
29k-share directories.
Tue Dec 8 13:30:58 1992 Fred Fish (fnf@cygnus.com) Tue Dec 8 13:30:58 1992 Fred Fish (fnf@cygnus.com)

View file

@ -189,13 +189,6 @@ static int exec_trap_timer;
#include "gdbcmd.h" #include "gdbcmd.h"
/* Nonzero if we are debugging an attached outside process
rather than an inferior. */
extern int attach_flag;
static struct type *vector_type (); static struct type *vector_type ();
static long *read_vector_register (); static long *read_vector_register ();
static long *read_vector_register_1 (); static long *read_vector_register_1 ();

View file

@ -848,7 +848,7 @@ check_stub_method (type, i, j)
TYPE_FN_FIELD_STUB (f, j) = 0; TYPE_FN_FIELD_STUB (f, j) = 0;
} }
const struct cplus_struct_type cplus_struct_default; struct cplus_struct_type cplus_struct_default;
void void
allocate_cplus_struct_type (type) allocate_cplus_struct_type (type)

View file

@ -364,7 +364,7 @@ struct cplus_struct_type
/* The default value of TYPE_CPLUS_SPECIFIC(T) points to the /* The default value of TYPE_CPLUS_SPECIFIC(T) points to the
this shared static structure. */ this shared static structure. */
extern const struct cplus_struct_type cplus_struct_default; extern struct cplus_struct_type cplus_struct_default;
extern void extern void
allocate_cplus_struct_type PARAMS ((struct type *)); allocate_cplus_struct_type PARAMS ((struct type *));
@ -491,7 +491,7 @@ extern struct type *builtin_type_m2_card;
extern struct type *builtin_type_m2_real; extern struct type *builtin_type_m2_real;
extern struct type *builtin_type_m2_bool; extern struct type *builtin_type_m2_bool;
/* start-sanitize-chill /* start-sanitize-chill */
/* Chill types */ /* Chill types */
extern struct type *builtin_type_chill_bool; extern struct type *builtin_type_chill_bool;
@ -499,7 +499,7 @@ extern struct type *builtin_type_chill_char;
extern struct type *builtin_type_chill_long; extern struct type *builtin_type_chill_long;
extern struct type *builtin_type_chill_ulong; extern struct type *builtin_type_chill_ulong;
extern struct type *builtin_type_chill_real; extern struct type *builtin_type_chill_real;
/* end-sanitize-chill /* end-sanitize-chill */
/* LONG_LONG is defined if the host has "long long". */ /* LONG_LONG is defined if the host has "long long". */

View file

@ -24,33 +24,44 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "symtab.h" #include "symtab.h"
#include "opcode/hppa.h" #include "opcode/hppa.h"
char *control_reg[] = {"rctr", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", static char *control_reg[] =
"pidr1", "pidr2", "ccr", "sar", "pidr3", "pidr4", { "rctr", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",
"iva", "eiem", "itmr", "pcsq", "pcoq", "iir", "isr", "pidr1", "pidr2", "ccr", "sar", "pidr3", "pidr4",
"ior", "ipsw", "eirr", "tr0", "tr1", "tr2", "tr3", "iva", "eiem", "itmr", "pcsq", "pcoq", "iir", "isr",
"tr4", "tr5", "tr6", "tr7" "ior", "ipsw", "eirr", "tr0", "tr1", "tr2", "tr3",
}; "tr4", "tr5", "tr6", "tr7"
};
char *compare_cond_names[] = {"", ",=", ",<", ",<=", ",<<", ",<<=", ",sv", static char *compare_cond_names[] =
",od", ",tr", ",<>", ",>=", ",>", ",>>=", { "", ",=", ",<", ",<=", ",<<", ",<<=", ",sv",
",>>", ",nsv", ",ev" ",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"};
char *index_compl_names[] = {"", ",m", ",s", ",sm"}; static char *add_cond_names[] =
char *short_ldst_compl_names[] = {"", ",ma", "", ",mb"}; { "", ",=", ",<", ",<=", ",nuv", ",znv", ",sv",
char *short_bytes_compl_names[] = {"", ",b,m", ",e", ",e,m"}; ",od", ",tr", ",<>", ",>=", ",>", ",uv",
char *float_format_names[] = {",sgl", ",dbl", ",quad"}; ",vnz", ",nsv", ",ev"
char *float_comp_names[] = };
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", ",?=", ",!<>", {",false?", ",false", ",?", ",!<=>", ",=", ",=t", ",?=", ",!<>",
",!?>=", ",<", ",?<", ",!>=", ",!?>", ",<=", ",?<=", ",!>", ",!?>=", ",<", ",?<", ",!>=", ",!?>", ",<=", ",?<=", ",!>",
",!?<=", ",>", ",?>", ",!<=", ",!?<", ",>=", ",?>=", ",!<", ",!?<=", ",>", ",?>", ",!<=", ",!?<", ",>=", ",?>=", ",!<",
@ -65,7 +76,10 @@ char *float_comp_names[] =
#define GET_COND(insn) (GET_FIELD ((insn), 16, 18) + \ #define GET_COND(insn) (GET_FIELD ((insn), 16, 18) + \
(GET_FIELD ((insn), 19, 19) ? 8 : 0)) (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. */ /* Print one instruction from MEMADDR on STREAM. */
int int
@ -335,7 +349,7 @@ print_insn (memaddr, stream)
/* Utility function to print registers */ /* Utility function to print registers */
void static void
fput_reg (reg, stream) fput_reg (reg, stream)
unsigned reg; unsigned reg;
FILE *stream; FILE *stream;

View file

@ -63,9 +63,6 @@ kill_inferior ()
} }
#ifdef ATTACH_DETACH #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. */ /* Start debugging the process whose number is PID. */
int int

View file

@ -25,18 +25,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "defs.h" #include "defs.h"
#include "inferior.h" #include "inferior.h"
#include "target.h"
#include <sys/ptrace.h>
#ifndef PT_ATTACH static void fetch_register ();
#define PT_ATTACH PTRACE_ATTACH
#endif
#ifndef PT_DETACH
#define PT_DETACH PTRACE_DETACH
#endif
/* This function simply calls ptrace with the given arguments. /* This function simply calls ptrace with the given arguments.
It exists so that all calls to ptrace are isolated in this It exists so that all calls to ptrace are isolated in this
machine-dependent file. */ machine-dependent file. */
#ifdef WANT_NATIVE_TARGET
int int
call_ptrace (request, pid, addr, data) call_ptrace (request, pid, addr, data)
int request, pid; int request, pid;
@ -45,29 +41,17 @@ call_ptrace (request, pid, addr, data)
{ {
return ptrace (request, pid, addr, data, 0); 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 void
kill_inferior () kill_inferior ()
{ {
if (inferior_pid == 0) if (inferior_pid == 0)
return; 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); wait ((int *)0);
target_mourn_inferior (); 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. */ /* Start debugging the process whose number is PID. */
int int
attach (pid) attach (pid)
@ -95,7 +79,6 @@ detach (signal)
perror_with_name ("ptrace"); perror_with_name ("ptrace");
attach_flag = 0; attach_flag = 0;
} }
#endif /* ATTACH_DETACH */
/* Fetch all registers, or just one, from the child process. */ /* Fetch all registers, or just one, from the child process. */
@ -110,11 +93,6 @@ fetch_inferior_registers (regno)
fetch_register (regno); 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. /* Store our register values back into the inferior.
If REGNO is -1, do this for all registers. If REGNO is -1, do this for all registers.
Otherwise, REGNO specifies which register (so we can save time). */ Otherwise, REGNO specifies which register (so we can save time). */
@ -150,8 +128,6 @@ store_inferior_registers (regno)
{ {
for (regno = 0; regno < NUM_REGS; regno++) for (regno = 0; regno < NUM_REGS; regno++)
{ {
if (CANNOT_STORE_REGISTER (regno))
continue;
regaddr = register_addr (regno, offset); regaddr = register_addr (regno, offset);
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int)) for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
{ {
@ -172,27 +148,7 @@ store_inferior_registers (regno)
/* KERNEL_U_ADDR is the amount to subtract from u.u_ar0 /* KERNEL_U_ADDR is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */ 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(). */ /* Get kernel_u_addr using HPUX-style nlist(). */
CORE_ADDR kernel_u_addr; CORE_ADDR kernel_u_addr;
@ -209,11 +165,12 @@ static struct hpnlist nl[] = {{ "_u", -1, }, { (char *) 0, }};
/* read the value of the u area from the hp-ux kernel */ /* read the value of the u area from the hp-ux kernel */
void _initialize_kernel_u_addr () void _initialize_kernel_u_addr ()
{ {
#if 0
struct user u; struct user u;
#endif
nlist ("/hp-ux", &nl); nlist ("/hp-ux", &nl);
kernel_u_addr = nl[0].n_value; kernel_u_addr = nl[0].n_value;
} }
#endif /* KERNEL_U_ADDR_HPUX. */
#if !defined (offsetof) #if !defined (offsetof)
#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
@ -227,11 +184,6 @@ void _initialize_kernel_u_addr ()
- KERNEL_U_ADDR - KERNEL_U_ADDR
#endif #endif
/* Registers we shouldn't try to fetch. */
#if !defined (CANNOT_FETCH_REGISTER)
#define CANNOT_FETCH_REGISTER(regno) 0
#endif
/* Fetch one register. */ /* Fetch one register. */
static void static void
@ -246,13 +198,6 @@ fetch_register (regno)
/* Offset of registers within the u area. */ /* Offset of registers within the u area. */
unsigned int offset; 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; offset = U_REGS_OFFSET;
regaddr = register_addr (regno, offset); regaddr = register_addr (regno, offset);

View file

@ -759,7 +759,7 @@ int frame_chain_valid (chain, thisframe)
{ {
CORE_ADDR pc = get_pc_function_start (FRAME_SAVED_PC (thisframe)); CORE_ADDR pc = get_pc_function_start (FRAME_SAVED_PC (thisframe));
if (!inside_entry_file (pc)) if (inside_entry_file (pc))
return 0; return 0;
/* look for stw rp, -20(0,sp); copy 4,1; copy sp, 4 */ /* look for stw rp, -20(0,sp); copy 4,1; copy sp, 4 */
if (read_memory_integer (pc, 4) == 0x6BC23FD9) if (read_memory_integer (pc, 4) == 0x6BC23FD9)
@ -802,7 +802,6 @@ gcc_p (pc)
return 0; return 0;
} }
find_dummy_frame_regs (frame, frame_saved_regs) find_dummy_frame_regs (frame, frame_saved_regs)
struct frame_info *frame; struct frame_info *frame;
struct frame_saved_regs *frame_saved_regs; struct frame_saved_regs *frame_saved_regs;

View file

@ -287,7 +287,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
address (previous FP). */ address (previous FP). */
#define FRAME_CHAIN(thisframe) \ #define FRAME_CHAIN(thisframe) \
(inside_entry_file ((thisframe)->pc) ? \ (!inside_entry_file ((thisframe)->pc) ? \
read_memory_integer ((thisframe)->frame, 4) :\ read_memory_integer ((thisframe)->frame, 4) :\
0) 0)
@ -419,21 +419,21 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
{ register CORE_ADDR sp = read_register (SP_REGNUM); \ { register CORE_ADDR sp = read_register (SP_REGNUM); \
register int regnum; \ register int regnum; \
int int_buffer; \ int int_buffer; \
double freg_buffer; \ char freg_buffer[8]; \
/* Space for "arguments"; the RP goes in here. */ \ /* Space for "arguments"; the RP goes in here. */ \
sp += 48; \ sp += 48; \
int_buffer = read_register (RP_REGNUM) | 0x3; \ 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); \ int_buffer = read_register (FP_REGNUM); \
write_memory (sp, &int_buffer, 4); \ write_memory (sp, (char *)&int_buffer, 4); \
write_register (FP_REGNUM, sp); \ write_register (FP_REGNUM, sp); \
sp += 4; \ sp += 4; \
for (regnum = 1; regnum < 31; regnum++) \ for (regnum = 1; regnum < 31; regnum++) \
if (regnum != RP_REGNUM && regnum != FP_REGNUM) \ if (regnum != RP_REGNUM && regnum != FP_REGNUM) \
sp = push_word (sp, read_register (regnum)); \ sp = push_word (sp, read_register (regnum)); \
for (regnum = FP0_REGNUM; regnum < NUM_REGS; regnum++) \ for (regnum = FP0_REGNUM; regnum < NUM_REGS; regnum++) \
{ read_register_bytes (REGISTER_BYTE (regnum), &freg_buffer, 8); \ { read_register_bytes (REGISTER_BYTE (regnum), freg_buffer, 8); \
sp = push_bytes (sp, &freg_buffer, 8);} \ sp = push_bytes (sp, freg_buffer, 8);} \
sp = push_word (sp, read_register (IPSW_REGNUM)); \ sp = push_word (sp, read_register (IPSW_REGNUM)); \
sp = push_word (sp, read_register (SAR_REGNUM)); \ sp = push_word (sp, read_register (SAR_REGNUM)); \
sp = push_word (sp, read_register (PCOQ_TAIL_REGNUM)); \ sp = push_word (sp, read_register (PCOQ_TAIL_REGNUM)); \
@ -448,7 +448,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
register int regnum; \ register int regnum; \
struct frame_saved_regs fsr; \ struct frame_saved_regs fsr; \
struct frame_info *fi; \ struct frame_info *fi; \
double freg_buffer; \ char freg_buffer[8]; \
fi = get_frame_info (frame); \ fi = get_frame_info (frame); \
fp = fi->frame; \ fp = fi->frame; \
get_frame_saved_regs (fi, &fsr); \ get_frame_saved_regs (fi, &fsr); \
@ -457,8 +457,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \ write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \
for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM ; regnum--) \ for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM ; regnum--) \
if (fsr.regs[regnum]) \ if (fsr.regs[regnum]) \
{ read_memory (fsr.regs[regnum], &freg_buffer, 8); \ { read_memory (fsr.regs[regnum], freg_buffer, 8); \
write_register_bytes (REGISTER_BYTE (regnum), &freg_buffer, 8); }\ write_register_bytes (REGISTER_BYTE (regnum), freg_buffer, 8); }\
if (fsr.regs[IPSW_REGNUM]) \ if (fsr.regs[IPSW_REGNUM]) \
write_register (IPSW_REGNUM, \ write_register (IPSW_REGNUM, \
read_memory_integer (fsr.regs[IPSW_REGNUM], 4)); \ read_memory_integer (fsr.regs[IPSW_REGNUM], 4)); \