aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-linux-nat.c
diff options
context:
space:
mode:
authorRichard Earnshaw <richard.earnshaw@arm.com>2002-02-11 18:34:12 +0000
committerRichard Earnshaw <richard.earnshaw@arm.com>2002-02-11 18:34:12 +0000
commit34e8f22dedd07c590a17569cb64d928f21433560 (patch)
treef88af499b3d9b7e7efcc5fd121ffcc4e683f2b8b /gdb/arm-linux-nat.c
parent56930d376b3c19f44f084e9db6eecd0a5390e445 (diff)
downloadgdb-34e8f22dedd07c590a17569cb64d928f21433560.zip
gdb-34e8f22dedd07c590a17569cb64d928f21433560.tar.gz
gdb-34e8f22dedd07c590a17569cb64d928f21433560.tar.bz2
* arm-tdep.h: New file.
* arm-tdep.c: Include arm-tdep.h. (arm_addr_bits_remove, arm_smash_text_address, arm_saved_pc_after_call) (arm_skip_prologue, arm_call_dummy_words, arm_fix_call_dummy) (arm_print_float_info, arm_register_type, convert_to_extended) (arm_elf_make_msymbols_special, arm_coff_make_msymbol_special) (arm_extract_return_value, arm_register_name): Make static. (arm_software_single_step): Similarly. Fix types in declaration. (arm_register_byte, arm_register_raw_size, arm_register_virtual_size) (arm_store_return_value, arm_store_struct_return): New functions. (arm_gdbarch_init): Register the above functions. Also register call_dummy_start_offset, sizeof_call_dummy_words, function_start_offset, inner_than, decr_pc_after_break, fp_regnum, sp_regnum, pc_regnum, register_bytes, num_regs, max_register_raw_size, max_register_virtual_size, register_size. Set up prologue_cache.saved_regs here, rather than ... (_initialize_arm_tdep): ... here. * config/arm/tm-arm.h (struct type, struct value): Delete forward declarations. (arm_addr_bits_remove, arm_smash_text_address, arm_saved_pc_after_call) (arm_skip_prologue, arm_call_dummy_words, arm_fix_call_dummy) (arm_print_float_info, arm_register_type, convert_to_extended) (arm_elf_make_msymbols_special, arm_coff_make_msymbol_special) (arm_extract_return_value, arm_register_name): Delete declarations. (SMASH_TEXT_ADDRESS, ADDR_BITS_REMOVE, FUNCTION_START_OFFSET) (SKIP_PROLOGUE, SAVED_PC_AFTER_CALL, INNER_THAN, BREAKPOINT_FROM_PC) (DECR_PC_AFTER_BREAK, PRINT_FLOAT_INFO, REGISTER_SIZE, NUM_REGS) (REGISTER_NAME, REGISTER_BYTES, REGISTER_BYTE, REGISTER_RAW_SIZE) (REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE) (MAX_REGISTER_VIRTUAL_SIZE, REGISTER_VIRTUAL_TYPE, STORE_STRUCT_RETURN) (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE, CALL_DUMMY_WORDS) (SIZEOF_CALL_DUMMY_WORDS, CALL_DUMMY_START_OFFSET, FIX_CALL_DUMMY) (SOFTWARE_SINGLE_STEP_P, SOFTWARE_SINGLE_STEP) (ELF_MAKE_MSYMBOL_SPECIAL, COFF_MAKE_MSYMBOL_SPECIAL) Delete. (arm_pc_is_thumb, arm_pc_is_thumb_dummy, thumb_get_next_pc) (arm_get_next_pc): No-longer static -- these are needed by the RDI interface. * arm-linux-nat.c arm-linux-tdep.c armnbsd-nat.c: Include arm-tdep.h. * remote-rdi.c remote-rdp.c: Likewise. * Makefile.in (arm-linux-nat.o, arm-linux-tdep.o arm-tdep.o) (armnbsd-nat.o, remote-rdi.o, remote_rdp.o): Update dependencies. * config/arm/tm-nbsd.h (SOFTWARE_SINGLE_STEP_P): Delete bogus definition. * arm-tdep.h (ARM_A1_REGNUM, ARM_A4_REGNUM, ARM_AP_REGNUM) (ARM_SP_REGNUM, ARM_LR_REGNUM, ARM_PC_REGNUM, ARM_F0_REGNUM) (ARM_F3_REGNUM, ARM_F7_REGNUM, ARM_FPS_REGNUM, ARM_PS_REGNUM): Renamed from non-ARM_ prefixed definitions. * arm-tdep.c armnbsd-nat.c arm-linux-nat.c arm-linux-tdep.c: Update all uses of above. * remote-rdi.c remote-rdp.c: Likewise. * arm-linux-nat.c (ARM_CPSR_REGNUM): Renamed from CPSR_REGNUM.
Diffstat (limited to 'gdb/arm-linux-nat.c')
-rw-r--r--gdb/arm-linux-nat.c118
1 files changed, 60 insertions, 58 deletions
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index 4d32491..115e960 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -1,5 +1,5 @@
/* GNU/Linux on ARM native support.
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -39,7 +39,7 @@ extern int arm_apcs_32;
#define typeDouble 0x02
#define typeExtended 0x03
#define FPWORDS 28
-#define CPSR_REGNUM 16
+#define ARM_CPSR_REGNUM 16
typedef union tagFPREG
{
@@ -100,7 +100,7 @@ fetch_nwfpe_single (unsigned int fn, FPA11 * fpa11)
mem[0] = fpa11->fpreg[fn].fSingle;
mem[1] = 0;
mem[2] = 0;
- supply_register (F0_REGNUM + fn, (char *) &mem[0]);
+ supply_register (ARM_F0_REGNUM + fn, (char *) &mem[0]);
}
static void
@@ -111,7 +111,7 @@ fetch_nwfpe_double (unsigned int fn, FPA11 * fpa11)
mem[0] = fpa11->fpreg[fn].fDouble[1];
mem[1] = fpa11->fpreg[fn].fDouble[0];
mem[2] = 0;
- supply_register (F0_REGNUM + fn, (char *) &mem[0]);
+ supply_register (ARM_F0_REGNUM + fn, (char *) &mem[0]);
}
static void
@@ -120,7 +120,7 @@ fetch_nwfpe_none (unsigned int fn)
unsigned int mem[3] =
{0, 0, 0};
- supply_register (F0_REGNUM + fn, (char *) &mem[0]);
+ supply_register (ARM_F0_REGNUM + fn, (char *) &mem[0]);
}
static void
@@ -131,13 +131,13 @@ fetch_nwfpe_extended (unsigned int fn, FPA11 * fpa11)
mem[0] = fpa11->fpreg[fn].fExtended[0]; /* sign & exponent */
mem[1] = fpa11->fpreg[fn].fExtended[2]; /* ls bits */
mem[2] = fpa11->fpreg[fn].fExtended[1]; /* ms bits */
- supply_register (F0_REGNUM + fn, (char *) &mem[0]);
+ supply_register (ARM_F0_REGNUM + fn, (char *) &mem[0]);
}
static void
fetch_nwfpe_register (int regno, FPA11 * fpa11)
{
- int fn = regno - F0_REGNUM;
+ int fn = regno - ARM_F0_REGNUM;
switch (fpa11->fType[fn])
{
@@ -163,7 +163,7 @@ store_nwfpe_single (unsigned int fn, FPA11 * fpa11)
{
unsigned int mem[3];
- read_register_gen (F0_REGNUM + fn, (char *) &mem[0]);
+ read_register_gen (ARM_F0_REGNUM + fn, (char *) &mem[0]);
fpa11->fpreg[fn].fSingle = mem[0];
fpa11->fType[fn] = typeSingle;
}
@@ -173,7 +173,7 @@ store_nwfpe_double (unsigned int fn, FPA11 * fpa11)
{
unsigned int mem[3];
- read_register_gen (F0_REGNUM + fn, (char *) &mem[0]);
+ read_register_gen (ARM_F0_REGNUM + fn, (char *) &mem[0]);
fpa11->fpreg[fn].fDouble[1] = mem[0];
fpa11->fpreg[fn].fDouble[0] = mem[1];
fpa11->fType[fn] = typeDouble;
@@ -184,7 +184,7 @@ store_nwfpe_extended (unsigned int fn, FPA11 * fpa11)
{
unsigned int mem[3];
- read_register_gen (F0_REGNUM + fn, (char *) &mem[0]);
+ read_register_gen (ARM_F0_REGNUM + fn, (char *) &mem[0]);
fpa11->fpreg[fn].fExtended[0] = mem[0]; /* sign & exponent */
fpa11->fpreg[fn].fExtended[2] = mem[1]; /* ls bits */
fpa11->fpreg[fn].fExtended[1] = mem[2]; /* ms bits */
@@ -196,7 +196,7 @@ store_nwfpe_register (int regno, FPA11 * fpa11)
{
if (register_cached (regno))
{
- unsigned int fn = regno - F0_REGNUM;
+ unsigned int fn = regno - ARM_F0_REGNUM;
switch (fpa11->fType[fn])
{
case typeSingle:
@@ -236,13 +236,13 @@ fetch_fpregister (int regno)
}
/* Fetch fpsr. */
- if (FPS_REGNUM == regno)
- supply_register (FPS_REGNUM, (char *) &fp.fpsr);
+ if (ARM_FPS_REGNUM == regno)
+ supply_register (ARM_FPS_REGNUM, (char *) &fp.fpsr);
/* Fetch the floating point register. */
- if (regno >= F0_REGNUM && regno <= F7_REGNUM)
+ if (regno >= ARM_F0_REGNUM && regno <= ARM_F7_REGNUM)
{
- int fn = regno - F0_REGNUM;
+ int fn = regno - ARM_F0_REGNUM;
switch (fp.fType[fn])
{
@@ -285,12 +285,12 @@ fetch_fpregs (void)
}
/* Fetch fpsr. */
- supply_register (FPS_REGNUM, (char *) &fp.fpsr);
+ supply_register (ARM_FPS_REGNUM, (char *) &fp.fpsr);
/* Fetch the floating point registers. */
- for (regno = F0_REGNUM; regno <= F7_REGNUM; regno++)
+ for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
{
- int fn = regno - F0_REGNUM;
+ int fn = regno - ARM_F0_REGNUM;
switch (fp.fType[fn])
{
@@ -333,11 +333,11 @@ store_fpregister (int regno)
}
/* Store fpsr. */
- if (FPS_REGNUM == regno && register_cached (FPS_REGNUM))
- read_register_gen (FPS_REGNUM, (char *) &fp.fpsr);
+ if (ARM_FPS_REGNUM == regno && register_cached (ARM_FPS_REGNUM))
+ read_register_gen (ARM_FPS_REGNUM, (char *) &fp.fpsr);
/* Store the floating point register. */
- if (regno >= F0_REGNUM && regno <= F7_REGNUM)
+ if (regno >= ARM_F0_REGNUM && regno <= ARM_F7_REGNUM)
{
store_nwfpe_register (regno, &fp);
}
@@ -371,11 +371,11 @@ store_fpregs (void)
}
/* Store fpsr. */
- if (register_cached (FPS_REGNUM))
- read_register_gen (FPS_REGNUM, (char *) &fp.fpsr);
+ if (register_cached (ARM_FPS_REGNUM))
+ read_register_gen (ARM_FPS_REGNUM, (char *) &fp.fpsr);
/* Store the floating point registers. */
- for (regno = F0_REGNUM; regno <= F7_REGNUM; regno++)
+ for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
{
fetch_nwfpe_register (regno, &fp);
}
@@ -407,21 +407,21 @@ fetch_register (int regno)
return;
}
- if (regno >= A1_REGNUM && regno < PC_REGNUM)
+ if (regno >= ARM_A1_REGNUM && regno < ARM_PC_REGNUM)
supply_register (regno, (char *) &regs[regno]);
- if (PS_REGNUM == regno)
+ if (ARM_PS_REGNUM == regno)
{
if (arm_apcs_32)
- supply_register (PS_REGNUM, (char *) &regs[CPSR_REGNUM]);
+ supply_register (ARM_PS_REGNUM, (char *) &regs[ARM_CPSR_REGNUM]);
else
- supply_register (PS_REGNUM, (char *) &regs[PC_REGNUM]);
+ supply_register (ARM_PS_REGNUM, (char *) &regs[ARM_PC_REGNUM]);
}
- if (PC_REGNUM == regno)
+ if (ARM_PC_REGNUM == regno)
{
- regs[PC_REGNUM] = ADDR_BITS_REMOVE (regs[PC_REGNUM]);
- supply_register (PC_REGNUM, (char *) &regs[PC_REGNUM]);
+ regs[ARM_PC_REGNUM] = ADDR_BITS_REMOVE (regs[ARM_PC_REGNUM]);
+ supply_register (ARM_PC_REGNUM, (char *) &regs[ARM_PC_REGNUM]);
}
}
@@ -444,16 +444,16 @@ fetch_regs (void)
return;
}
- for (regno = A1_REGNUM; regno < PC_REGNUM; regno++)
+ for (regno = ARM_A1_REGNUM; regno < ARM_PC_REGNUM; regno++)
supply_register (regno, (char *) &regs[regno]);
if (arm_apcs_32)
- supply_register (PS_REGNUM, (char *) &regs[CPSR_REGNUM]);
+ supply_register (ARM_PS_REGNUM, (char *) &regs[ARM_CPSR_REGNUM]);
else
- supply_register (PS_REGNUM, (char *) &regs[PC_REGNUM]);
+ supply_register (ARM_PS_REGNUM, (char *) &regs[ARM_PC_REGNUM]);
- regs[PC_REGNUM] = ADDR_BITS_REMOVE (regs[PC_REGNUM]);
- supply_register (PC_REGNUM, (char *) &regs[PC_REGNUM]);
+ regs[ARM_PC_REGNUM] = ADDR_BITS_REMOVE (regs[ARM_PC_REGNUM]);
+ supply_register (ARM_PC_REGNUM, (char *) &regs[ARM_PC_REGNUM]);
}
/* Store all general registers of the process from the values in
@@ -479,7 +479,7 @@ store_register (int regno)
return;
}
- if (regno >= A1_REGNUM && regno <= PC_REGNUM)
+ if (regno >= ARM_A1_REGNUM && regno <= ARM_PC_REGNUM)
read_register_gen (regno, (char *) &regs[regno]);
ret = ptrace (PTRACE_SETREGS, tid, 0, &regs);
@@ -507,7 +507,7 @@ store_regs (void)
return;
}
- for (regno = A1_REGNUM; regno <= PC_REGNUM; regno++)
+ for (regno = ARM_A1_REGNUM; regno <= ARM_PC_REGNUM; regno++)
{
if (register_cached (regno))
read_register_gen (regno, (char *) &regs[regno]);
@@ -536,10 +536,10 @@ fetch_inferior_registers (int regno)
}
else
{
- if (regno < F0_REGNUM || regno > FPS_REGNUM)
+ if (regno < ARM_F0_REGNUM || regno > ARM_FPS_REGNUM)
fetch_register (regno);
- if (regno >= F0_REGNUM && regno <= FPS_REGNUM)
+ if (regno >= ARM_F0_REGNUM && regno <= ARM_FPS_REGNUM)
fetch_fpregister (regno);
}
}
@@ -558,10 +558,10 @@ store_inferior_registers (int regno)
}
else
{
- if ((regno < F0_REGNUM) || (regno > FPS_REGNUM))
+ if ((regno < ARM_F0_REGNUM) || (regno > ARM_FPS_REGNUM))
store_register (regno);
- if ((regno >= F0_REGNUM) && (regno <= FPS_REGNUM))
+ if ((regno >= ARM_F0_REGNUM) && (regno <= ARM_FPS_REGNUM))
store_fpregister (regno);
}
}
@@ -576,18 +576,20 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
if (-1 == regno)
{
int regnum;
- for (regnum = A1_REGNUM; regnum <= PC_REGNUM; regnum++)
+ for (regnum = ARM_A1_REGNUM; regnum <= ARM_PC_REGNUM; regnum++)
read_register_gen (regnum, (char *) &(*gregsetp)[regnum]);
}
- else if (regno >= A1_REGNUM && regno <= PC_REGNUM)
+ else if (regno >= ARM_A1_REGNUM && regno <= ARM_PC_REGNUM)
read_register_gen (regno, (char *) &(*gregsetp)[regno]);
- if (PS_REGNUM == regno || -1 == regno)
+ if (ARM_PS_REGNUM == regno || -1 == regno)
{
if (arm_apcs_32)
- read_register_gen (PS_REGNUM, (char *) &(*gregsetp)[CPSR_REGNUM]);
+ read_register_gen (ARM_PS_REGNUM,
+ (char *) &(*gregsetp)[ARM_CPSR_REGNUM]);
else
- read_register_gen (PC_REGNUM, (char *) &(*gregsetp)[PC_REGNUM]);
+ read_register_gen (ARM_PC_REGNUM,
+ (char *) &(*gregsetp)[ARM_PC_REGNUM]);
}
}
@@ -599,16 +601,16 @@ supply_gregset (gdb_gregset_t *gregsetp)
{
int regno, reg_pc;
- for (regno = A1_REGNUM; regno < PC_REGNUM; regno++)
+ for (regno = ARM_A1_REGNUM; regno < ARM_PC_REGNUM; regno++)
supply_register (regno, (char *) &(*gregsetp)[regno]);
if (arm_apcs_32)
- supply_register (PS_REGNUM, (char *) &(*gregsetp)[CPSR_REGNUM]);
+ supply_register (ARM_PS_REGNUM, (char *) &(*gregsetp)[ARM_CPSR_REGNUM]);
else
- supply_register (PS_REGNUM, (char *) &(*gregsetp)[PC_REGNUM]);
+ supply_register (ARM_PS_REGNUM, (char *) &(*gregsetp)[ARM_PC_REGNUM]);
- reg_pc = ADDR_BITS_REMOVE ((CORE_ADDR)(*gregsetp)[PC_REGNUM]);
- supply_register (PC_REGNUM, (char *) &reg_pc);
+ reg_pc = ADDR_BITS_REMOVE ((CORE_ADDR)(*gregsetp)[ARM_PC_REGNUM]);
+ supply_register (ARM_PC_REGNUM, (char *) &reg_pc);
}
/* Fill register regno (if it is a floating-point register) in
@@ -623,18 +625,18 @@ fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
if (-1 == regno)
{
int regnum;
- for (regnum = F0_REGNUM; regnum <= F7_REGNUM; regnum++)
+ for (regnum = ARM_F0_REGNUM; regnum <= ARM_F7_REGNUM; regnum++)
store_nwfpe_register (regnum, fp);
}
- else if (regno >= F0_REGNUM && regno <= F7_REGNUM)
+ else if (regno >= ARM_F0_REGNUM && regno <= ARM_F7_REGNUM)
{
store_nwfpe_register (regno, fp);
return;
}
/* Store fpsr. */
- if (FPS_REGNUM == regno || -1 == regno)
- read_register_gen (FPS_REGNUM, (char *) &fp->fpsr);
+ if (ARM_FPS_REGNUM == regno || -1 == regno)
+ read_register_gen (ARM_FPS_REGNUM, (char *) &fp->fpsr);
}
/* Fill GDB's register array with the floating-point register values
@@ -647,10 +649,10 @@ supply_fpregset (gdb_fpregset_t *fpregsetp)
FPA11 *fp = (FPA11 *) fpregsetp;
/* Fetch fpsr. */
- supply_register (FPS_REGNUM, (char *) &fp->fpsr);
+ supply_register (ARM_FPS_REGNUM, (char *) &fp->fpsr);
/* Fetch the floating point registers. */
- for (regno = F0_REGNUM; regno <= F7_REGNUM; regno++)
+ for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
{
fetch_nwfpe_register (regno, fp);
}