From 6a5ab68d56c596bf74a94202a86e35c33127a536 Mon Sep 17 00:00:00 2001 From: "ted.mielczarek@gmail.com" Date: Tue, 18 Sep 2012 13:55:17 +0000 Subject: Allow generating minidumps from live processes on Windows. R=mark at https://breakpad.appspot.com/115002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1042 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/windows/handler/exception_handler.h | 30 ++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'src/client/windows/handler/exception_handler.h') diff --git a/src/client/windows/handler/exception_handler.h b/src/client/windows/handler/exception_handler.h index b7f1f949..c1945e1e 100644 --- a/src/client/windows/handler/exception_handler.h +++ b/src/client/windows/handler/exception_handler.h @@ -221,6 +221,17 @@ class ExceptionHandler { static bool WriteMinidump(const wstring &dump_path, MinidumpCallback callback, void* callback_context); + // Write a minidump of |child| immediately. This can be used to + // capture the execution state of |child| independently of a crash. + // Pass a meaningful |child_blamed_thread| to make that thread in + // the child process the one from which a crash signature is + // extracted. + static bool WriteMinidumpForChild(HANDLE child, + DWORD child_blamed_thread, + const wstring& dump_path, + MinidumpCallback callback, + void* callback_context); + // Get the thread ID of the thread requesting the dump (either the exception // thread or any other thread that called WriteMinidump directly). This // may be useful if you want to include additional thread state in your @@ -305,8 +316,9 @@ class ExceptionHandler { bool WriteMinidumpOnHandlerThread(EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo* assertion); - // This function does the actual writing of a minidump. It is called - // on the handler thread. requesting_thread_id is the ID of the thread + // This function is called on the handler thread. It calls into + // WriteMinidumpWithExceptionForProcess() with a handle to the + // current process. requesting_thread_id is the ID of the thread // that requested the dump. If the dump is requested as a result of // an exception, exinfo contains exception information, otherwise, // it is NULL. @@ -321,6 +333,20 @@ class ExceptionHandler { const PMINIDUMP_CALLBACK_INPUT callback_input, PMINIDUMP_CALLBACK_OUTPUT callback_output); + // This function does the actual writing of a minidump. It is + // called on the handler thread. requesting_thread_id is the ID of + // the thread that requested the dump, if that information is + // meaningful. If the dump is requested as a result of an + // exception, exinfo contains exception information, otherwise, it + // is NULL. process is the one that will be dumped. If + // requesting_thread_id is meaningful and should be added to the + // minidump, write_requester_stream is |true|. + bool WriteMinidumpWithExceptionForProcess(DWORD requesting_thread_id, + EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion, + HANDLE process, + bool write_requester_stream); + // Generates a new ID and stores it in next_minidump_id_, and stores the // path of the next minidump to be written in next_minidump_path_. void UpdateNextID(); -- cgit v1.2.1