GDB (xrefs)

Macros | Functions | Variables
/tmp/gdb-8.1/gdb/amd64-obsd-tdep.c File Reference
`#include "defs.h"`
`#include "frame.h"`
`#include "frame-unwind.h"`
`#include "gdbcore.h"`
`#include "symtab.h"`
`#include "objfiles.h"`
`#include "osabi.h"`
`#include "regcache.h"`
`#include "regset.h"`
`#include "target.h"`
`#include "trad-frame.h"`
`#include "obsd-tdep.h"`
`#include "amd64-tdep.h"`
`#include "i387-tdep.h"`
`#include "x86-xstate.h"`
`#include "solib-svr4.h"`
`#include "bsd-uthread.h"`

Go to the source code of this file.

## Macros
#define | AMD64OBSD_UTHREAD_RSP_OFFSET 400
#define | amd64obsd_tf_reg_offset amd64obsd_sc_reg_offset

## Functions
static int | amd64obsd_sigtramp_p (struct frame_info *this_frame)
static CORE_ADDR | amd64obsd_sigcontext_addr (struct frame_info *this_frame)
static void | amd64obsd_supply_uthread (struct regcache *regcache, int regnum, CORE_ADDR addr)
static void | amd64obsd_collect_uthread (const struct regcache *regcache, int regnum, CORE_ADDR addr)
static struct trad_frame_cache * | amd64obsd_trapframe_cache (struct frame_info *this_frame, void **this_cache)
static void | amd64obsd_trapframe_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
static struct value * | amd64obsd_trapframe_prev_register (struct frame_info *this_frame, void **this_cache, int regnum)
static int | amd64obsd_trapframe_sniffer (const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
static void | amd64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
void | _initialize_amd64obsd_tdep (void)

## Variables
static const int | amd64obsd_page_size = 4096
int | amd64obsd_r_reg_offset []
static int | amd64obsd_sc_reg_offset []
static int | amd64obsd_uthread_reg_offset []
static const struct frame_unwind | amd64obsd_trapframe_unwind

## Macro Definition Documentation

## ◆ amd64obsd_tf_reg_offset

#define amd64obsd_tf_reg_offset amd64obsd_sc_reg_offset

Definition at line 315 of file amd64-obsd-tdep.c.

Referenced by amd64obsd_trapframe_cache().

## ◆ AMD64OBSD_UTHREAD_RSP_OFFSET

#define AMD64OBSD_UTHREAD_RSP_OFFSET 400

Definition at line 218 of file amd64-obsd-tdep.c.

Referenced by amd64obsd_collect_uthread(), and amd64obsd_supply_uthread().

## Function Documentation

## ◆ _initialize_amd64obsd_tdep()

void _initialize_amd64obsd_tdep | ( | void |  | ) |

Definition at line 452 of file amd64-obsd-tdep.c.

References AMD64_NUM_GREGS, amd64obsd_init_abi(), amd64obsd_r_reg_offset, gdb_assert, GDB_OSABI_OPENBSD, and gdbarch_register_osabi().

## ◆ amd64obsd_collect_uthread()

static void amd64obsd_collect_uthread | ( | const struct regcache * | regcache,
|  | int | regnum,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 265 of file amd64-obsd-tdep.c.

References AMD64_RIP_REGNUM, AMD64_RSP_REGNUM, amd64obsd_uthread_reg_offset, AMD64OBSD_UTHREAD_RSP_OFFSET, regcache::arch(), gdbarch::byte_order, extract_unsigned_integer(), gdb_assert, gdbarch_byte_order(), offset, read_memory_unsigned_integer(), regcache_raw_collect(), regnum, write_memory(), and write_memory_unsigned_integer().

Referenced by amd64obsd_init_abi().

## ◆ amd64obsd_init_abi()

static void amd64obsd_init_abi | ( | struct gdbarch_info | info,
|  | struct gdbarch * | gdbarch
| ) |  |
| static

Definition at line 419 of file amd64-obsd-tdep.c.

References amd64_init_abi(), amd64_target_description(), amd64obsd_collect_uthread(), amd64obsd_r_reg_offset, amd64obsd_sc_reg_offset, amd64obsd_sigcontext_addr(), amd64obsd_sigtramp_p(), amd64obsd_supply_uthread(), amd64obsd_trapframe_unwind, bsd_uthread_set_collect_uthread(), bsd_uthread_set_supply_uthread(), frame_unwind_prepend_unwinder(), gdbarch_tdep(), gdbarch_tdep::gregset_num_regs, gdbarch_tdep::gregset_reg_offset, gdbarch_tdep::jb_pc_offset, obsd_init_abi(), gdbarch_tdep::sc_num_regs, gdbarch_tdep::sc_reg_offset, set_solib_svr4_fetch_link_map_offsets(), gdbarch_tdep::sigcontext_addr, gdbarch_tdep::sigtramp_p, gdbarch_tdep::sizeof_gregset, svr4_lp64_fetch_link_map_offsets(), and X86_XSTATE_SSE_MASK.

Referenced by _initialize_amd64obsd_tdep().

## ◆ amd64obsd_sigcontext_addr()

static CORE_ADDR amd64obsd_sigcontext_addr | ( | struct frame_info * | this_frame | ) |
| static

Definition at line 101 of file amd64-obsd-tdep.c.

References AMD64_RDI_REGNUM, AMD64_RSP_REGNUM, amd64obsd_page_size, get_frame_pc(), get_frame_register_unsigned(), and offset.

Referenced by amd64obsd_init_abi().

## ◆ amd64obsd_sigtramp_p()

static int amd64obsd_sigtramp_p | ( | struct frame_info * | this_frame | ) |
| static

Definition at line 48 of file amd64-obsd-tdep.c.

References amd64obsd_page_size, find_pc_partial_function(), find_pc_section(), get_frame_pc(), name, and safe_frame_unwind_memory().

Referenced by amd64obsd_init_abi().

## ◆ amd64obsd_supply_uthread()

static void amd64obsd_supply_uthread | ( | struct regcache * | regcache,
|  | int | regnum,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 221 of file amd64-obsd-tdep.c.

References AMD64_RIP_REGNUM, AMD64_RSP_REGNUM, amd64obsd_uthread_reg_offset, AMD64OBSD_UTHREAD_RSP_OFFSET, regcache::arch(), gdbarch::byte_order, gdb_assert, gdbarch_byte_order(), offset, read_memory(), read_memory_unsigned_integer(), regcache_raw_supply(), regnum, and store_unsigned_integer().

Referenced by amd64obsd_init_abi().

## ◆ amd64obsd_trapframe_cache()

static struct trad_frame_cache* amd64obsd_trapframe_cache | ( | struct frame_info * | this_frame,
|  | void ** | this_cache
| ) |  |
| static

Definition at line 318 of file amd64-obsd-tdep.c.

References AMD64_CS_REGNUM, AMD64_RSP_REGNUM, amd64obsd_tf_reg_offset, gdbarch::byte_order, find_pc_partial_function(), frame_id_build(), func, gdbarch_byte_order(), get_frame_arch(), get_frame_func(), get_frame_register_unsigned(), I386_SEL_RPL, I386_SEL_UPL, name, outer_frame_id, read_memory_unsigned_integer(), startswith(), trad_frame_cache::this_frame, trad_frame_cache_zalloc(), trad_frame_set_id(), and trad_frame_set_reg_addr().

Referenced by amd64obsd_trapframe_prev_register(), and amd64obsd_trapframe_this_id().

## ◆ amd64obsd_trapframe_prev_register()

static struct value* amd64obsd_trapframe_prev_register | ( | struct frame_info * | this_frame,
|  | void ** | this_cache,
|  | int | regnum
| ) |  |
| static

Definition at line 375 of file amd64-obsd-tdep.c.

References amd64obsd_trapframe_cache(), regnum, trad_frame_cache::this_frame, and trad_frame_get_register().

## ◆ amd64obsd_trapframe_sniffer()

static int amd64obsd_trapframe_sniffer | ( | const struct frame_unwind * | self,
|  | struct frame_info * | this_frame,
|  | void ** | this_prologue_cache
| ) |  |
| static

Definition at line 385 of file amd64-obsd-tdep.c.

References AMD64_CS_REGNUM, find_pc_partial_function(), get_frame_pc(), get_frame_register_unsigned(), I386_SEL_RPL, I386_SEL_UPL, name, startswith(), and trad_frame_cache::this_frame.

## ◆ amd64obsd_trapframe_this_id()

static void amd64obsd_trapframe_this_id | ( | struct frame_info * | this_frame,
|  | void ** | this_cache,
|  | struct frame_id * | this_id
| ) |  |
| static

Definition at line 365 of file amd64-obsd-tdep.c.

References amd64obsd_trapframe_cache(), trad_frame_cache::this_frame, trad_frame_cache::this_id, and trad_frame_get_id().

## Variable Documentation

## ◆ amd64obsd_page_size

const int amd64obsd_page_size = 4096
| static

Definition at line 42 of file amd64-obsd-tdep.c.

Referenced by amd64obsd_sigcontext_addr(), and amd64obsd_sigtramp_p().

## ◆ amd64obsd_r_reg_offset

int amd64obsd_r_reg_offset[]

Initial value:
=
{
14 * 8,
13 * 8,
3 * 8,
2 * 8,
1 * 8,
0 * 8,
12 * 8,
15 * 8,
4 * 8,
5 * 8,
6 * 8,
7 * 8,
8 * 8,
9 * 8,
10 * 8,
11 * 8,
16 * 8,
17 * 8,
18 * 8,
19 * 8,
20 * 8,
21 * 8,
22 * 8,
23 * 8
}

Definition at line 130 of file amd64-obsd-tdep.c.

Referenced by _initialize_amd64obsd_nat(), _initialize_amd64obsd_tdep(), and amd64obsd_init_abi().

## ◆ amd64obsd_sc_reg_offset

int amd64obsd_sc_reg_offset[]
| static

Initial value:
=
{
14 * 8,
13 * 8,
3 * 8,
2 * 8,
1 * 8,
0 * 8,
12 * 8,
24 * 8,
4 * 8,
5 * 8,
6 * 8,
7 * 8,
8 * 8,
9 * 8,
10 * 8,
11 * 8,
21 * 8,
23 * 8,
22 * 8,
25 * 8,
18 * 8,
17 * 8,
16 * 8,
15 * 8
}

Definition at line 159 of file amd64-obsd-tdep.c.

Referenced by amd64obsd_init_abi().

## ◆ amd64obsd_trapframe_unwind

const struct frame_unwind amd64obsd_trapframe_unwind
| static

Initial value:
= {
NORMAL_FRAME,
default_frame_unwind_stop_reason,
amd64obsd_trapframe_this_id,
amd64obsd_trapframe_prev_register,
NULL,
amd64obsd_trapframe_sniffer
}
amd64obsd_trapframe_this_id
static void amd64obsd_trapframe_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
Definition: amd64-obsd-tdep.c:365
NORMAL_FRAME
Definition: frame.h:244
amd64obsd_trapframe_sniffer
static int amd64obsd_trapframe_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
Definition: amd64-obsd-tdep.c:385
default_frame_unwind_stop_reason
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
Definition: frame-unwind.c:184
amd64obsd_trapframe_prev_register
static struct value * amd64obsd_trapframe_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
Definition: amd64-obsd-tdep.c:375

Definition at line 405 of file amd64-obsd-tdep.c.

Referenced by amd64obsd_init_abi().

## ◆ amd64obsd_uthread_reg_offset

int amd64obsd_uthread_reg_offset[]
| static

Initial value:
=
{
19 * 8,
16 * 8,
18 * 8,
17 * 8,
14 * 8,
13 * 8,
15 * 8,
-1,
12 * 8,
11 * 8,
10 * 8,
9 * 8,
8 * 8,
7 * 8,
6 * 8,
5 * 8,
20 * 8,
4 * 8,
21 * 8,
-1,
3 * 8,
2 * 8,
1 * 8,
0 * 8
}

Definition at line 188 of file amd64-obsd-tdep.c.

Referenced by amd64obsd_collect_uthread(), and amd64obsd_supply_uthread().