[Lldb-commits] [PATCH] D51615: Set Windows console mode to enable support for ansi escape codes

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 5 09:11:55 PDT 2018

zturner added inline comments.

Comment at: source/Core/Debugger.cpp:819
+  SetUseColor(SetConsoleMode(hConsole, consoleMode));
xbolva00 wrote:
> Should I rewrite it to more clear version like
> bool ansi_supported = SetConsoleMode(hConsole, consoleMode);
> SetUseColor(ansi_supported);
> ?
Shouldn't we change this to call `llvm::sys::Process::UseANSIEscapeCodes(true);`?

Comment at: source/Core/Debugger.cpp:53
 #include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
+#include "windows.h"
This should be `#include "lldb/Host/windows/windows.h"`.  Otherwise you're getting the system `windows.h` file.  If that's what you wanted, then it should be `<windows.h>` instead of `"windows.h"`, but that's never what you want, we should always be including LLDB's wrapper around windows.h instead.


More information about the lldb-commits mailing list