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
88351275
Unverified
Commit
88351275
authored
Apr 02, 2020
by
Salvatore Sanfilippo
Committed by
GitHub
Apr 02, 2020
Browse files
Merge pull request #6960 from devnexen/debug_arm_linux
debug, dump registers on arm too.
parents
fa4f5073
65481572
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/debug.c
View file @
88351275
...
...
@@ -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