File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ void init_module(py::module m)
1010 m.def (
1111 " install" ,
1212 &Amulet::faulthandler::install,
13- py::arg (" path" ));
13+ py::arg (" path" ),
14+ py::arg (" full_dump" ));
1415}
1516
1617PYBIND11_MODULE (_faulthandler, m)
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ void dump_stack(EXCEPTION_POINTERS* p)
8383}
8484
8585static std::wstring _path;
86+ static bool _full_dump = false ;
8687
8788void dump_process (EXCEPTION_POINTERS* p)
8889{
@@ -99,13 +100,13 @@ void dump_process(EXCEPTION_POINTERS* p)
99100 MINIDUMP_EXCEPTION_INFORMATION info;
100101 info.ThreadId = GetCurrentThreadId ();
101102 info.ExceptionPointers = p;
102- info.ClientPointers = FALSE ;
103+ info.ClientPointers = TRUE ;
103104
104105 MiniDumpWriteDump (
105106 GetCurrentProcess (),
106107 GetCurrentProcessId (),
107108 dump_handle,
108- MiniDumpWithFullMemory,
109+ _full_dump ? MiniDumpWithFullMemory : MiniDumpNormal ,
109110 &info,
110111 nullptr ,
111112 nullptr );
@@ -122,9 +123,10 @@ LONG WINAPI CrashHandler(EXCEPTION_POINTERS* p)
122123
123124namespace Amulet {
124125namespace faulthandler {
125- void install (std::filesystem::path path)
126+ void install (std::filesystem::path path, bool full_dump )
126127 {
127128 _path = path.wstring ();
129+ _full_dump = full_dump;
128130 SetUnhandledExceptionFilter (CrashHandler);
129131 }
130132}
@@ -134,7 +136,7 @@ namespace faulthandler {
134136
135137namespace Amulet {
136138namespace faulthandler {
137- void install (std::filesystem::path path)
139+ void install (std::filesystem::path path, bool full_dump )
138140 {
139141 }
140142}
Original file line number Diff line number Diff line change 44
55namespace Amulet {
66namespace faulthandler {
7- void install (std::filesystem::path path);
7+ void install (std::filesystem::path path, bool full_dump );
88}
99}
You can’t perform that action at this time.
0 commit comments