Skip to content

Commit

Permalink
Print the NTSTATUS name next to the process exit code
Browse files Browse the repository at this point in the history
See #2874
  • Loading branch information
mrexodia committed May 18, 2022
1 parent 101f4ae commit c7aeda7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/dbg/debugger.cpp
Expand Up @@ -1546,7 +1546,18 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo)

static void cbExitProcess(EXIT_PROCESS_DEBUG_INFO* ExitProcess)
{
dprintf(QT_TRANSLATE_NOOP("DBG", "Process stopped with exit code 0x%X\n"), ExitProcess->dwExitCode);
{
auto exitCode = ExitProcess->dwExitCode;
auto exitDescription = StringUtils::sprintf("0x%X (%d)", exitCode, exitCode);
if((exitCode & 0x80000000) != 0)
{
auto statusName = NtStatusCodeToName(exitCode);
if(!statusName.empty())
exitDescription = StringUtils::sprintf("0x%X (%s)", exitCode, statusName.c_str());
}
dprintf(QT_TRANSLATE_NOOP("DBG", "Process stopped with exit code %s\n"), exitDescription.c_str());
}

const bool breakHere = settingboolget("Events", "NtTerminateProcess");
if(breakHere)
{
Expand Down

0 comments on commit c7aeda7

Please sign in to comment.