forked from yrp604/rappel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
display_arm.c
47 lines (38 loc) · 1.77 KB
/
display_arm.c
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
#include <stdio.h>
#include "common.h"
#include "display.h"
extern struct options_t options;
void display_arm(
const struct proc_info_t *const info)
{
const struct user_regs_arm *regs = &info->regs_struct;
const struct user_fpregs_arm *fpregs = &info->fpregs_struct;
if (options.allregs) printf("GP Regs:\n");
printf("R0 :" REGFMT32 "\tR1 :" REGFMT32 "\tR2 :" REGFMT32 " \tR3 :" REGFMT32"\n",
regs->uregs[0], regs->uregs[1], regs->uregs[2], regs->uregs[3]);
printf("R4 :" REGFMT32 "\tR5 :" REGFMT32 "\tR6 :" REGFMT32 " \tR7 :" REGFMT32"\n",
regs->uregs[4], regs->uregs[5], regs->uregs[6], regs->uregs[7]);
printf("R8 :" REGFMT32 "\tR9 :" REGFMT32 "\tR10:" REGFMT32 "\n",
regs->uregs[8], regs->uregs[9], regs->uregs[10]);
printf("FP :" REGFMT32 "\tIP :" REGFMT32 "\n", regs->uregs[11], regs->uregs[12]);
printf("SP :" REGFMT32 "\tLR :" REGFMT32 " \tPC :" REGFMT32"\n",
regs->uregs[13], regs->uregs[14], regs->uregs[15]);
printf("APSR:" REGFMT32 "\n", regs->uregs[16]);
if (options.allregs) {
printf("FP Regs:\n");
printf("fpsr:" REGFMT32"\tfpcr:" REGFMT32 "\tinit_flag: " REGFMT32 "\n", fpregs->fpsr, fpregs->fpcr, fpregs->init_flag);
printf("ftype:");
for (uint32_t i = 0; i < 8; ++i)
printf(REGFMT8 " ", fpregs->ftype[i]);
printf("\n");
for (uint32_t i = 0; i < 8; ++i)
printf("fpreg %d: sign1 %d sign2 %d exponent " REGFMT16 " j %d mantissa1 " REGFMT32 " mantissa0 " REGFMT32 "\n",
i, fpregs->fpregs[i].sign1, fpregs->fpregs[i].sign2, fpregs->fpregs[i].exponent, fpregs->fpregs[i].j,
fpregs->fpregs[i].mantissa1, fpregs->fpregs[i].mantissa0);
}
// 5 is sigtrap, which is expected, -1 is initial value
if (info->sig != 5 && info->sig != -1) {
printf("Process died with signal: %d\n", info->sig);
printf("Exited: %ld\n", info->exit_code);
}
}