sdlprocdump: remove dead code

This commit is contained in:
Anonymous Maarten
2024-07-12 12:02:17 +02:00
parent bd041b4831
commit ca36f6c43b
+2 -6
View File
@@ -180,6 +180,7 @@ static const char *exceptionFlags_to_string(DWORD dwFlags, char *buffer, size_t
} }
FOREACH_EXCEPTION_FLAGS(APPEND_OR_STR) FOREACH_EXCEPTION_FLAGS(APPEND_OR_STR)
#undef APPEND_OR_STR
return buffer; return buffer;
} }
@@ -224,7 +225,6 @@ static void write_minidump(const char *child_file_path, const LPPROCESS_INFORMAT
char child_file_name[64]; char child_file_name[64];
EXCEPTION_POINTERS exception_pointers; EXCEPTION_POINTERS exception_pointers;
HANDLE hFile = INVALID_HANDLE_VALUE; HANDLE hFile = INVALID_HANDLE_VALUE;
HMODULE dbghelp_module = NULL;
MINIDUMP_EXCEPTION_INFORMATION minidump_exception_information; MINIDUMP_EXCEPTION_INFORMATION minidump_exception_information;
SYSTEMTIME system_time; SYSTEMTIME system_time;
@@ -280,9 +280,6 @@ post_dump:
if (hFile != INVALID_HANDLE_VALUE) { if (hFile != INVALID_HANDLE_VALUE) {
CloseHandle(hFile); CloseHandle(hFile);
} }
if (dbghelp_module != NULL) {
FreeLibrary(dbghelp_module);
}
} }
static void print_stacktrace(const LPPROCESS_INFORMATION process_information, PCONTEXT context, LPVOID address) { static void print_stacktrace(const LPPROCESS_INFORMATION process_information, PCONTEXT context, LPVOID address) {
@@ -533,7 +530,7 @@ int main(int argc, char *argv[]) {
DWORD continue_status = DBG_CONTINUE; DWORD continue_status = DBG_CONTINUE;
success = WaitForDebugEvent(&event, INFINITE); success = WaitForDebugEvent(&event, INFINITE);
if (!success) { if (!success) {
printf_message("Failed to get a debug event"); printf_windows_message("Failed to get a debug event");
return 1; return 1;
} }
switch (event.dwDebugEventCode) { switch (event.dwDebugEventCode) {
@@ -591,7 +588,6 @@ int main(int argc, char *argv[]) {
} }
break; break;
case EXIT_PROCESS_DEBUG_EVENT: case EXIT_PROCESS_DEBUG_EVENT:
exit_code = event.u.ExitProcess.dwExitCode;
if (event.dwProcessId == process_information.dwProcessId) { if (event.dwProcessId == process_information.dwProcessId) {
process_alive = 0; process_alive = 0;
DebugActiveProcessStop(event.dwProcessId); DebugActiveProcessStop(event.dwProcessId);