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
ff808090
Unverified
Commit
ff808090
authored
Oct 02, 2022
by
David CARLIER
Committed by
GitHub
Oct 02, 2022
Browse files
register debug support on illumos/solaris. (#11335)
parent
3469c650
Changes
3
Show whitespace changes
Inline
Side-by-side
src/Makefile
View file @
ff808090
...
...
@@ -139,6 +139,9 @@ ifeq ($(uname_S),SunOS)
INSTALL
=
cp
-pf
FINAL_CFLAGS
+=
-D__EXTENSIONS__
-D_XPG6
FINAL_LIBS
+=
-ldl
-lnsl
-lsocket
-lresolv
-lpthread
-lrt
ifeq
($(USE_BACKTRACE),yes)
FINAL_CFLAGS
+=
-DUSE_BACKTRACE
endif
else
ifeq
($(uname_S),Darwin)
# Darwin
...
...
src/config.h
View file @
ff808090
...
...
@@ -72,7 +72,7 @@
/* Test for backtrace() */
#if defined(__APPLE__) || (defined(__linux__) && defined(__GLIBC__)) || \
defined(__FreeBSD__) || ((defined(__OpenBSD__) || defined(__NetBSD__)) && defined(USE_BACKTRACE))\
defined(__FreeBSD__) || ((defined(__OpenBSD__) || defined(__NetBSD__)
|| defined(__sun)
) && defined(USE_BACKTRACE))\
|| defined(__DragonFly__) || (defined(__UCLIBC__) && defined(__UCLIBC_HAS_BACKTRACE__))
#define HAVE_BACKTRACE 1
#endif
...
...
src/debug.c
View file @
ff808090
...
...
@@ -1205,6 +1205,8 @@ static void* getAndSetMcontextEip(ucontext_t *uc, void *eip) {
#endif
#elif defined(__DragonFly__)
GET_SET_RETURN
(
uc
->
uc_mcontext
.
mc_rip
,
eip
);
#elif defined(__sun) && defined(__x86_64__)
GET_SET_RETURN
(
uc
->
uc_mcontext
.
gregs
[
REG_RIP
],
eip
);
#else
NOT_SUPPORTED
();
#endif
...
...
@@ -1658,6 +1660,37 @@ void logRegisters(ucontext_t *uc) {
(
unsigned
long
)
uc
->
uc_mcontext
.
mc_cs
);
logStackContent
((
void
**
)
uc
->
uc_mcontext
.
mc_rsp
);
#elif defined(__sun)
#if defined(__x86_64__)
serverLog
(
LL_WARNING
,
"
\n
"
"RAX:%016lx RBX:%016lx
\n
RCX:%016lx RDX:%016lx
\n
"
"RDI:%016lx RSI:%016lx
\n
RBP:%016lx RSP:%016lx
\n
"
"R8 :%016lx R9 :%016lx
\n
R10:%016lx R11:%016lx
\n
"
"R12:%016lx R13:%016lx
\n
R14:%016lx R15:%016lx
\n
"
"RIP:%016lx EFL:%016lx
\n
CSGSFS:%016lx"
,
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_RAX
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_RBX
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_RCX
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_RDX
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_RDI
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_RSI
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_RBP
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_RSP
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_R8
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_R9
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_R10
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_R11
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_R12
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_R13
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_R14
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_R15
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_RIP
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_RFL
],
(
unsigned
long
)
uc
->
uc_mcontext
.
gregs
[
REG_CS
]
);
logStackContent
((
void
**
)
uc
->
uc_mcontext
.
gregs
[
REG_RSP
]);
#endif
#else
NOT_SUPPORTED
();
#endif
...
...
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