Changeset View
Changeset View
Standalone View
Standalone View
devel/gdb/files/kgdb/amd64fbsd-kern.c
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | static const int amd64fbsd_trapframe_offset[] = { | ||||
-1, /* %es */ | -1, /* %es */ | ||||
-1, /* %fs */ | -1, /* %fs */ | ||||
-1 /* %gs */ | -1 /* %gs */ | ||||
}; | }; | ||||
#define TRAPFRAME_SIZE 192 | #define TRAPFRAME_SIZE 192 | ||||
static struct trad_frame_cache * | static struct trad_frame_cache * | ||||
amd64fbsd_trapframe_cache (struct frame_info *this_frame, void **this_cache) | amd64fbsd_trapframe_cache (frame_info_ptr this_frame, void **this_cache) | ||||
{ | { | ||||
struct gdbarch *gdbarch = get_frame_arch (this_frame); | struct gdbarch *gdbarch = get_frame_arch (this_frame); | ||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | ||||
struct trad_frame_cache *cache; | struct trad_frame_cache *cache; | ||||
CORE_ADDR addr, func, pc, sp; | CORE_ADDR addr, func, pc, sp; | ||||
const char *name; | const char *name; | ||||
int i; | int i; | ||||
Show All 34 Lines | else | ||||
/* Construct the frame ID using the function start. */ | /* Construct the frame ID using the function start. */ | ||||
trad_frame_set_id (cache, frame_id_build (sp + TRAPFRAME_SIZE, func)); | trad_frame_set_id (cache, frame_id_build (sp + TRAPFRAME_SIZE, func)); | ||||
} | } | ||||
return cache; | return cache; | ||||
} | } | ||||
static void | static void | ||||
amd64fbsd_trapframe_this_id (struct frame_info *this_frame, | amd64fbsd_trapframe_this_id (frame_info_ptr this_frame, | ||||
void **this_cache, struct frame_id *this_id) | void **this_cache, struct frame_id *this_id) | ||||
{ | { | ||||
struct trad_frame_cache *cache = | struct trad_frame_cache *cache = | ||||
amd64fbsd_trapframe_cache (this_frame, this_cache); | amd64fbsd_trapframe_cache (this_frame, this_cache); | ||||
trad_frame_get_id (cache, this_id); | trad_frame_get_id (cache, this_id); | ||||
} | } | ||||
static struct value * | static struct value * | ||||
amd64fbsd_trapframe_prev_register (struct frame_info *this_frame, | amd64fbsd_trapframe_prev_register (frame_info_ptr this_frame, | ||||
void **this_cache, int regnum) | void **this_cache, int regnum) | ||||
{ | { | ||||
struct trad_frame_cache *cache = | struct trad_frame_cache *cache = | ||||
amd64fbsd_trapframe_cache (this_frame, this_cache); | amd64fbsd_trapframe_cache (this_frame, this_cache); | ||||
return trad_frame_get_register (cache, this_frame, regnum); | return trad_frame_get_register (cache, this_frame, regnum); | ||||
} | } | ||||
static int | static int | ||||
amd64fbsd_trapframe_sniffer (const struct frame_unwind *self, | amd64fbsd_trapframe_sniffer (const struct frame_unwind *self, | ||||
struct frame_info *this_frame, | frame_info_ptr this_frame, | ||||
void **this_prologue_cache) | void **this_prologue_cache) | ||||
{ | { | ||||
const char *name; | const char *name; | ||||
find_pc_partial_function (get_frame_func (this_frame), &name, NULL, NULL); | find_pc_partial_function (get_frame_func (this_frame), &name, NULL, NULL); | ||||
return (name && ((strcmp (name, "calltrap") == 0) | return (name && ((strcmp (name, "calltrap") == 0) | ||||
|| (strcmp (name, "fast_syscall_common") == 0) | || (strcmp (name, "fast_syscall_common") == 0) | ||||
|| (strcmp (name, "fork_trampoline") == 0) | || (strcmp (name, "fork_trampoline") == 0) | ||||
Show All 16 Lines | |||||
amd64fbsd_kernel_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch) | amd64fbsd_kernel_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch) | ||||
{ | { | ||||
amd64_init_abi(info, gdbarch, | amd64_init_abi(info, gdbarch, | ||||
amd64_target_description (X86_XSTATE_SSE_MASK, true)); | amd64_target_description (X86_XSTATE_SSE_MASK, true)); | ||||
frame_unwind_prepend_unwinder(gdbarch, &amd64fbsd_trapframe_unwind); | frame_unwind_prepend_unwinder(gdbarch, &amd64fbsd_trapframe_unwind); | ||||
set_solib_ops(gdbarch, &kld_so_ops); | set_gdbarch_so_ops(gdbarch, &kld_so_ops); | ||||
fbsd_vmcore_set_supply_pcb(gdbarch, amd64fbsd_supply_pcb); | fbsd_vmcore_set_supply_pcb(gdbarch, amd64fbsd_supply_pcb); | ||||
fbsd_vmcore_set_cpu_pcb_addr(gdbarch, kgdb_trgt_stop_pcb); | fbsd_vmcore_set_cpu_pcb_addr(gdbarch, kgdb_trgt_stop_pcb); | ||||
} | } | ||||
void _initialize_amd64_kgdb_tdep (); | void _initialize_amd64_kgdb_tdep (); | ||||
void | void | ||||
_initialize_amd64_kgdb_tdep () | _initialize_amd64_kgdb_tdep () | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |