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_byte * | nios2_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_info * | nios2_regs_info (void)
void | initialize_low_arch (void)

## Variables
const struct target_desc * | tdesc_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:
=
{
{ PTRACE_GETREGSET, PTRACE_SETREGSET, NT_PRSTATUS,
nios2_num_regs * 4, GENERAL_REGS,
nios2_fill_gregset, nios2_store_gregset },
NULL_REGSET
}
nios2_num_regs
#define nios2_num_regs
Definition: linux-nios2-low.c:39
PTRACE_SETREGSET
#define PTRACE_SETREGSET
Definition: linux-ptrace.h:51
PTRACE_GETREGSET
#define PTRACE_GETREGSET
Definition: linux-ptrace.h:47
nios2_store_gregset
static void nios2_store_gregset(struct regcache *regcache, const void *buf)
Definition: linux-nios2-low.c:194
nios2_fill_gregset
static void nios2_fill_gregset(struct regcache *regcache, void *buf)
Definition: linux-nios2-low.c:184

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

## ◆ nios2_regsets_info

struct regsets_info nios2_regsets_info
| static

Initial value:
=
{
nios2_regsets,
0,
NULL,
}
nios2_regsets
static struct regset_info nios2_regsets[]
Definition: linux-nios2-low.c:203

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:
=
{
nios2_num_regs,
nios2_regmap,
}
nios2_num_regs
#define nios2_num_regs
Definition: linux-nios2-low.c:39
nios2_regmap
static int nios2_regmap[]
Definition: linux-nios2-low.c:57

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

## ◆ regs_info

struct regs_info regs_info
| static

Initial value:
=
{
NULL,
&nios2_usrregs_info,
&nios2_regsets_info
}
nios2_usrregs_info
static struct usrregs_info nios2_usrregs_info
Definition: linux-nios2-low.c:218
nios2_regsets_info
static struct regsets_info nios2_regsets_info
Definition: linux-nios2-low.c:211

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:
=
{
nios2_arch_setup,
nios2_regs_info,
nios2_cannot_fetch_register,
nios2_cannot_store_register,
NULL,
linux_get_pc_32bit,
linux_set_pc_32bit,
NULL,
nios2_sw_breakpoint_from_kind,
NULL,
0,
nios2_breakpoint_at,
}
linux_get_pc_32bit
CORE_ADDR linux_get_pc_32bit(struct regcache *regcache)
Definition: linux-low.c:7411
nios2_cannot_store_register
static int nios2_cannot_store_register(int regno)
Definition: linux-nios2-low.c:90
nios2_sw_breakpoint_from_kind
static const gdb_byte * nios2_sw_breakpoint_from_kind(int kind, int *size)
Definition: linux-nios2-low.c:119
linux_set_pc_32bit
void linux_set_pc_32bit(struct regcache *regcache, CORE_ADDR pc)
Definition: linux-low.c:7400
nios2_breakpoint_at
static int nios2_breakpoint_at(CORE_ADDR where)
Definition: linux-nios2-low.c:128
nios2_cannot_fetch_register
static int nios2_cannot_fetch_register(int regno)
Definition: linux-nios2-low.c:79
nios2_arch_setup
static void nios2_arch_setup(void)
Definition: linux-nios2-low.c:71
nios2_regs_info
static const struct regs_info * nios2_regs_info(void)
Definition: linux-nios2-low.c:232

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