diff options
| author | Zachary Turner <zturner@google.com> | 2015-09-16 20:13:53 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2015-09-16 20:13:53 +0000 |
| commit | ddf0661b38bd6f2327a6c9fc0f7a739e354ce236 (patch) | |
| tree | 32356651164a9012b964be4d7330189d78e93aaf /lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLog.cpp | |
| parent | 10c9ea51a0c4f0ff1bce630b46ccffed575f0082 (diff) | |
| download | bcm5719-llvm-ddf0661b38bd6f2327a6c9fc0f7a739e354ce236.tar.gz bcm5719-llvm-ddf0661b38bd6f2327a6c9fc0f7a739e354ce236.zip | |
Fix log disable command in ProcessWindowsLog.
The implications of this bug where that "log disable windows" would
not actually disable the log, and worse it would lock the file handle
making it impossible to delete the file until lldb was shut down.
This was then causing the test suite to fail, because the test suite
tries to delete log files in certain situations.
llvm-svn: 247841
Diffstat (limited to 'lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLog.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLog.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLog.cpp b/lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLog.cpp index 55c35bccbce..090ab84c90a 100644 --- a/lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLog.cpp +++ b/lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLog.cpp @@ -96,26 +96,32 @@ ProcessWindowsLog::DisableLog(const char **args, Stream *feedback_strm) {
uint32_t flag_bits = 0;
- flag_bits = log->GetMask().Get();
- for (; args[0]; args++)
+ if (args[0] != nullptr)
{
- const char *arg = args[0];
- uint32_t bits = GetFlagBits(arg);
-
- if (bits)
- {
- flag_bits &= ~bits;
- }
- else
+ flag_bits = log->GetMask().Get();
+ for (; args[0]; args++)
{
- feedback_strm->Printf("error: unrecognized log category '%s'\n", arg);
- ListLogCategories(feedback_strm);
+ const char *arg = args[0];
+ uint32_t bits = GetFlagBits(arg);
+
+ if (bits)
+ {
+ flag_bits &= ~bits;
+ }
+ else
+ {
+ feedback_strm->Printf("error: unrecognized log category '%s'\n", arg);
+ ListLogCategories(feedback_strm);
+ }
}
}
log->GetMask().Reset(flag_bits);
if (flag_bits == 0)
+ {
g_log_enabled = false;
+ log->SetStream(lldb::StreamSP());
+ }
}
return;
|

