Skip to content

Commit 98fe39d

Browse files
author
Kostya Kortchinsky
committed
[GWP-ASan] Stub out backtrace/signal functions on Fuchsia
The initial version of GWP-ASan on Fuchsia doesn't support crash and signal handlers, so this just adds empty stubs to be able to compile the project on the platform. Differential Revision: https://reviews.llvm.org/D90537
1 parent 5ece211 commit 98fe39d

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- backtrace_fuchsia.cpp -----------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "gwp_asan/optional/backtrace.h"
10+
11+
// GWP-ASan on Fuchsia doesn't currently support backtraces.
12+
13+
namespace gwp_asan {
14+
namespace options {
15+
Backtrace_t getBacktraceFunction() { return nullptr; }
16+
crash_handler::PrintBacktrace_t getPrintBacktraceFunction() { return nullptr; }
17+
} // namespace options
18+
19+
namespace crash_handler {
20+
SegvBacktrace_t getSegvBacktraceFunction() { return nullptr; }
21+
} // namespace crash_handler
22+
} // namespace gwp_asan
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- segv_handler_fuchsia.cpp --------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "gwp_asan/optional/segv_handler.h"
10+
11+
// GWP-ASan on Fuchsia doesn't currently support signal handlers.
12+
13+
namespace gwp_asan {
14+
namespace crash_handler {
15+
void installSignalHandlers(gwp_asan::GuardedPoolAllocator * /* GPA */,
16+
Printf_t /* Printf */,
17+
PrintBacktrace_t /* PrintBacktrace */,
18+
SegvBacktrace_t /* SegvBacktrace */) {}
19+
20+
void uninstallSignalHandlers() {}
21+
} // namespace crash_handler
22+
} // namespace gwp_asan

0 commit comments

Comments
 (0)