Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
15c9e79a
Commit
15c9e79a
authored
Mar 07, 2020
by
David Carlier
Committed by
antirez
Apr 07, 2020
Browse files
debug, dump registers on arm too.
parent
cd2b5df9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/debug.c
View file @
15c9e79a
...
...
@@ -1047,6 +1047,61 @@ void logRegisters(ucontext_t *uc) {
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
18
]
);
logStackContent
((
void
**
)
uc
->
uc_mcontext
.
gregs
[
15
]);
#elif defined(__aarch64__)
/* Linux AArch64 */
serverLog
(
LL_WARNING
,
"
\n
"
"X18:%016lx X19:%016lx
\n
X20:%016lx X21:%016lx
\n
"
"X22:%016lx X23:%016lx
\n
X24:%016lx X25:%016lx
\n
"
"X26:%016lx X27:%016lx
\n
X28:%016lx X29:%016lx
\n
"
"X30:%016lx
\n
"
"pc:%016lx sp:%016lx
\n
pstate:%016lx fault_address:%016lx
\n
"
,
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
18
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
19
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
20
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
21
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
22
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
23
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
24
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
25
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
26
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
27
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
28
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
29
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
30
],
(
unsigned
long
)
uc
->
uc_mcontext
.
pc
,
(
unsigned
long
)
uc
->
uc_mcontext
.
sp
,
(
unsigned
long
)
uc
->
uc_mcontext
.
pstate
,
(
unsigned
long
)
uc
->
uc_mcontext
.
fault_address
);
logStackContent
((
void
**
)
uc
->
uc_mcontext
.
sp
);
#elif defined(__arm__)
/* Linux ARM */
serverLog
(
LL_WARNING
,
"
\n
"
"R10:%016lx R9 :%016lx
\n
R8 :%016lx R7 :%016lx
\n
"
"R6 :%016lx R5 :%016lx
\n
R4 :%016lx R3 :%016lx
\n
"
"R2 :%016lx R1 :%016lx
\n
R0 :%016lx EC :%016lx
\n
"
"fp: %016lx ip:%016lx
\n
"
,
"pc:%016lx sp:%016lx
\n
cpsr:%016lx fault_address:%016lx
\n
"
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_r10
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_r9
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_r8
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_r7
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_r6
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_r5
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_r4
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_r3
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_r2
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_r1
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_r0
,
(
unsigned
long
)
uc
->
uc_mcontext
.
error_code
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_fp
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_ip
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_pc
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_sp
,
(
unsigned
long
)
uc
->
uc_mcontext
.
arm_cpsr
,
(
unsigned
long
)
uc
->
uc_mcontext
.
fault_address
);
logStackContent
((
void
**
)
uc
->
uc_mcontext
.
arm_sp
);
#endif
#elif defined(__FreeBSD__)
#if defined(__x86_64__)
...
...
@@ -1187,33 +1242,6 @@ void logRegisters(ucontext_t *uc) {
(
unsigned
long
)
uc
->
uc_mcontext
.
mc_cs
);
logStackContent
((
void
**
)
uc
->
uc_mcontext
.
mc_rsp
);
#elif defined(__aarch64__)
/* Linux AArch64 */
serverLog
(
LL_WARNING
,
"
\n
"
"X18:%016lx X19:%016lx
\n
X20:%016lx X21:%016lx
\n
"
"X22:%016lx X23:%016lx
\n
X24:%016lx X25:%016lx
\n
"
"X26:%016lx X27:%016lx
\n
X28:%016lx X29:%016lx
\n
"
"X30:%016lx
\n
"
"pc:%016lx sp:%016lx
\n
pstate:%016lx fault_address:%016lx
\n
"
,
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
18
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
19
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
20
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
21
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
22
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
23
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
24
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
25
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
26
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
27
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
28
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
29
],
(
unsigned
long
)
uc
->
uc_mcontext
.
regs
[
30
],
(
unsigned
long
)
uc
->
uc_mcontext
.
pc
,
(
unsigned
long
)
uc
->
uc_mcontext
.
sp
,
(
unsigned
long
)
uc
->
uc_mcontext
.
pstate
,
(
unsigned
long
)
uc
->
uc_mcontext
.
fault_address
);
logStackContent
((
void
**
)
uc
->
uc_mcontext
.
sp
);
#else
serverLog
(
LL_WARNING
,
" Dumping of registers not supported for this OS/arch"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment