[email protected] | 5a8d4ce | 2013-12-18 17:42:27 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef BASE_DEBUG_DUMP_WITHOUT_CRASHING_H_ |
| 6 | #define BASE_DEBUG_DUMP_WITHOUT_CRASHING_H_ |
| 7 | |
| 8 | #include "base/base_export.h" |
| 9 | #include "base/compiler_specific.h" |
| 10 | #include "build/build_config.h" |
| 11 | |
| 12 | namespace base { |
| 13 | |
| 14 | namespace debug { |
| 15 | |
| 16 | // Handler to silently dump the current process without crashing. |
[email protected] | f0e90cf9 | 2014-07-21 17:13:58 | [diff] [blame] | 17 | // Before calling this function, call SetDumpWithoutCrashingFunction to pass a |
wfh | 9384627 | 2017-06-28 11:50:47 | [diff] [blame^] | 18 | // function pointer. |
| 19 | // Windows: |
| 20 | // This must be done for each instance of base (i.e. module) and is normally |
| 21 | // chrome_elf!DumpProcessWithoutCrash. See example code in chrome_main.cc that |
| 22 | // does this for chrome.dll and chrome_child.dll. Note: Crashpad sets this up |
| 23 | // for main chrome.exe as part of calling crash_reporter::InitializeCrashpad. |
| 24 | // Mac/Linux: |
| 25 | // Crashpad does this as part of crash_reporter::InitializeCrashpad. |
wez | b827921 | 2017-01-17 22:50:56 | [diff] [blame] | 26 | // Returns false if called before SetDumpWithoutCrashingFunction. |
| 27 | BASE_EXPORT bool DumpWithoutCrashing(); |
[email protected] | 5a8d4ce | 2013-12-18 17:42:27 | [diff] [blame] | 28 | |
| 29 | // Sets a function that'll be invoked to dump the current process when |
| 30 | // DumpWithoutCrashing() is called. |
| 31 | BASE_EXPORT void SetDumpWithoutCrashingFunction(void (CDECL *function)()); |
| 32 | |
| 33 | } // namespace debug |
| 34 | |
| 35 | } // namespace base |
| 36 | |
| 37 | #endif // BASE_DEBUG_DUMP_WITHOUT_CRASHING_H_ |