GDBserver
Classes | Macros | Functions | Variables
linux-mips-low.c File Reference
#include "server.h"
#include "linux-low.h"
#include <sys/ptrace.h>
#include <endian.h>
#include "nat/mips-linux-watch.h"
#include "gdb_proc_service.h"
#include <asm/ptrace.h>

Go to the source code of this file.

Classes

union  mips_register
 
struct  arch_process_info
 
struct  arch_lwp_info
 

Macros

#define PTRACE_GET_THREAD_AREA   25
 
#define mips_num_regs   73
 
#define mips_dsp_num_regs   80
 
#define DSP_BASE   71
 
#define DSP_CONTROL   77
 
#define mips_base_regs
 
#define mips_dsp_regs
 
#define mips_breakpoint_len   4
 

Functions

void init_registers_mips_linux (void)
 
void init_registers_mips_dsp_linux (void)
 
void init_registers_mips64_linux (void)
 
void init_registers_mips64_dsp_linux (void)
 
static const struct target_descmips_read_description (void)
 
static void mips_arch_setup (void)
 
static struct usrregs_infoget_usrregs_info (void)
 
static int mips_cannot_fetch_register (int regno)
 
static int mips_cannot_store_register (int regno)
 
static CORE_ADDR mips_get_pc (struct regcache *regcache)
 
static void mips_set_pc (struct regcache *regcache, CORE_ADDR pc)
 
static CORE_ADDR mips_reinsert_addr (void)
 
static int mips_breakpoint_at (CORE_ADDR where)
 
static int update_watch_registers_callback (struct inferior_list_entry *entry, void *pid_p)
 
static struct arch_process_infomips_linux_new_process (void)
 
static void mips_linux_new_thread (struct lwp_info *lwp)
 
static void mips_add_watchpoint (struct arch_process_info *private, CORE_ADDR addr, int len, int watch_type)
 
static void mips_linux_new_fork (struct process_info *parent, struct process_info *child)
 
static void mips_linux_prepare_to_resume (struct lwp_info *lwp)
 
static int mips_supports_z_point_type (char z_type)
 
static int mips_insert_point (enum raw_bkpt_type type, CORE_ADDR addr, int len, struct raw_breakpoint *bp)
 
static int mips_remove_point (enum raw_bkpt_type type, CORE_ADDR addr, int len, struct raw_breakpoint *bp)
 
static int mips_stopped_by_watchpoint (void)
 
static CORE_ADDR mips_stopped_data_address (void)
 
ps_err_e ps_get_thread_area (const struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
 
static const struct regs_infomips_regs_info (void)
 
void initialize_low_arch (void)
 

Variables

const struct target_desctdesc_mips_linux
 
const struct target_desctdesc_mips_dsp_linux
 
const struct target_desctdesc_mips64_linux
 
const struct target_desctdesc_mips64_dsp_linux
 
static int mips_regmap [mips_num_regs]
 
static int mips_dsp_regmap [mips_dsp_num_regs]
 
static unsigned char mips_dsp_regset_bitmap [(mips_dsp_num_regs+7)/8]
 
static int have_dsp = -1
 
static const unsigned int mips_breakpoint = 0x0005000d
 
static struct regset_info mips_regsets []
 
static struct regsets_info mips_regsets_info
 
static struct usrregs_info mips_dsp_usrregs_info
 
static struct usrregs_info mips_usrregs_info
 
static struct regs_info dsp_regs_info
 
static struct regs_info regs_info
 
struct linux_target_ops the_low_target
 

Macro Definition Documentation

#define DSP_BASE   71

Definition at line 63 of file linux-mips-low.c.

#define DSP_CONTROL   77

Definition at line 64 of file linux-mips-low.c.

Referenced by mips_read_description().

#define mips_base_regs
Value:
-1, 1, 2, 3, 4, 5, 6, 7, \
8, 9, 10, 11, 12, 13, 14, 15, \
16, 17, 18, 19, 20, 21, 22, 23, \
24, 25, 26, 27, 28, 29, 30, 31, \
\
-1, MMLO, MMHI, BADVADDR, CAUSE, PC, \
\
FPR_BASE, FPR_BASE + 1, FPR_BASE + 2, FPR_BASE + 3, \
FPR_BASE + 4, FPR_BASE + 5, FPR_BASE + 6, FPR_BASE + 7, \
FPR_BASE + 8, FPR_BASE + 9, FPR_BASE + 10, FPR_BASE + 11, \
FPR_BASE + 12, FPR_BASE + 13, FPR_BASE + 14, FPR_BASE + 15, \
FPR_BASE + 16, FPR_BASE + 17, FPR_BASE + 18, FPR_BASE + 19, \
FPR_BASE + 20, FPR_BASE + 21, FPR_BASE + 22, FPR_BASE + 23, \
FPR_BASE + 24, FPR_BASE + 25, FPR_BASE + 26, FPR_BASE + 27, \
FPR_BASE + 28, FPR_BASE + 29, FPR_BASE + 30, FPR_BASE + 31, \
FPC_CSR, FPC_EIR

Definition at line 78 of file linux-mips-low.c.

#define mips_breakpoint_len   4

Definition at line 267 of file linux-mips-low.c.

#define mips_dsp_num_regs   80

Definition at line 58 of file linux-mips-low.c.

#define mips_dsp_regs
Value:
DSP_BASE + 4, DSP_BASE + 5, \
DSP_CONTROL
#define DSP_BASE

Definition at line 96 of file linux-mips-low.c.

#define mips_num_regs   73

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

#define PTRACE_GET_THREAD_AREA   25

Definition at line 50 of file linux-mips-low.c.

Referenced by ps_get_thread_area().

Function Documentation

static struct usrregs_info* get_usrregs_info ( void  )
static
void init_registers_mips64_dsp_linux ( void  )

Referenced by initialize_low_arch().

void init_registers_mips64_linux ( void  )

Referenced by initialize_low_arch().

void init_registers_mips_dsp_linux ( void  )

Referenced by initialize_low_arch().

void init_registers_mips_linux ( void  )

Referenced by initialize_low_arch().

void initialize_low_arch ( void  )
static void mips_add_watchpoint ( struct arch_process_info private,
CORE_ADDR  addr,
int  len,
int  watch_type 
)
static
static void mips_arch_setup ( void  )
static

Definition at line 151 of file linux-mips-low.c.

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

static int mips_breakpoint_at ( CORE_ADDR  where)
static

Definition at line 282 of file linux-mips-low.c.

References mips_breakpoint, target_ops::read_memory, and the_target.

static int mips_cannot_fetch_register ( int  regno)
static
static int mips_cannot_store_register ( int  regno)
static
static CORE_ADDR mips_get_pc ( struct regcache regcache)
static
static int mips_insert_point ( enum raw_bkpt_type  type,
CORE_ADDR  addr,
int  len,
struct raw_breakpoint bp 
)
static
static void mips_linux_new_fork ( struct process_info parent,
struct process_info child 
)
static
static struct arch_process_info* mips_linux_new_process ( void  )
static

Definition at line 326 of file linux-mips-low.c.

References xcalloc().

static void mips_linux_new_thread ( struct lwp_info lwp)
static
static void mips_linux_prepare_to_resume ( struct lwp_info lwp)
static
static const struct target_desc* mips_read_description ( void  )
static
static const struct regs_info* mips_regs_info ( void  )
static

Definition at line 868 of file linux-mips-low.c.

References dsp_regs_info, have_dsp, and regs_info.

static CORE_ADDR mips_reinsert_addr ( void  )
static
static int mips_remove_point ( enum raw_bkpt_type  type,
CORE_ADDR  addr,
int  len,
struct raw_breakpoint bp 
)
static
static void mips_set_pc ( struct regcache regcache,
CORE_ADDR  pc 
)
static
static int mips_stopped_by_watchpoint ( void  )
static
static CORE_ADDR mips_stopped_data_address ( void  )
static
static int mips_supports_z_point_type ( char  z_type)
static

Definition at line 439 of file linux-mips-low.c.

References Z_PACKET_ACCESS_WP, Z_PACKET_READ_WP, and Z_PACKET_WRITE_WP.

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

Definition at line 643 of file linux-mips-low.c.

References PS_ERR, PS_OK, and PTRACE_GET_THREAD_AREA.

static int update_watch_registers_callback ( struct inferior_list_entry entry,
void *  pid_p 
)
static

Variable Documentation

struct regs_info dsp_regs_info
static
Initial value:
=
{
}
static struct regsets_info mips_regsets_info
static struct usrregs_info mips_dsp_usrregs_info
static unsigned char mips_dsp_regset_bitmap[(mips_dsp_num_regs+7)/8]

Definition at line 853 of file linux-mips-low.c.

Referenced by mips_regs_info().

int have_dsp = -1
static

Definition at line 119 of file linux-mips-low.c.

Referenced by mips_read_description(), and mips_regs_info().

const unsigned int mips_breakpoint = 0x0005000d
static

Definition at line 266 of file linux-mips-low.c.

Referenced by mips_breakpoint_at().

int mips_dsp_regmap[mips_dsp_num_regs]
static
Initial value:
= {
0
}
#define mips_base_regs
#define mips_dsp_regs

Definition at line 106 of file linux-mips-low.c.

unsigned char mips_dsp_regset_bitmap[(mips_dsp_num_regs+7)/8]
static
Initial value:
= {
0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x80
}

Definition at line 115 of file linux-mips-low.c.

struct usrregs_info mips_dsp_usrregs_info
static
Initial value:
=
{
}
#define mips_dsp_num_regs
static int mips_dsp_regmap[mips_dsp_num_regs]

Definition at line 841 of file linux-mips-low.c.

int mips_regmap[mips_num_regs]
static
Initial value:
= {
0
}
#define mips_base_regs

Definition at line 101 of file linux-mips-low.c.

struct regset_info mips_regsets[]
static
Initial value:
= {
{ 0, 0, 0, -1, -1, NULL, NULL }
}

Definition at line 824 of file linux-mips-low.c.

struct regsets_info mips_regsets_info
static
Initial value:
=
{
0,
NULL,
}
static struct regset_info mips_regsets[]

Definition at line 834 of file linux-mips-low.c.

struct usrregs_info mips_usrregs_info
static
Initial value:
=
{
}
#define mips_num_regs
static int mips_regmap[mips_num_regs]

Definition at line 847 of file linux-mips-low.c.

struct regs_info regs_info
static
Initial value:
=
{
NULL,
}
static struct regsets_info mips_regsets_info
static struct usrregs_info mips_usrregs_info

Definition at line 860 of file linux-mips-low.c.

Referenced by mips_regs_info().

const struct target_desc* tdesc_mips64_dsp_linux
const struct target_desc* tdesc_mips64_linux
const struct target_desc* tdesc_mips_dsp_linux
const struct target_desc* tdesc_mips_linux

Referenced by mips_read_description().

struct linux_target_ops the_low_target
Initial value:
= {
NULL,
(const unsigned char *) &mips_breakpoint,
0,
NULL,
NULL,
NULL,
}
static void mips_linux_new_thread(struct lwp_info *lwp)
#define mips_breakpoint_len
static int mips_cannot_fetch_register(int regno)
static void mips_linux_prepare_to_resume(struct lwp_info *lwp)
static const struct regs_info * mips_regs_info(void)
static struct arch_process_info * mips_linux_new_process(void)
static int mips_supports_z_point_type(char z_type)
static void mips_arch_setup(void)
static int mips_insert_point(enum raw_bkpt_type type, CORE_ADDR addr, int len, struct raw_breakpoint *bp)
static int mips_cannot_store_register(int regno)
static const unsigned int mips_breakpoint
static int mips_remove_point(enum raw_bkpt_type type, CORE_ADDR addr, int len, struct raw_breakpoint *bp)
static int mips_breakpoint_at(CORE_ADDR where)
static void mips_linux_new_fork(struct process_info *parent, struct process_info *child)
static int mips_stopped_by_watchpoint(void)
static CORE_ADDR mips_reinsert_addr(void)
static CORE_ADDR mips_stopped_data_address(void)
static void mips_set_pc(struct regcache *regcache, CORE_ADDR pc)
static CORE_ADDR mips_get_pc(struct regcache *regcache)

Definition at line 876 of file linux-mips-low.c.

Referenced by get_usrregs_info().