3 ms·
You don't need OutputDebugString on because you can always tap the write syscall on stdout from gdb. And I don't really know what IsDebuggerPresent gets you.
by monocasa 9y ago
You don't need OutputDebugString on because you can always tap the write syscall on stdout from gdb.
And I don't really know what IsDebuggerPresent gets you.
You're really focusing on features, rather than use cases.
- kazinator 9y agoWell, stdout isn't a debug channel; you might want to debug a program that actually uses stdout for its output, not for debug chatter. Never mind that though, we can take some other descriptor, like 3, and bind it to, say /dev/null. What are the gdb commands to have whatever is going to file descriptor 3 be shown inside gdb? I really do not care how it's implemented. However, "tightly integrated" is better than "flimsy hack"; "consumes breakpoints" is better than "doesn't consume breakpoints".
- flukus 9y ago> Well, stdout isn't a debug channel; you might want to debug a program that actually uses stdout for its output, not for debug chatter. What's your use case for this that makes stderr unsuitable?
- kazinator 9y agostderr also isn't for debug output. If, say, a compiler puts out "hello.c: syntax error" on its standard error stream, that is not a debugging diagnostic regarding that compiler's internals; it's about "hello.c". stderr is not an instrumentation tool which goes away when we're not debugging the program.
- monocasa 9y agoWhy? It's not like it'd be printing debugging level messages on release builds in either case.