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
0e8d469f
Unverified
Commit
0e8d469f
authored
Aug 18, 2021
by
yoav-steinberg
Committed by
GitHub
Aug 18, 2021
Browse files
More generic crash report for unsupported archs (#9385)
Following compilation warnings on s390x.
parent
fe359cbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/debug.c
View file @
0e8d469f
...
...
@@ -1024,6 +1024,10 @@ void bugReportStart(void) {
#ifdef HAVE_BACKTRACE
static void *getMcontextEip(ucontext_t *uc) {
#define NOT_SUPPORTED() do {\
UNUSED(uc);\
return NULL;\
} while(0)
#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
/* OSX < 10.6 */
#if defined(__x86_64__)
...
...
@@ -1055,6 +1059,8 @@ static void *getMcontextEip(ucontext_t *uc) {
return (void*) uc->uc_mcontext.arm_pc;
#elif defined(__aarch64__) /* Linux AArch64 */
return (void*) uc->uc_mcontext.pc;
#else
NOT_SUPPORTED();
#endif
#elif defined(__FreeBSD__)
/* FreeBSD */
...
...
@@ -1062,6 +1068,8 @@ static void *getMcontextEip(ucontext_t *uc) {
return (void*) uc->uc_mcontext.mc_eip;
#elif defined(__x86_64__)
return (void*) uc->uc_mcontext.mc_rip;
#else
NOT_SUPPORTED();
#endif
#elif defined(__OpenBSD__)
/* OpenBSD */
...
...
@@ -1069,18 +1077,23 @@ static void *getMcontextEip(ucontext_t *uc) {
return (void*) uc->sc_eip;
#elif defined(__x86_64__)
return (void*) uc->sc_rip;
#else
NOT_SUPPORTED();
#endif
#elif defined(__NetBSD__)
#if defined(__i386__)
return (void*) uc->uc_mcontext.__gregs[_REG_EIP];
#elif defined(__x86_64__)
return (void*) uc->uc_mcontext.__gregs[_REG_RIP];
#else
NOT_SUPPORTED();
#endif
#elif defined(__DragonFly__)
return (void*) uc->uc_mcontext.mc_rip;
#else
return
NULL
;
NOT_SUPPORTED()
;
#endif
#undef NOT_SUPPORTED
}
void logStackContent(void **sp) {
...
...
@@ -1099,6 +1112,11 @@ void logStackContent(void **sp) {
/* Log dump of processor registers */
void logRegisters(ucontext_t *uc) {
serverLog(LL_WARNING|LL_RAW, "\n------ REGISTERS ------\n");
#define NOT_SUPPORTED() do {\
UNUSED(uc);\
serverLog(LL_WARNING,\
" Dumping of registers not supported for this OS/arch");\
} while(0)
/* OSX */
#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6)
...
...
@@ -1323,6 +1341,8 @@ void logRegisters(ucontext_t *uc) {
(unsigned long) uc->uc_mcontext.fault_address
);
logStackContent((void**)uc->uc_mcontext.arm_sp);
#else
NOT_SUPPORTED();
#endif
#elif defined(__FreeBSD__)
#if defined(__x86_64__)
...
...
@@ -1378,6 +1398,8 @@ void logRegisters(ucontext_t *uc) {
(unsigned long) uc->uc_mcontext.mc_gs
);
logStackContent((void**)uc->uc_mcontext.mc_esp);
#else
NOT_SUPPORTED();
#endif
#elif defined(__OpenBSD__)
#if defined(__x86_64__)
...
...
@@ -1433,6 +1455,8 @@ void logRegisters(ucontext_t *uc) {
(unsigned long) uc->sc_gs
);
logStackContent((void**)uc->sc_esp);
#else
NOT_SUPPORTED();
#endif
#elif defined(__NetBSD__)
#if defined(__x86_64__)
...
...
@@ -1486,6 +1510,8 @@ void logRegisters(ucontext_t *uc) {
(unsigned long) uc->uc_mcontext.__gregs[_REG_FS],
(unsigned long) uc->uc_mcontext.__gregs[_REG_GS]
);
#else
NOT_SUPPORTED();
#endif
#elif defined(__DragonFly__)
serverLog(LL_WARNING,
...
...
@@ -1517,9 +1543,9 @@ void logRegisters(ucontext_t *uc) {
);
logStackContent((void**)uc->uc_mcontext.mc_rsp);
#else
serverLog
(
LL_WARNING
,
" Dumping of registers not supported for this OS/arch"
);
NOT_SUPPORTED();
#endif
#undef NOT_SUPPORTED
}
#endif /* HAVE_BACKTRACE */
...
...
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