forked from Imagelibrary/binutils-gdb
* 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.
97 lines
3.9 KiB
C
97 lines
3.9 KiB
C
/* Definitions to target GDB to ARM targets.
|
||
Copyright 1986, 1987, 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1997,
|
||
1998, 1999, 2000, 2001, 2002 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
|
||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||
Boston, MA 02111-1307, USA. */
|
||
|
||
#ifndef TM_ARM_H
|
||
#define TM_ARM_H
|
||
|
||
#ifndef GDB_MULTI_ARCH
|
||
#define GDB_MULTI_ARCH 1
|
||
#endif
|
||
|
||
#include "regcache.h"
|
||
#include "floatformat.h"
|
||
|
||
/* IEEE format floating point. */
|
||
#define TARGET_DOUBLE_FORMAT (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG \
|
||
? &floatformat_ieee_double_big \
|
||
: &floatformat_ieee_double_littlebyte_bigword)
|
||
|
||
/* The following define instruction sequences that will cause ARM
|
||
cpu's to take an undefined instruction trap. These are used to
|
||
signal a breakpoint to GDB.
|
||
|
||
The newer ARMv4T cpu's are capable of operating in ARM or Thumb
|
||
modes. A different instruction is required for each mode. The ARM
|
||
cpu's can also be big or little endian. Thus four different
|
||
instructions are needed to support all cases.
|
||
|
||
Note: ARMv4 defines several new instructions that will take the
|
||
undefined instruction trap. ARM7TDMI is nominally ARMv4T, but does
|
||
not in fact add the new instructions. The new undefined
|
||
instructions in ARMv4 are all instructions that had no defined
|
||
behaviour in earlier chips. There is no guarantee that they will
|
||
raise an exception, but may be treated as NOP's. In practice, it
|
||
may only safe to rely on instructions matching:
|
||
|
||
3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
|
||
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
|
||
C C C C 0 1 1 x x x x x x x x x x x x x x x x x x x x 1 x x x x
|
||
|
||
Even this may only true if the condition predicate is true. The
|
||
following use a condition predicate of ALWAYS so it is always TRUE.
|
||
|
||
There are other ways of forcing a breakpoint. ARM Linux, RISC iX,
|
||
and NetBSD will all use a software interrupt rather than an
|
||
undefined instruction to force a trap. This can be handled by
|
||
redefining some or all of the following in a target dependent
|
||
fashion. */
|
||
|
||
#define ARM_LE_BREAKPOINT {0xFE,0xDE,0xFF,0xE7}
|
||
#define ARM_BE_BREAKPOINT {0xE7,0xFF,0xDE,0xFE}
|
||
#define THUMB_LE_BREAKPOINT {0xfe,0xdf}
|
||
#define THUMB_BE_BREAKPOINT {0xdf,0xfe}
|
||
|
||
/* The system C compiler uses a similar structure return convention to gcc */
|
||
extern use_struct_convention_fn arm_use_struct_convention;
|
||
#define USE_STRUCT_CONVENTION(gcc_p, type) \
|
||
arm_use_struct_convention (gcc_p, type)
|
||
|
||
/* Extract from an array REGBUF containing the (raw) register state
|
||
the address in which a function should return its structure value,
|
||
as a CORE_ADDR (or an expression that can be used as one). */
|
||
|
||
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
|
||
(extract_address ((PTR)(REGBUF), REGISTER_RAW_SIZE(0)))
|
||
|
||
/* Specify that for the native compiler variables for a particular
|
||
lexical context are listed after the beginning LBRAC instead of
|
||
before in the executables list of symbols. */
|
||
#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (!(gcc_p))
|
||
|
||
/* XXX This is NOT multi-arch compatible. */
|
||
#define CALL_DUMMY_BREAKPOINT_OFFSET arm_call_dummy_breakpoint_offset()
|
||
extern int arm_call_dummy_breakpoint_offset (void);
|
||
|
||
/* The first 0x20 bytes are the trap vectors. */
|
||
#define LOWEST_PC 0x20
|
||
|
||
#endif /* TM_ARM_H */
|