forked from ppy/osu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrash_handler.h
More file actions
21 lines (18 loc) · 1.01 KB
/
Copy pathcrash_handler.h
File metadata and controls
21 lines (18 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#pragma once
extern "C" {
// Install a process-wide native crash handler. `logPath` is the absolute
// path of the file the dump will be appended to (typically the app's
// external files directory). Pass nullptr to log only to logcat.
// Idempotent: subsequent calls after the first are no-ops.
void nInstallCrashHandler(const char* logPath);
// Re-install the signal handlers, even if a previous install already ran.
// Use this after the Mono runtime is fully up so our handler chains *on top
// of* Mono's SIGSEGV handler — otherwise Mono intercepts JIT-NRE faults
// first and re-raises via `tgkill` (which appears in tombstones as
// `si_code = SI_TKILL`), bypassing our dump entirely. The previously-saved
// "previous handler" slot is overwritten with whatever is currently
// installed (typically Mono's), so chaining still works.
void nReinstallCrashHandler();
}