@@ -2716,23 +2716,32 @@ PAL_GenerateCoreDump(
27162716Parameters:
27172717 signal - POSIX signal number
27182718 siginfo - POSIX signal info or nullptr
2719+ context - signal context or nullptr
27192720 serialize - allow only one thread to generate core dump
27202721
27212722(no return value)
27222723--*/
27232724#ifdef HOST_ANDROID
27242725#include < minipal/log.h>
27252726VOID
2726- PROCCreateCrashDumpIfEnabled (int signal, siginfo_t * siginfo, bool serialize)
2727+ PROCCreateCrashDumpIfEnabled (int signal, siginfo_t * siginfo, void * context, bool serialize)
27272728{
2729+ // Store context in a volatile variable to prevent optimization
2730+ volatile void * volatileContext = context;
2731+ (void )volatileContext;
2732+
27282733 // TODO: Dump all managed threads callstacks into logcat and/or file?
27292734 // TODO: Dump stress log into logcat and/or file when enabled?
27302735 minipal_log_write_fatal (" Aborting process.\n " );
27312736}
27322737#else
27332738VOID
2734- PROCCreateCrashDumpIfEnabled (int signal, siginfo_t * siginfo, bool serialize)
2739+ PROCCreateCrashDumpIfEnabled (int signal, siginfo_t * siginfo, void * context, bool serialize)
27352740{
2741+ // Store context in a volatile variable to prevent optimization
2742+ volatile void * volatileContext = context;
2743+ (void )volatileContext;
2744+
27362745 // If enabled, launch the create minidump utility and wait until it completes
27372746 if (!g_argvCreateDump.empty ())
27382747 {
@@ -2821,7 +2830,7 @@ PROCAbort(int signal, siginfo_t* siginfo)
28212830 // Do any shutdown cleanup before aborting or creating a core dump
28222831 PROCNotifyProcessShutdown ();
28232832
2824- PROCCreateCrashDumpIfEnabled (signal, siginfo, true );
2833+ PROCCreateCrashDumpIfEnabled (signal, siginfo, nullptr , true );
28252834
28262835 // Restore all signals; the SIGABORT handler to prevent recursion and
28272836 // the others to prevent multiple core dumps from being generated.
0 commit comments