2015-07-30 22:07:38 +08:00
|
|
|
/* Common target dependent code for GDB on ARM systems.
|
2019-01-01 14:01:51 +08:00
|
|
|
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
2015-07-30 22:07:38 +08:00
|
|
|
|
|
|
|
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 3 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, see <http://www.gnu.org/licenses/>. */
|
|
|
|
|
2019-01-28 03:51:36 +08:00
|
|
|
#ifndef ARCH_ARM_H
|
|
|
|
#define ARCH_ARM_H
|
2015-07-30 22:07:38 +08:00
|
|
|
|
2019-07-19 21:59:10 +08:00
|
|
|
#include "gdbsupport/tdesc.h"
|
|
|
|
|
2015-07-30 22:07:38 +08:00
|
|
|
/* Register numbers of various important registers. */
|
|
|
|
|
|
|
|
enum gdb_regnum {
|
|
|
|
ARM_A1_REGNUM = 0, /* first integer-like argument */
|
|
|
|
ARM_A4_REGNUM = 3, /* last integer-like argument */
|
|
|
|
ARM_AP_REGNUM = 11,
|
|
|
|
ARM_IP_REGNUM = 12,
|
|
|
|
ARM_SP_REGNUM = 13, /* Contains address of top of stack */
|
|
|
|
ARM_LR_REGNUM = 14, /* address to return to from a function call */
|
|
|
|
ARM_PC_REGNUM = 15, /* Contains program counter */
|
|
|
|
ARM_F0_REGNUM = 16, /* first floating point register */
|
|
|
|
ARM_F3_REGNUM = 19, /* last floating point argument register */
|
|
|
|
ARM_F7_REGNUM = 23, /* last floating point register */
|
|
|
|
ARM_FPS_REGNUM = 24, /* floating point status register */
|
|
|
|
ARM_PS_REGNUM = 25, /* Contains processor status */
|
|
|
|
ARM_WR0_REGNUM, /* WMMX data registers. */
|
|
|
|
ARM_WR15_REGNUM = ARM_WR0_REGNUM + 15,
|
|
|
|
ARM_WC0_REGNUM, /* WMMX control registers. */
|
|
|
|
ARM_WCSSF_REGNUM = ARM_WC0_REGNUM + 2,
|
|
|
|
ARM_WCASF_REGNUM = ARM_WC0_REGNUM + 3,
|
|
|
|
ARM_WC7_REGNUM = ARM_WC0_REGNUM + 7,
|
|
|
|
ARM_WCGR0_REGNUM, /* WMMX general purpose registers. */
|
|
|
|
ARM_WCGR3_REGNUM = ARM_WCGR0_REGNUM + 3,
|
|
|
|
ARM_WCGR7_REGNUM = ARM_WCGR0_REGNUM + 7,
|
|
|
|
ARM_D0_REGNUM, /* VFP double-precision registers. */
|
|
|
|
ARM_D31_REGNUM = ARM_D0_REGNUM + 31,
|
|
|
|
ARM_FPSCR_REGNUM,
|
|
|
|
|
|
|
|
ARM_NUM_REGS,
|
|
|
|
|
|
|
|
/* Other useful registers. */
|
|
|
|
ARM_FP_REGNUM = 11, /* Frame register in ARM code, if used. */
|
|
|
|
THUMB_FP_REGNUM = 7, /* Frame register in Thumb code, if used. */
|
|
|
|
ARM_NUM_ARG_REGS = 4,
|
|
|
|
ARM_LAST_ARG_REGNUM = ARM_A4_REGNUM,
|
|
|
|
ARM_NUM_FP_ARG_REGS = 4,
|
|
|
|
ARM_LAST_FP_ARG_REGNUM = ARM_F3_REGNUM
|
|
|
|
};
|
|
|
|
|
2016-10-10 18:11:25 +08:00
|
|
|
/* Enum describing the different kinds of breakpoints. */
|
|
|
|
enum arm_breakpoint_kinds
|
|
|
|
{
|
|
|
|
ARM_BP_KIND_THUMB = 2,
|
|
|
|
ARM_BP_KIND_THUMB2 = 3,
|
|
|
|
ARM_BP_KIND_ARM = 4,
|
|
|
|
};
|
|
|
|
|
2019-07-19 21:59:10 +08:00
|
|
|
/* Supported Arm FP hardware types. */
|
|
|
|
enum arm_fp_type {
|
|
|
|
ARM_FP_TYPE_NONE = 0,
|
|
|
|
ARM_FP_TYPE_VFPV2,
|
|
|
|
ARM_FP_TYPE_VFPV3,
|
|
|
|
ARM_FP_TYPE_IWMMXT,
|
|
|
|
ARM_FP_TYPE_INVALID
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Supported M-profile Arm types. */
|
|
|
|
enum arm_m_profile_type {
|
|
|
|
ARM_M_TYPE_M_PROFILE,
|
|
|
|
ARM_M_TYPE_VFP_D16,
|
|
|
|
ARM_M_TYPE_WITH_FPA,
|
|
|
|
ARM_M_TYPE_INVALID
|
|
|
|
};
|
|
|
|
|
2015-12-19 00:33:58 +08:00
|
|
|
/* Instruction condition field values. */
|
|
|
|
#define INST_EQ 0x0
|
|
|
|
#define INST_NE 0x1
|
|
|
|
#define INST_CS 0x2
|
|
|
|
#define INST_CC 0x3
|
|
|
|
#define INST_MI 0x4
|
|
|
|
#define INST_PL 0x5
|
|
|
|
#define INST_VS 0x6
|
|
|
|
#define INST_VC 0x7
|
|
|
|
#define INST_HI 0x8
|
|
|
|
#define INST_LS 0x9
|
|
|
|
#define INST_GE 0xa
|
|
|
|
#define INST_LT 0xb
|
|
|
|
#define INST_GT 0xc
|
|
|
|
#define INST_LE 0xd
|
|
|
|
#define INST_AL 0xe
|
|
|
|
#define INST_NV 0xf
|
|
|
|
|
|
|
|
#define FLAG_N 0x80000000
|
|
|
|
#define FLAG_Z 0x40000000
|
|
|
|
#define FLAG_C 0x20000000
|
|
|
|
#define FLAG_V 0x10000000
|
|
|
|
|
|
|
|
#define CPSR_T 0x20
|
|
|
|
|
|
|
|
#define XPSR_T 0x01000000
|
|
|
|
|
Arm: Prefix register sizes with ARM_
Add ARM_ to the front of INT_REGISTER_SIZE, FP_REGISTER_SIZE and
ARM_VFP_REGISTER_SIZE to make it obvious they are for the Arm target.
Move the defines to arch/arm.h
No functionality changes.
gdb/ChangeLog:
* arch/arm-get-next-pcs.c (thumb_get_next_pcs_raw): Use ARM_
defines.
* arch/arm-linux.c (arm_linux_sigreturn_next_pc_offset): Likewise.
* arch/arm.h (INT_REGISTER_SIZE) Rename from...
(ARM_INT_REGISTER_SIZE): ...to this.
(ARM_FP_REGISTER_SIZE) (ARM_VFP_REGISTER_SIZE): Add define.
* arm-linux-tdep.c (ARM_LINUX_JB_ELEMENT_SIZE)
(ARM_LINUX_SIZEOF_GREGSET, arm_linux_supply_gregset)
(arm_linux_collect_gregset, supply_nwfpe_register)
(collect_nwfpe_register, arm_linux_collect_nwfpe): Use ARM_
defines.
* arm-linux-tdep.h (ARM_LINUX_SIZEOF_NWFPE, NWFPE_FPSR_OFFSET)
(NWFPE_FPCR_OFFSET, NWFPE_TAGS_OFFSET): Likewise
* arm-nbsd-tdep.c (ARM_NBSD_JB_ELEMENT_SIZE): Likewise.
* arm-tdep.c (arm_push_dummy_call, arm_extract_return_value)
(arm_return_in_memory, arm_store_return_value)
(arm_get_longjmp_target, arm_register_g_packet_guesses)
(arm_record_ld_st_multiple): Likewise.
* arm-tdep.h (FP_REGISTER_SIZE, VFP_REGISTER_SIZE): Remove.
* arm-wince-tdep.c (ARM_WINCE_JB_ELEMENT_SIZE): Use ARM_ defines.
2019-06-26 17:12:13 +08:00
|
|
|
/* Size of registers. */
|
|
|
|
|
|
|
|
#define ARM_INT_REGISTER_SIZE 4
|
|
|
|
/* IEEE extended doubles are 80 bits. DWORD aligned they use 96 bits. */
|
|
|
|
#define ARM_FP_REGISTER_SIZE 12
|
|
|
|
#define ARM_VFP_REGISTER_SIZE 8
|
2019-06-25 18:02:32 +08:00
|
|
|
#define IWMMXT_VEC_REGISTER_SIZE 8
|
|
|
|
|
|
|
|
/* Size of register sets. */
|
|
|
|
|
|
|
|
/* r0-r12,sp,lr,pc,cpsr. */
|
|
|
|
#define ARM_CORE_REGS_SIZE (17 * ARM_INT_REGISTER_SIZE)
|
|
|
|
/* f0-f8,fps. */
|
|
|
|
#define ARM_FP_REGS_SIZE (8 * ARM_FP_REGISTER_SIZE + ARM_INT_REGISTER_SIZE)
|
|
|
|
/* d0-d15,fpscr. */
|
|
|
|
#define ARM_VFP2_REGS_SIZE (16 * ARM_VFP_REGISTER_SIZE + ARM_INT_REGISTER_SIZE)
|
|
|
|
/* d0-d31,fpscr. */
|
|
|
|
#define ARM_VFP3_REGS_SIZE (32 * ARM_VFP_REGISTER_SIZE + ARM_INT_REGISTER_SIZE)
|
|
|
|
/* wR0-wR15,fpscr. */
|
|
|
|
#define IWMMXT_REGS_SIZE (16 * IWMMXT_VEC_REGISTER_SIZE \
|
|
|
|
+ 6 * ARM_INT_REGISTER_SIZE)
|
2015-12-19 00:33:58 +08:00
|
|
|
|
2015-10-21 23:13:41 +08:00
|
|
|
/* Addresses for calling Thumb functions have the bit 0 set.
|
|
|
|
Here are some macros to test, set, or clear bit 0 of addresses. */
|
|
|
|
#define IS_THUMB_ADDR(addr) ((addr) & 1)
|
|
|
|
#define MAKE_THUMB_ADDR(addr) ((addr) | 1)
|
|
|
|
#define UNMAKE_THUMB_ADDR(addr) ((addr) & ~1)
|
|
|
|
|
Support software single step on ARM in GDBServer
This patch teaches GDBServer how to software single step on ARM
linux by sharing code with GDB.
The arm_get_next_pcs function in GDB is now shared with GDBServer. So
that GDBServer can use the function to return the possible addresses of
the next PC.
A proper shared context was also needed so that we could share the code,
this context is described in the arm_get_next_pcs structure.
Testing :
No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }
gdb/ChangeLog:
* Makefile.in (ALL_TARGET_OBS): Append arm-get-next-pcs.o,
arm-linux.o.
(ALLDEPFILES): Append arm-get-next-pcs.c, arm-linux.c
(arm-linux.o): New rule.
(arm-get-next-pcs.o): New rule.
* arch/arm-get-next-pcs.c: New file.
* arch/arm-get-next-pcs.h: New file.
* arch/arm-linux.h: New file.
* arch/arm-linux.c: New file.
* arm.c: Include common-regcache.c.
(thumb_advance_itstate): Moved from arm-tdep.c.
(arm_instruction_changes_pc): Likewise.
(thumb_instruction_changes_pc): Likewise.
(thumb2_instruction_changes_pc): Likewise.
(shifted_reg_val): Likewise.
* arm.h (submask): Move macro from arm-tdep.h
(bit): Likewise.
(bits): Likewise.
(sbits): Likewise.
(BranchDest): Likewise.
(thumb_advance_itstate): Moved declaration from arm-tdep.h
(arm_instruction_changes_pc): Likewise.
(thumb_instruction_changes_pc): Likewise.
(thumb2_instruction_changes_pc): Likewise.
(shifted_reg_val): Likewise.
* arm-linux-tdep.c: Include arch/arm.h, arch/arm-get-next-pcs.h
arch/arm-linux.h.
(arm_linux_get_next_pcs_ops): New struct.
(ARM_SIGCONTEXT_R0, ARM_UCONTEXT_SIGCONTEXT,
ARM_OLD_RT_SIGFRAME_SIGINFO, ARM_OLD_RT_SIGFRAME_UCONTEXT,
ARM_NEW_RT_SIGFRAME_UCONTEXT, ARM_NEW_SIGFRAME_MAGIC): Move stack
layout defines to arch/arm-linux.h.
(arm_linux_sigreturn_next_pc_offset): Move to arch/arm-linux.c.
(arm_linux_software_single_step): Adjust for arm_get_next_pcs
implementation.
* arm-tdep.c: Include arch/arm-get-next-pcs.h.
(arm_get_next_pcs_ops): New struct.
(submask): Move macro to arm.h.
(bit): Likewise.
(bits): Likewise.
(sbits): Likewise.
(BranchDest): Likewise.
(thumb_instruction_changes_pc): Move to arm.c
(thumb2_instruction_changes_pc): Likewise.
(arm_instruction_changes_pc): Likewise.
(shifted_reg_val): Likewise.
(thumb_advance_itstate): Likewise.
(thumb_get_next_pc_raw): Move to arm-get-next-pcs.c.
(arm_get_next_pc_raw): Likewise.
(arm_get_next_pc): Likewise.
(thumb_deal_with_atomic_sequence_raw): Likewise.
(arm_deal_with_atomic_sequence_raw): Likewise.
(arm_deal_with_atomic_sequence): Likewise.
(arm_get_next_pcs_read_memory_unsigned_integer): New function.
(arm_get_next_pcs_addr_bits_remove): Likewise.
(arm_get_next_pcs_syscall_next_pc): Likewise.
(arm_get_next_pcs_is_thumb): Likewise.
(arm_software_single_step): Adjust for arm_get_next_pcs
implementation.
* arm-tdep.h: (arm_get_next_pc): Remove declaration.
(arm_get_next_pcs_read_memory_unsigned_integer):
New declaration.
(arm_get_next_pcs_addr_bits_remove): Likewise.
(arm_get_next_pcs_syscall_next_pc): Likewise.
(arm_get_next_pcs_is_thumb): Likewise.
(arm_deal_with_atomic_sequence: Remove declaration.
* common/gdb_vecs.h: Add CORE_ADDR vector definition.
* configure.tgt (aarch64*-*-linux): Add arm-get-next-pcs.o,
arm-linux.o.
(arm*-wince-pe): Add arm-get-next-pcs.o.
(arm*-*-linux*): Add arm-get-next-pcs.o, arm-linux.o,
arm-get-next-pcs.o
(arm*-*-netbsd*,arm*-*-knetbsd*-gnu): Add arm-get-next-pcs.o.
(arm*-*-openbsd*): Likewise.
(arm*-*-symbianelf*): Likewise.
(arm*-*-*): Likewise.
* symtab.h: Move CORE_ADDR vector definition to gdb_vecs.h.
gdb/gdbserver/ChangeLog:
* Makefile.in (SFILES): Append arch/arm-linux.c,
arch/arm-get-next-pcs.c.
(arm-linux.o): New rule.
(arm-get-next-pcs.o): New rule.
* configure.srv (arm*-*-linux*): Add arm-get-next-pcs.o,
arm-linux.o.
* linux-aarch32-low.c (arm_abi_breakpoint): Remove macro. Moved
to linux-aarch32-low.c.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint): Likewise.
(thumb_breakpoint_len, thumb2_breakpoint): Likewise.
(thumb2_breakpoint_len): Likewise.
(arm_is_thumb_mode): Make non-static.
* linux-aarch32-low.h (arm_abi_breakpoint): New macro. Moved
from linux-aarch32-low.c.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint): Likewise.
(thumb_breakpoint_len, thumb2_breakpoint): Likewise.
(thumb2_breakpoint_len): Likewise.
(arm_is_thumb_mode): New declaration.
* linux-arm-low.c: Include arch/arm-linux.h
aarch/arm-get-next-pcs.h, sys/syscall.h.
(get_next_pcs_ops): New struct.
(get_next_pcs_addr_bits_remove): New function.
(get_next_pcs_is_thumb): New function.
(get_next_pcs_read_memory_unsigned_integer): Likewise.
(arm_sigreturn_next_pc): Likewise.
(get_next_pcs_syscall_next_pc): Likewise.
(arm_gdbserver_get_next_pcs): Likewise.
(struct linux_target_ops) <arm_gdbserver_get_next_pcs>:
Initialize.
* linux-low.h: Move CORE_ADDR vector definition to gdb_vecs.h.
* server.h: Include gdb_vecs.h.
2015-12-19 00:33:59 +08:00
|
|
|
/* Support routines for instruction parsing. */
|
|
|
|
#define submask(x) ((1L << ((x) + 1)) - 1)
|
|
|
|
#define bits(obj,st,fn) (((obj) >> (st)) & submask ((fn) - (st)))
|
|
|
|
#define bit(obj,st) (((obj) >> (st)) & 1)
|
|
|
|
#define sbits(obj,st,fn) \
|
|
|
|
((long) (bits(obj,st,fn) | ((long) bit(obj,fn) * ~ submask (fn - st))))
|
|
|
|
#define BranchDest(addr,instr) \
|
|
|
|
((CORE_ADDR) (((unsigned long) (addr)) + 8 + (sbits (instr, 0, 23) << 2)))
|
|
|
|
|
|
|
|
/* Forward declaration. */
|
|
|
|
struct regcache;
|
|
|
|
|
2015-10-21 23:13:41 +08:00
|
|
|
/* Return the size in bytes of the complete Thumb instruction whose
|
|
|
|
first halfword is INST1. */
|
|
|
|
int thumb_insn_size (unsigned short inst1);
|
|
|
|
|
2015-12-19 00:33:58 +08:00
|
|
|
/* Returns true if the condition evaluates to true. */
|
|
|
|
int condition_true (unsigned long cond, unsigned long status_reg);
|
|
|
|
|
|
|
|
/* Return number of 1-bits in VAL. */
|
|
|
|
int bitcount (unsigned long val);
|
|
|
|
|
Support software single step on ARM in GDBServer
This patch teaches GDBServer how to software single step on ARM
linux by sharing code with GDB.
The arm_get_next_pcs function in GDB is now shared with GDBServer. So
that GDBServer can use the function to return the possible addresses of
the next PC.
A proper shared context was also needed so that we could share the code,
this context is described in the arm_get_next_pcs structure.
Testing :
No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }
gdb/ChangeLog:
* Makefile.in (ALL_TARGET_OBS): Append arm-get-next-pcs.o,
arm-linux.o.
(ALLDEPFILES): Append arm-get-next-pcs.c, arm-linux.c
(arm-linux.o): New rule.
(arm-get-next-pcs.o): New rule.
* arch/arm-get-next-pcs.c: New file.
* arch/arm-get-next-pcs.h: New file.
* arch/arm-linux.h: New file.
* arch/arm-linux.c: New file.
* arm.c: Include common-regcache.c.
(thumb_advance_itstate): Moved from arm-tdep.c.
(arm_instruction_changes_pc): Likewise.
(thumb_instruction_changes_pc): Likewise.
(thumb2_instruction_changes_pc): Likewise.
(shifted_reg_val): Likewise.
* arm.h (submask): Move macro from arm-tdep.h
(bit): Likewise.
(bits): Likewise.
(sbits): Likewise.
(BranchDest): Likewise.
(thumb_advance_itstate): Moved declaration from arm-tdep.h
(arm_instruction_changes_pc): Likewise.
(thumb_instruction_changes_pc): Likewise.
(thumb2_instruction_changes_pc): Likewise.
(shifted_reg_val): Likewise.
* arm-linux-tdep.c: Include arch/arm.h, arch/arm-get-next-pcs.h
arch/arm-linux.h.
(arm_linux_get_next_pcs_ops): New struct.
(ARM_SIGCONTEXT_R0, ARM_UCONTEXT_SIGCONTEXT,
ARM_OLD_RT_SIGFRAME_SIGINFO, ARM_OLD_RT_SIGFRAME_UCONTEXT,
ARM_NEW_RT_SIGFRAME_UCONTEXT, ARM_NEW_SIGFRAME_MAGIC): Move stack
layout defines to arch/arm-linux.h.
(arm_linux_sigreturn_next_pc_offset): Move to arch/arm-linux.c.
(arm_linux_software_single_step): Adjust for arm_get_next_pcs
implementation.
* arm-tdep.c: Include arch/arm-get-next-pcs.h.
(arm_get_next_pcs_ops): New struct.
(submask): Move macro to arm.h.
(bit): Likewise.
(bits): Likewise.
(sbits): Likewise.
(BranchDest): Likewise.
(thumb_instruction_changes_pc): Move to arm.c
(thumb2_instruction_changes_pc): Likewise.
(arm_instruction_changes_pc): Likewise.
(shifted_reg_val): Likewise.
(thumb_advance_itstate): Likewise.
(thumb_get_next_pc_raw): Move to arm-get-next-pcs.c.
(arm_get_next_pc_raw): Likewise.
(arm_get_next_pc): Likewise.
(thumb_deal_with_atomic_sequence_raw): Likewise.
(arm_deal_with_atomic_sequence_raw): Likewise.
(arm_deal_with_atomic_sequence): Likewise.
(arm_get_next_pcs_read_memory_unsigned_integer): New function.
(arm_get_next_pcs_addr_bits_remove): Likewise.
(arm_get_next_pcs_syscall_next_pc): Likewise.
(arm_get_next_pcs_is_thumb): Likewise.
(arm_software_single_step): Adjust for arm_get_next_pcs
implementation.
* arm-tdep.h: (arm_get_next_pc): Remove declaration.
(arm_get_next_pcs_read_memory_unsigned_integer):
New declaration.
(arm_get_next_pcs_addr_bits_remove): Likewise.
(arm_get_next_pcs_syscall_next_pc): Likewise.
(arm_get_next_pcs_is_thumb): Likewise.
(arm_deal_with_atomic_sequence: Remove declaration.
* common/gdb_vecs.h: Add CORE_ADDR vector definition.
* configure.tgt (aarch64*-*-linux): Add arm-get-next-pcs.o,
arm-linux.o.
(arm*-wince-pe): Add arm-get-next-pcs.o.
(arm*-*-linux*): Add arm-get-next-pcs.o, arm-linux.o,
arm-get-next-pcs.o
(arm*-*-netbsd*,arm*-*-knetbsd*-gnu): Add arm-get-next-pcs.o.
(arm*-*-openbsd*): Likewise.
(arm*-*-symbianelf*): Likewise.
(arm*-*-*): Likewise.
* symtab.h: Move CORE_ADDR vector definition to gdb_vecs.h.
gdb/gdbserver/ChangeLog:
* Makefile.in (SFILES): Append arch/arm-linux.c,
arch/arm-get-next-pcs.c.
(arm-linux.o): New rule.
(arm-get-next-pcs.o): New rule.
* configure.srv (arm*-*-linux*): Add arm-get-next-pcs.o,
arm-linux.o.
* linux-aarch32-low.c (arm_abi_breakpoint): Remove macro. Moved
to linux-aarch32-low.c.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint): Likewise.
(thumb_breakpoint_len, thumb2_breakpoint): Likewise.
(thumb2_breakpoint_len): Likewise.
(arm_is_thumb_mode): Make non-static.
* linux-aarch32-low.h (arm_abi_breakpoint): New macro. Moved
from linux-aarch32-low.c.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint): Likewise.
(thumb_breakpoint_len, thumb2_breakpoint): Likewise.
(thumb2_breakpoint_len): Likewise.
(arm_is_thumb_mode): New declaration.
* linux-arm-low.c: Include arch/arm-linux.h
aarch/arm-get-next-pcs.h, sys/syscall.h.
(get_next_pcs_ops): New struct.
(get_next_pcs_addr_bits_remove): New function.
(get_next_pcs_is_thumb): New function.
(get_next_pcs_read_memory_unsigned_integer): Likewise.
(arm_sigreturn_next_pc): Likewise.
(get_next_pcs_syscall_next_pc): Likewise.
(arm_gdbserver_get_next_pcs): Likewise.
(struct linux_target_ops) <arm_gdbserver_get_next_pcs>:
Initialize.
* linux-low.h: Move CORE_ADDR vector definition to gdb_vecs.h.
* server.h: Include gdb_vecs.h.
2015-12-19 00:33:59 +08:00
|
|
|
/* Return 1 if THIS_INSTR might change control flow, 0 otherwise. */
|
|
|
|
int arm_instruction_changes_pc (uint32_t this_instr);
|
|
|
|
|
|
|
|
/* Return 1 if the 16-bit Thumb instruction INST might change
|
|
|
|
control flow, 0 otherwise. */
|
|
|
|
int thumb_instruction_changes_pc (unsigned short inst);
|
|
|
|
|
|
|
|
/* Return 1 if the 32-bit Thumb instruction in INST1 and INST2
|
|
|
|
might change control flow, 0 otherwise. */
|
|
|
|
int thumb2_instruction_changes_pc (unsigned short inst1, unsigned short inst2);
|
|
|
|
|
|
|
|
/* Advance the state of the IT block and return that state. */
|
|
|
|
int thumb_advance_itstate (unsigned int itstate);
|
|
|
|
|
|
|
|
/* Decode shifted register value. */
|
|
|
|
|
|
|
|
unsigned long shifted_reg_val (struct regcache *regcache,
|
|
|
|
unsigned long inst,
|
|
|
|
int carry,
|
|
|
|
unsigned long pc_val,
|
|
|
|
unsigned long status_reg);
|
|
|
|
|
2019-07-19 21:59:10 +08:00
|
|
|
/* Create an Arm target description with the given FP hardware type. */
|
|
|
|
|
|
|
|
target_desc *arm_create_target_description (arm_fp_type fp_type);
|
|
|
|
|
|
|
|
/* Create an Arm M-profile target description with the given hardware type. */
|
|
|
|
|
|
|
|
target_desc *arm_create_mprofile_target_description (arm_m_profile_type m_type);
|
|
|
|
|
2019-01-28 03:51:36 +08:00
|
|
|
#endif /* ARCH_ARM_H */
|