Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to silence OutputDebugString output #88

Merged
merged 2 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ Here's the how to use it:
-z write minidumps
-Z DIRECTORY write minidumps to specified directory
-H use debug heap
-q silence messages from OutputDebugString

## Frequently Asked Questions

Expand Down
8 changes: 6 additions & 2 deletions src/catchsegv/catchsegv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ Usage(void)
" -m ignore modal dialogs\n"
" -z write minidumps\n"
" -Z DIRECTORY write minidumps to specified directory\n"
" -H use debug heap\n",
" -H use debug heap\n"
" -q silence messages from OutputDebugString\n",
stderr);
}

Expand Down Expand Up @@ -264,7 +265,7 @@ wmain(int argc, wchar_t **argv)

bool debugHeap = false;
while (1) {
int opt = getoptW(argc, argv, L"?1dhHmt:zZ:v");
int opt = getoptW(argc, argv, L"?1dhHmt:zZ:vq");

switch (opt) {
case L'h':
Expand Down Expand Up @@ -295,6 +296,9 @@ wmain(int argc, wchar_t **argv)
debugOptions.minidump = true;
debugOptions.minidumpDir = optarg;
break;
case L'q':
debugOptions.no_debug_string = true;
break;
case L'?':
if (optopt == L'?') {
Usage();
Expand Down
1 change: 1 addition & 0 deletions src/common/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ DebugMainLoop(void)
lprintf("OUTPUT_DEBUG_STRING PID=%lu TID=%lu\n", DebugEvent.dwProcessId,
DebugEvent.dwThreadId);
}
if (debugOptions.no_debug_string) break;

pProcessInfo = &g_Processes[DebugEvent.dwProcessId];

Expand Down
1 change: 1 addition & 0 deletions src/common/debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct DebugOptions {
const wchar_t *minidumpDir = nullptr;
HANDLE hEvent = nullptr; // Signal an event after process is attached
DWORD dwThreadId = 0; // Resume thread after process is attached
bool no_debug_string = false; // Silence OutputDebugString messages
};

EXTERN_C DebugOptions debugOptions;
Expand Down
Loading