Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/gcore/elf32core.c
Show All 26 Lines | #ifdef __amd64__ | ||||
rd->r_edx = rs->r_rdx; | rd->r_edx = rs->r_rdx; | ||||
rd->r_ecx = rs->r_rcx; | rd->r_ecx = rs->r_rcx; | ||||
rd->r_eax = rs->r_rax; | rd->r_eax = rs->r_rax; | ||||
rd->r_eip = rs->r_rip; | rd->r_eip = rs->r_rip; | ||||
rd->r_cs = rs->r_cs; | rd->r_cs = rs->r_cs; | ||||
rd->r_eflags = rs->r_rflags; | rd->r_eflags = rs->r_rflags; | ||||
rd->r_esp = rs->r_rsp; | rd->r_esp = rs->r_rsp; | ||||
rd->r_ss = rs->r_ss; | rd->r_ss = rs->r_ss; | ||||
#else | #elif defined(__aarch64__) | ||||
int i; | |||||
for (i = 0; i < 13; i++) | |||||
rd->r[i] = rs->x[i]; | |||||
rd->r_sp = rs->sp; | |||||
andrew: I think you want to use `rs->x[13]` here. The comment in `fill_regs32` in… | |||||
rd->r_pc = rs->elr; | |||||
rd->r_cpsr = rs->spsr; | |||||
#error Unsupported architecture | #error Unsupported architecture | ||||
#endif | #endif | ||||
} | } | ||||
static void | static void | ||||
elf_convert_fpregset(elfcore_fpregset_t *rd, struct fpreg *rs) | elf_convert_fpregset(elfcore_fpregset_t *rd, struct fpreg *rs) | ||||
{ | { | ||||
#ifdef __amd64__ | #ifdef __amd64__ | ||||
/* XXX this is wrong... */ | /* XXX this is wrong... */ | ||||
memcpy(rd, rs, sizeof(*rd)); | memcpy(rd, rs, sizeof(*rd)); | ||||
#elif defined(__aarch64__) | |||||
/* TODO */ | |||||
Not Done Inline Actionsfwiw we've used ARM64TODO in the past emaste: fwiw we've used ARM64TODO in the past | |||||
#else | #else | ||||
#error Unsupported architecture | #error Unsupported architecture | ||||
#endif | #endif | ||||
} | } | ||||
static void | static void | ||||
elf_convert_siginfo(struct siginfo32 *sid, siginfo_t *sis) | elf_convert_siginfo(struct siginfo32 *sid, siginfo_t *sis) | ||||
{ | { | ||||
Show All 35 Lines |
I think you want to use rs->x[13] here. The comment in fill_regs32 in sys/arm64/arm64/machdep.c is useful: /* For arm32, SP is r13 and LR is r14 */
You probably also want to set r_lr to rs->x14.