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
65481572
Commit
65481572
authored
Mar 07, 2020
by
David Carlier
Browse files
debug, dump registers on arm too.
parent
13707f98
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/debug.c
View file @
65481572
...
@@ -1045,6 +1045,61 @@ void logRegisters(ucontext_t *uc) {
...
@@ -1045,6 +1045,61 @@ void logRegisters(ucontext_t *uc) {
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
18
]
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
18
]
);
);
logStackContent
((
void
**
)
uc
->
uc_mcontext
.
gregs
[
15
]);
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
#endif
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__)
#if defined(__x86_64__)
#if defined(__x86_64__)
...
@@ -1185,33 +1240,6 @@ void logRegisters(ucontext_t *uc) {
...
@@ -1185,33 +1240,6 @@ void logRegisters(ucontext_t *uc) {
(
unsigned
long
)
uc
->
uc_mcontext
.
mc_cs
(
unsigned
long
)
uc
->
uc_mcontext
.
mc_cs
);
);
logStackContent
((
void
**
)
uc
->
uc_mcontext
.
mc_rsp
);
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
#else
serverLog
(
LL_WARNING
,
serverLog
(
LL_WARNING
,
" Dumping of registers not supported for this OS/arch"
);
" 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