GDBserver
Classes | Macros | Functions | Variables
linux-nios2-low.c File Reference
#include "server.h"
#include "linux-low.h"
#include "elf/common.h"
#include "nat/gdb_ptrace.h"
#include <endian.h>
#include "gdb_proc_service.h"
#include <asm/ptrace.h>

Go to the source code of this file.

Classes

union  nios2_register
 

Macros

#define PTRACE_GET_THREAD_AREA   25
 
#define nios2_num_regs   49
 
#define NIOS2_BREAKPOINT   0x003b6ffa
 
#define nios2_breakpoint_len   4
 

Functions

void init_registers_nios2_linux (void)
 
static void nios2_arch_setup (void)
 
static int nios2_cannot_fetch_register (int regno)
 
static int nios2_cannot_store_register (int regno)
 
static const gdb_bytenios2_sw_breakpoint_from_kind (int kind, int *size)
 
static int nios2_breakpoint_at (CORE_ADDR where)
 
ps_err_e ps_get_thread_area (struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
 
static void nios2_collect_register (struct regcache *regcache, int regno, union nios2_register *reg)
 
static void nios2_supply_register (struct regcache *regcache, int regno, const union nios2_register *reg)
 
static void nios2_fill_gregset (struct regcache *regcache, void *buf)
 
static void nios2_store_gregset (struct regcache *regcache, const void *buf)
 
static const struct regs_infonios2_regs_info (void)
 
void initialize_low_arch (void)
 

Variables

const struct target_desctdesc_nios2_linux
 
static int nios2_regmap []
 
static const unsigned int nios2_breakpoint = NIOS2_BREAKPOINT
 
static struct regset_info nios2_regsets []
 
static struct regsets_info nios2_regsets_info
 
static struct usrregs_info nios2_usrregs_info
 
static struct regs_info regs_info
 
struct linux_target_ops the_low_target
 

Macro Definition Documentation

◆ NIOS2_BREAKPOINT

#define NIOS2_BREAKPOINT   0x003b6ffa

Definition at line 105 of file linux-nios2-low.c.

◆ nios2_breakpoint_len

#define nios2_breakpoint_len   4

Definition at line 114 of file linux-nios2-low.c.

Referenced by nios2_sw_breakpoint_from_kind().

◆ nios2_num_regs

#define nios2_num_regs   49

Definition at line 39 of file linux-nios2-low.c.

Referenced by nios2_fill_gregset(), and nios2_store_gregset().

◆ PTRACE_GET_THREAD_AREA

#define PTRACE_GET_THREAD_AREA   25

Definition at line 31 of file linux-nios2-low.c.

Referenced by ps_get_thread_area().

Function Documentation

◆ init_registers_nios2_linux()

void init_registers_nios2_linux ( void  )

Referenced by initialize_low_arch().

◆ initialize_low_arch()

void initialize_low_arch ( void  )

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

References init_registers_nios2_linux(), and nios2_regsets_info.

◆ nios2_arch_setup()

static void nios2_arch_setup ( void  )
static

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

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

◆ nios2_breakpoint_at()

static int nios2_breakpoint_at ( CORE_ADDR  where)
static

Definition at line 128 of file linux-nios2-low.c.

References nios2_breakpoint, target_ops::read_memory, and the_target.

◆ nios2_cannot_fetch_register()

static int nios2_cannot_fetch_register ( int  regno)
static

Definition at line 79 of file linux-nios2-low.c.

References nios2_regmap.

◆ nios2_cannot_store_register()

static int nios2_cannot_store_register ( int  regno)
static

Definition at line 90 of file linux-nios2-low.c.

References nios2_regmap.

◆ nios2_collect_register()

static void nios2_collect_register ( struct regcache regcache,
int  regno,
union nios2_register reg 
)
static

Definition at line 165 of file linux-nios2-low.c.

References collect_register(), and nios2_register::reg32.

Referenced by nios2_fill_gregset().

◆ nios2_fill_gregset()

static void nios2_fill_gregset ( struct regcache regcache,
void *  buf 
)
static

Definition at line 184 of file linux-nios2-low.c.

References nios2_register::buf, nios2_collect_register(), and nios2_num_regs.

◆ nios2_regs_info()

static const struct regs_info* nios2_regs_info ( void  )
static

Definition at line 232 of file linux-nios2-low.c.

References regs_info.

◆ nios2_store_gregset()

static void nios2_store_gregset ( struct regcache regcache,
const void *  buf 
)
static

Definition at line 194 of file linux-nios2-low.c.

References nios2_register::buf, nios2_num_regs, and nios2_supply_register().

◆ nios2_supply_register()

static void nios2_supply_register ( struct regcache regcache,
int  regno,
const union nios2_register reg 
)
static

Definition at line 175 of file linux-nios2-low.c.

References nios2_register::buf, and supply_register().

Referenced by nios2_store_gregset().

◆ nios2_sw_breakpoint_from_kind()

static const gdb_byte* nios2_sw_breakpoint_from_kind ( int  kind,
int *  size 
)
static

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

References nios2_breakpoint, and nios2_breakpoint_len.

◆ ps_get_thread_area()

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

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

References PS_ERR, PS_OK, ptrace(), and PTRACE_GET_THREAD_AREA.

Variable Documentation

◆ nios2_breakpoint

const unsigned int nios2_breakpoint = NIOS2_BREAKPOINT
static

Definition at line 113 of file linux-nios2-low.c.

Referenced by nios2_breakpoint_at(), and nios2_sw_breakpoint_from_kind().

◆ nios2_regmap

int nios2_regmap[]
static
Initial 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,
32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47,
48,
0
}

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

Referenced by nios2_cannot_fetch_register(), and nios2_cannot_store_register().

◆ nios2_regsets

struct regset_info nios2_regsets[]
static
Initial value:
=
{
nios2_num_regs * 4, GENERAL_REGS,
NULL_REGSET
}
#define nios2_num_regs
#define PTRACE_SETREGSET
Definition: linux-ptrace.h:51
#define PTRACE_GETREGSET
Definition: linux-ptrace.h:47
static void nios2_store_gregset(struct regcache *regcache, const void *buf)
static void nios2_fill_gregset(struct regcache *regcache, void *buf)

Definition at line 203 of file linux-nios2-low.c.

◆ nios2_regsets_info

struct regsets_info nios2_regsets_info
static
Initial value:
=
{
0,
NULL,
}
static struct regset_info nios2_regsets[]

Definition at line 211 of file linux-nios2-low.c.

Referenced by initialize_low_arch().

◆ nios2_usrregs_info

struct usrregs_info nios2_usrregs_info
static
Initial value:
=
{
}
#define nios2_num_regs
static int nios2_regmap[]

Definition at line 218 of file linux-nios2-low.c.

◆ regs_info

struct regs_info regs_info
static
Initial value:
=
{
NULL,
}
static struct usrregs_info nios2_usrregs_info
static struct regsets_info nios2_regsets_info

Definition at line 224 of file linux-nios2-low.c.

Referenced by nios2_regs_info().

◆ tdesc_nios2_linux

const struct target_desc* tdesc_nios2_linux

Referenced by nios2_arch_setup().

◆ the_low_target

struct linux_target_ops the_low_target
Initial value:
=
{
NULL,
NULL,
NULL,
0,
}
CORE_ADDR linux_get_pc_32bit(struct regcache *regcache)
Definition: linux-low.c:7411
static int nios2_cannot_store_register(int regno)
static const gdb_byte * nios2_sw_breakpoint_from_kind(int kind, int *size)
void linux_set_pc_32bit(struct regcache *regcache, CORE_ADDR pc)
Definition: linux-low.c:7400
static int nios2_breakpoint_at(CORE_ADDR where)
static int nios2_cannot_fetch_register(int regno)
static void nios2_arch_setup(void)
static const struct regs_info * nios2_regs_info(void)

Definition at line 237 of file linux-nios2-low.c.