Skip to content

Commit 1a5b641

Browse files
committed
Support arm64 core dump
Fixes BZ #405722. Implements coredump-elf.c fill_prstatus() and fill_fpu () for VGP_arm64_linux.
1 parent 46e02be commit 1a5b641

File tree

2 files changed

+69
-3
lines changed

2 files changed

+69
-3
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ where XXXXXX is the bug number as listed below.
126126
of the 64-bit destination field.
127127
405734 PPC64, vrlwnm, vrlwmi, vrldrm, vrldmi do not work properly when me < mb
128128
405782 "VEX temporary storage exhausted" when attempting to debug slic3r-pe
129+
405722 Support arm64 core dump
129130

130131
n-i-bz add syswrap for PTRACE_GET|SET_THREAD_AREA on amd64.
131132
n-i-bz Fix callgrind_annotate non deterministic order for equal total

coregrind/m_coredump/coredump-elf.c

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,40 @@ static void fill_prstatus(const ThreadState *tst,
380380
regs->ARM_cpsr = LibVEX_GuestARM_get_cpsr( &arch->vex );
381381

382382
#elif defined(VGP_arm64_linux)
383-
(void)arch;
384-
I_die_here;
383+
regs->regs[0] = arch->vex.guest_X0;
384+
regs->regs[1] = arch->vex.guest_X1;
385+
regs->regs[2] = arch->vex.guest_X2;
386+
regs->regs[3] = arch->vex.guest_X3;
387+
regs->regs[4] = arch->vex.guest_X4;
388+
regs->regs[5] = arch->vex.guest_X5;
389+
regs->regs[6] = arch->vex.guest_X6;
390+
regs->regs[7] = arch->vex.guest_X7;
391+
regs->regs[8] = arch->vex.guest_X8;
392+
regs->regs[9] = arch->vex.guest_X9;
393+
regs->regs[10] = arch->vex.guest_X10;
394+
regs->regs[11] = arch->vex.guest_X11;
395+
regs->regs[12] = arch->vex.guest_X12;
396+
regs->regs[13] = arch->vex.guest_X13;
397+
regs->regs[14] = arch->vex.guest_X14;
398+
regs->regs[15] = arch->vex.guest_X15;
399+
regs->regs[16] = arch->vex.guest_X16;
400+
regs->regs[17] = arch->vex.guest_X17;
401+
regs->regs[18] = arch->vex.guest_X18;
402+
regs->regs[19] = arch->vex.guest_X19;
403+
regs->regs[20] = arch->vex.guest_X20;
404+
regs->regs[21] = arch->vex.guest_X21;
405+
regs->regs[22] = arch->vex.guest_X22;
406+
regs->regs[23] = arch->vex.guest_X23;
407+
regs->regs[24] = arch->vex.guest_X24;
408+
regs->regs[25] = arch->vex.guest_X25;
409+
regs->regs[26] = arch->vex.guest_X26;
410+
regs->regs[27] = arch->vex.guest_X27;
411+
regs->regs[28] = arch->vex.guest_X28;
412+
regs->regs[29] = arch->vex.guest_X29;
413+
regs->regs[30] = arch->vex.guest_X30;
414+
regs->sp = arch->vex.guest_XSP;
415+
regs->pc = arch->vex.guest_PC;
416+
regs->pstate = LibVEX_GuestARM64_get_nzcv( &arch->vex ); /* is this correct? */
385417

386418
#elif defined(VGP_s390x_linux)
387419
# define DO(n) regs->gprs[n] = arch->vex.guest_r##n
@@ -492,7 +524,40 @@ static void fill_fpu(const ThreadState *tst, vki_elf_fpregset_t *fpu)
492524
// umm ...
493525

494526
#elif defined(VGP_arm64_linux)
495-
I_die_here;
527+
fpu->vregs[0] = *(const __uint128_t*)arch->vex.guest_Q0;
528+
fpu->vregs[1] = *(const __uint128_t*)arch->vex.guest_Q1;
529+
fpu->vregs[2] = *(const __uint128_t*)arch->vex.guest_Q2;
530+
fpu->vregs[3] = *(const __uint128_t*)arch->vex.guest_Q3;
531+
fpu->vregs[4] = *(const __uint128_t*)arch->vex.guest_Q4;
532+
fpu->vregs[5] = *(const __uint128_t*)arch->vex.guest_Q5;
533+
fpu->vregs[6] = *(const __uint128_t*)arch->vex.guest_Q6;
534+
fpu->vregs[7] = *(const __uint128_t*)arch->vex.guest_Q7;
535+
fpu->vregs[8] = *(const __uint128_t*)arch->vex.guest_Q8;
536+
fpu->vregs[9] = *(const __uint128_t*)arch->vex.guest_Q9;
537+
fpu->vregs[10] = *(const __uint128_t*)arch->vex.guest_Q10;
538+
fpu->vregs[11] = *(const __uint128_t*)arch->vex.guest_Q11;
539+
fpu->vregs[12] = *(const __uint128_t*)arch->vex.guest_Q12;
540+
fpu->vregs[13] = *(const __uint128_t*)arch->vex.guest_Q13;
541+
fpu->vregs[14] = *(const __uint128_t*)arch->vex.guest_Q14;
542+
fpu->vregs[15] = *(const __uint128_t*)arch->vex.guest_Q15;
543+
fpu->vregs[16] = *(const __uint128_t*)arch->vex.guest_Q16;
544+
fpu->vregs[17] = *(const __uint128_t*)arch->vex.guest_Q17;
545+
fpu->vregs[18] = *(const __uint128_t*)arch->vex.guest_Q18;
546+
fpu->vregs[19] = *(const __uint128_t*)arch->vex.guest_Q19;
547+
fpu->vregs[20] = *(const __uint128_t*)arch->vex.guest_Q20;
548+
fpu->vregs[21] = *(const __uint128_t*)arch->vex.guest_Q21;
549+
fpu->vregs[22] = *(const __uint128_t*)arch->vex.guest_Q22;
550+
fpu->vregs[23] = *(const __uint128_t*)arch->vex.guest_Q23;
551+
fpu->vregs[24] = *(const __uint128_t*)arch->vex.guest_Q24;
552+
fpu->vregs[25] = *(const __uint128_t*)arch->vex.guest_Q25;
553+
fpu->vregs[26] = *(const __uint128_t*)arch->vex.guest_Q26;
554+
fpu->vregs[27] = *(const __uint128_t*)arch->vex.guest_Q27;
555+
fpu->vregs[28] = *(const __uint128_t*)arch->vex.guest_Q28;
556+
fpu->vregs[29] = *(const __uint128_t*)arch->vex.guest_Q29;
557+
fpu->vregs[30] = *(const __uint128_t*)arch->vex.guest_Q30;
558+
fpu->vregs[31] = *(const __uint128_t*)arch->vex.guest_Q31;
559+
fpu->fpsr = *(const __vki_u32*)arch->vex.guest_QCFLAG;
560+
fpu->fpcr = arch->vex.guest_FPCR;
496561

497562
#elif defined(VGP_s390x_linux)
498563
/* NOTE: The 16 FP registers map to the first 16 VSX registers. */

0 commit comments

Comments
 (0)