GDBserver
Classes | Defines | Typedefs | Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/gdbserver/linux-arm-low.c File Reference
#include "server.h"
#include "linux-low.h"
#include <elf.h>
#include <sys/ptrace.h>
#include <signal.h>

Go to the source code of this file.

Classes

struct  arm_linux_hw_breakpoint
struct  arch_process_info
struct  arch_lwp_info
struct  update_registers_data

Defines

#define PTRACE_GET_THREAD_AREA   22
#define PTRACE_GETWMMXREGS   18
#define PTRACE_SETWMMXREGS   19
#define PTRACE_GETVFPREGS   27
#define PTRACE_SETVFPREGS   28
#define PTRACE_GETHBPREGS   29
#define PTRACE_SETHBPREGS   30
#define MAX_BPTS   32
#define MAX_WPTS   32
#define HWCAP_VFP   64
#define HWCAP_IWMMXT   512
#define HWCAP_NEON   4096
#define HWCAP_VFPv3   8192
#define HWCAP_VFPv3D16   16384
#define arm_num_regs   26
#define arm_breakpoint_len   4

Typedefs

typedef unsigned int arm_hwbp_control_t

Enumerations

enum  arm_hwbp_type { arm_hwbp_break = 0, arm_hwbp_load = 1, arm_hwbp_store = 2, arm_hwbp_access = 3 }

Functions

void init_registers_arm (void)
void init_registers_arm_with_iwmmxt (void)
void init_registers_arm_with_vfpv2 (void)
void init_registers_arm_with_vfpv3 (void)
void init_registers_arm_with_neon (void)
static int arm_cannot_store_register (int regno)
static int arm_cannot_fetch_register (int regno)
static void arm_fill_gregset (struct regcache *regcache, void *buf)
static void arm_store_gregset (struct regcache *regcache, const void *buf)
static void arm_fill_wmmxregset (struct regcache *regcache, void *buf)
static void arm_store_wmmxregset (struct regcache *regcache, const void *buf)
static void arm_fill_vfpregset (struct regcache *regcache, void *buf)
static void arm_store_vfpregset (struct regcache *regcache, const void *buf)
static CORE_ADDR arm_get_pc (struct regcache *regcache)
static void arm_set_pc (struct regcache *regcache, CORE_ADDR pc)
static int arm_breakpoint_at (CORE_ADDR where)
static CORE_ADDR arm_reinsert_addr (void)
ps_err_e ps_get_thread_area (const struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
static void arm_linux_init_hwbp_cap (int pid)
static int arm_linux_get_hw_breakpoint_count (void)
static int arm_linux_get_hw_watchpoint_count (void)
static int arm_linux_get_hw_watchpoint_max_length (void)
static arm_hwbp_control_t arm_hwbp_control_initialize (unsigned byte_address_select, arm_hwbp_type hwbp_type, int enable)
static int arm_hwbp_control_is_enabled (arm_hwbp_control_t control)
static int arm_hwbp_control_is_initialized (arm_hwbp_control_t control)
static arm_hwbp_control_t arm_hwbp_control_disable (arm_hwbp_control_t control)
static int arm_linux_hw_breakpoint_equal (const struct arm_linux_hw_breakpoint *p1, const struct arm_linux_hw_breakpoint *p2)
static int arm_linux_hw_point_initialize (char type, CORE_ADDR addr, int len, struct arm_linux_hw_breakpoint *p)
static int update_registers_callback (struct inferior_list_entry *entry, void *arg)
static int arm_insert_point (char type, CORE_ADDR addr, int len)
static int arm_remove_point (char type, CORE_ADDR addr, int len)
static int arm_stopped_by_watchpoint (void)
static CORE_ADDR arm_stopped_data_address (void)
static struct arch_process_infoarm_new_process (void)
static struct arch_lwp_infoarm_new_thread (void)
static void arm_prepare_to_resume (struct lwp_info *lwp)
static int arm_get_hwcap (unsigned long *valp)
static struct target_descarm_read_description (void)
static void arm_arch_setup (void)
static struct regs_infoarm_regs_info (void)
void initialize_low_arch (void)

Variables

struct target_desctdesc_arm
struct target_desctdesc_arm_with_iwmmxt
struct target_desctdesc_arm_with_vfpv2
struct target_desctdesc_arm_with_vfpv3
struct target_desctdesc_arm_with_neon
struct {
   unsigned char   arch
   unsigned char   max_wp_length
   unsigned char   wp_count
   unsigned char   bp_count
arm_linux_hwbp_cap
static unsigned long arm_hwcap
static int arm_regmap []
int debug_threads
static const unsigned long arm_breakpoint = 0xef9f0001
static const unsigned short thumb_breakpoint = 0xde01
static const unsigned short thumb2_breakpoint [] = { 0xf7f0, 0xa000 }
static const unsigned long arm_eabi_breakpoint = 0xe7f001f0
static struct regset_info arm_regsets []
static struct regsets_info arm_regsets_info
static struct usrregs_info arm_usrregs_info
static struct regs_info regs_info
struct linux_target_ops the_low_target

Define Documentation

#define arm_breakpoint_len   4

Definition at line 272 of file linux-arm-low.c.

#define arm_num_regs   26
#define HWCAP_IWMMXT   512
#define HWCAP_NEON   4096

Definition at line 124 of file linux-arm-low.c.

Referenced by arm_read_description().

#define HWCAP_VFP   64

Definition at line 122 of file linux-arm-low.c.

Referenced by arm_fill_vfpregset(), arm_read_description(), and arm_store_vfpregset().

#define HWCAP_VFPv3   8192

Definition at line 125 of file linux-arm-low.c.

Referenced by arm_fill_vfpregset(), arm_read_description(), and arm_store_vfpregset().

#define HWCAP_VFPv3D16   16384

Definition at line 126 of file linux-arm-low.c.

Referenced by arm_fill_vfpregset(), arm_read_description(), and arm_store_vfpregset().

#define MAX_BPTS   32

Definition at line 97 of file linux-arm-low.c.

Referenced by arm_linux_init_hwbp_cap(), and arm_new_thread().

#define MAX_WPTS   32

Definition at line 98 of file linux-arm-low.c.

Referenced by arm_linux_init_hwbp_cap(), and arm_new_thread().

#define PTRACE_GET_THREAD_AREA   22

Definition at line 47 of file linux-arm-low.c.

Referenced by ps_get_thread_area().

#define PTRACE_GETHBPREGS   29

Definition at line 61 of file linux-arm-low.c.

Referenced by arm_linux_init_hwbp_cap().

#define PTRACE_GETVFPREGS   27

Definition at line 56 of file linux-arm-low.c.

Referenced by arm_read_description().

#define PTRACE_GETWMMXREGS   18

Definition at line 51 of file linux-arm-low.c.

#define PTRACE_SETHBPREGS   30

Definition at line 62 of file linux-arm-low.c.

Referenced by arm_prepare_to_resume().

#define PTRACE_SETVFPREGS   28

Definition at line 57 of file linux-arm-low.c.

#define PTRACE_SETWMMXREGS   19

Definition at line 52 of file linux-arm-low.c.


Typedef Documentation

typedef unsigned int arm_hwbp_control_t

Definition at line 84 of file linux-arm-low.c.


Enumeration Type Documentation

Enumerator:
arm_hwbp_break 
arm_hwbp_load 
arm_hwbp_store 
arm_hwbp_access 

Definition at line 75 of file linux-arm-low.c.


Function Documentation

static void arm_arch_setup ( void  ) [static]

Definition at line 830 of file linux-arm-low.c.

References arm_read_description(), current_process(), and process_info::tdesc.

static int arm_breakpoint_at ( CORE_ADDR  where) [static]
static int arm_cannot_fetch_register ( int  regno) [static]

Definition at line 148 of file linux-arm-low.c.

References arm_num_regs.

static int arm_cannot_store_register ( int  regno) [static]

Definition at line 142 of file linux-arm-low.c.

References arm_num_regs.

static void arm_fill_gregset ( struct regcache regcache,
void *  buf 
) [static]

Definition at line 154 of file linux-arm-low.c.

References arm_num_regs, arm_regmap, and collect_register().

static void arm_fill_vfpregset ( struct regcache regcache,
void *  buf 
) [static]
static void arm_fill_wmmxregset ( struct regcache regcache,
void *  buf 
) [static]

Definition at line 178 of file linux-arm-low.c.

References arm_hwcap, arm_num_regs, collect_register(), and HWCAP_IWMMXT.

static int arm_get_hwcap ( unsigned long *  valp) [static]

Definition at line 759 of file linux-arm-low.c.

References offset, target_ops::read_auxv, and the_target.

Referenced by arm_read_description().

static CORE_ADDR arm_get_pc ( struct regcache regcache) [static]

Definition at line 254 of file linux-arm-low.c.

References collect_register_by_name(), and debug_threads.

Definition at line 429 of file linux-arm-low.c.

Referenced by arm_remove_point().

static arm_hwbp_control_t arm_hwbp_control_initialize ( unsigned  byte_address_select,
arm_hwbp_type  hwbp_type,
int  enable 
) [static]

Definition at line 402 of file linux-arm-low.c.

References arm_hwbp_break, and gdb_assert.

Referenced by arm_linux_hw_point_initialize().

static int arm_hwbp_control_is_enabled ( arm_hwbp_control_t  control) [static]

Definition at line 415 of file linux-arm-low.c.

Referenced by arm_insert_point(), and arm_prepare_to_resume().

static int arm_hwbp_control_is_initialized ( arm_hwbp_control_t  control) [static]

Definition at line 422 of file linux-arm-low.c.

Referenced by arm_prepare_to_resume().

static int arm_insert_point ( char  type,
CORE_ADDR  addr,
int  len 
) [static]
static int arm_linux_get_hw_breakpoint_count ( void  ) [static]

Definition at line 378 of file linux-arm-low.c.

References arm_linux_hwbp_cap.

Referenced by arm_insert_point(), arm_prepare_to_resume(), and arm_remove_point().

static int arm_linux_get_hw_watchpoint_count ( void  ) [static]
static int arm_linux_get_hw_watchpoint_max_length ( void  ) [static]

Definition at line 392 of file linux-arm-low.c.

References arm_linux_hwbp_cap.

Referenced by arm_linux_hw_point_initialize().

static int arm_linux_hw_breakpoint_equal ( const struct arm_linux_hw_breakpoint p1,
const struct arm_linux_hw_breakpoint p2 
) [static]
static int arm_linux_hw_point_initialize ( char  type,
CORE_ADDR  addr,
int  len,
struct arm_linux_hw_breakpoint p 
) [static]
static void arm_linux_init_hwbp_cap ( int  pid) [static]

Definition at line 355 of file linux-arm-low.c.

References arm_linux_hwbp_cap, internal_error(), MAX_BPTS, MAX_WPTS, and PTRACE_GETHBPREGS.

Referenced by arm_read_description().

static struct arch_process_info* arm_new_process ( void  ) [static, read]

Definition at line 684 of file linux-arm-low.c.

References xcalloc().

static struct arch_lwp_info* arm_new_thread ( void  ) [static, read]
static void arm_prepare_to_resume ( struct lwp_info lwp) [static]
static struct target_desc* arm_read_description ( void  ) [static, read]
static struct regs_info* arm_regs_info ( void  ) [static, read]

Definition at line 869 of file linux-arm-low.c.

References regs_info.

static CORE_ADDR arm_reinsert_addr ( void  ) [static]
static int arm_remove_point ( char  type,
CORE_ADDR  addr,
int  len 
) [static]
static void arm_set_pc ( struct regcache regcache,
CORE_ADDR  pc 
) [static]

Definition at line 264 of file linux-arm-low.c.

References supply_register_by_name().

static int arm_stopped_by_watchpoint ( void  ) [static]
static CORE_ADDR arm_stopped_data_address ( void  ) [static]
static void arm_store_gregset ( struct regcache regcache,
const void *  buf 
) [static]

Definition at line 164 of file linux-arm-low.c.

References arm_num_regs, arm_regmap, memset(), and supply_register().

static void arm_store_vfpregset ( struct regcache regcache,
const void *  buf 
) [static]
static void arm_store_wmmxregset ( struct regcache regcache,
const void *  buf 
) [static]

Definition at line 195 of file linux-arm-low.c.

References arm_hwcap, arm_num_regs, HWCAP_IWMMXT, and supply_register().

void init_registers_arm ( void  )

Referenced by initialize_low_arch().

Referenced by initialize_low_arch().

Referenced by initialize_low_arch().

Referenced by initialize_low_arch().

void initialize_low_arch ( void  )
ps_err_e ps_get_thread_area ( const struct ps_prochandle ph,
lwpid_t  lwpid,
int  idx,
void **  base 
)

Definition at line 337 of file linux-arm-low.c.

References PS_ERR, PS_OK, and PTRACE_GET_THREAD_AREA.

static int update_registers_callback ( struct inferior_list_entry entry,
void *  arg 
) [static]

Variable Documentation

unsigned char arch

Definition at line 68 of file linux-arm-low.c.

const unsigned long arm_breakpoint = 0xef9f0001 [static]

Definition at line 271 of file linux-arm-low.c.

Referenced by arm_breakpoint_at().

const unsigned long arm_eabi_breakpoint = 0xe7f001f0 [static]

Definition at line 280 of file linux-arm-low.c.

Referenced by arm_breakpoint_at().

unsigned long arm_hwcap [static]
struct { ... } arm_linux_hwbp_cap [static]
int arm_regmap[] [static]
Initial value:
 {
  0, 4, 8, 12, 16, 20, 24, 28,
  32, 36, 40, 44, 48, 52, 56, 60,
  -1, -1, -1, -1, -1, -1, -1, -1, -1,
  64
}

Definition at line 134 of file linux-arm-low.c.

Referenced by arm_fill_gregset(), and arm_store_gregset().

struct regset_info arm_regsets[] [static]
Initial value:
 {
  { PTRACE_GETREGS, PTRACE_SETREGS, 0, 18 * 4,
    GENERAL_REGS,
    arm_fill_gregset, arm_store_gregset },
  { PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS, 0, 16 * 8 + 6 * 4,
    EXTENDED_REGS,
    arm_fill_wmmxregset, arm_store_wmmxregset },
  { PTRACE_GETVFPREGS, PTRACE_SETVFPREGS, 0, 32 * 8 + 4,
    EXTENDED_REGS,
    arm_fill_vfpregset, arm_store_vfpregset },
  { 0, 0, 0, -1, -1, NULL, NULL }
}

Definition at line 835 of file linux-arm-low.c.

struct regsets_info arm_regsets_info [static]
Initial value:
  {
    arm_regsets, 
    0, 
    NULL, 
  }

Definition at line 848 of file linux-arm-low.c.

Referenced by initialize_low_arch().

struct usrregs_info arm_usrregs_info [static]
Initial value:

Definition at line 855 of file linux-arm-low.c.

unsigned char bp_count

Definition at line 71 of file linux-arm-low.c.

Definition at line 71 of file server.c.

unsigned char max_wp_length

Definition at line 69 of file linux-arm-low.c.

Referenced by arm_linux_hw_point_initialize().

struct regs_info regs_info [static]
Initial value:

Definition at line 861 of file linux-arm-low.c.

Referenced by arm_regs_info().

const unsigned short thumb2_breakpoint[] = { 0xf7f0, 0xa000 } [static]

Definition at line 274 of file linux-arm-low.c.

Referenced by arm_breakpoint_at().

const unsigned short thumb_breakpoint = 0xde01 [static]

Definition at line 273 of file linux-arm-low.c.

Referenced by arm_breakpoint_at().

unsigned char wp_count

Definition at line 70 of file linux-arm-low.c.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines