Add NetBSD support in sanitizer_unwind_linux_libcdep.cc

Summary:
NetBSD is a POSIX-like and BSD-family system.

Reuse FreeBSD and Linux code.

NetBSD uses DWARF ExceptionHandler.

Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, kcc, filcab, vitalybuka

Reviewed By: vitalybuka

Subscribers: srhines, emaste, llvm-commits, kubamracek, aprantl, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D36314

llvm-svn: 310179
This commit is contained in:
Kamil Rytarowski 2017-08-05 13:36:49 +00:00
parent 414d00139b
commit 4c69d68ea0
1 changed files with 5 additions and 4 deletions

View File

@ -8,11 +8,11 @@
//===----------------------------------------------------------------------===//
//
// This file contains the unwind.h-based (aka "slow") stack unwinding routines
// available to the tools on Linux, Android, and FreeBSD.
// available to the tools on Linux, Android, NetBSD and FreeBSD.
//===----------------------------------------------------------------------===//
#include "sanitizer_platform.h"
#if SANITIZER_FREEBSD || SANITIZER_LINUX
#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
#include "sanitizer_common.h"
#include "sanitizer_stacktrace.h"
@ -78,7 +78,8 @@ void SanitizerInitializeUnwinder() {
}
#endif
#ifdef __arm__
#if defined(__arm__) && !SANITIZER_NETBSD
// NetBSD uses dwarf EH
#define UNWIND_STOP _URC_END_OF_STACK
#define UNWIND_CONTINUE _URC_NO_REASON
#else
@ -165,4 +166,4 @@ void BufferedStackTrace::SlowUnwindStackWithContext(uptr pc, void *context,
} // namespace __sanitizer
#endif // SANITIZER_FREEBSD || SANITIZER_LINUX
#endif // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD