aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux/handler/exception_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/linux/handler/exception_handler.cc')
-rw-r--r--src/client/linux/handler/exception_handler.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
index 73c3bdfb..61dc2a1a 100644
--- a/src/client/linux/handler/exception_handler.cc
+++ b/src/client/linux/handler/exception_handler.cc
@@ -323,6 +323,16 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) {
return GenerateDump(&context);
}
+// This is a public interface to HandleSignal that allows the client to
+// generate a crash dump. This function may run in a compromised context.
+bool ExceptionHandler::SimulateSignalDelivery(int sig) {
+ siginfo_t siginfo;
+ my_memset(&siginfo, 0, sizeof(siginfo_t));
+ struct ucontext context;
+ getcontext(&context);
+ return HandleSignal(sig, &siginfo, &context);
+}
+
// This function may run in a compromised context: see the top of the file.
bool ExceptionHandler::GenerateDump(CrashContext *context) {
if (IsOutOfProcess())