Ensure that art_sigsegv_fault is never inlined
We were incorrectly inlining the art_sigsegv_fault function into
FaultManager::HandleFault. This is a problem because we want native
debuggers to break on this function instead of stopping on SIGSEGV,
since we use those for various internal functions. By setting the
art_sigsegv_fault function to be NO_INLINE we should not have this
problem.
Test: Manual inspection of libart.so
Bug: 77528455
Change-Id: I77753cf79966011d7bfbea056bb4efc3f55d64df
diff --git a/runtime/fault_handler.cc b/runtime/fault_handler.cc
index 3015b10..671079b 100644
--- a/runtime/fault_handler.cc
+++ b/runtime/fault_handler.cc
@@ -37,7 +37,9 @@
// Static fault manger object accessed by signal handler.
FaultManager fault_manager;
-extern "C" __attribute__((visibility("default"))) void art_sigsegv_fault() {
+// This needs to be NO_INLINE since some debuggers do not read the inline-info to set a breakpoint
+// if it isn't.
+extern "C" NO_INLINE __attribute__((visibility("default"))) void art_sigsegv_fault() {
// Set a breakpoint here to be informed when a SIGSEGV is unhandled by ART.
VLOG(signals)<< "Caught unknown SIGSEGV in ART fault handler - chaining to next handler.";
}