mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 03:56:16 +08:00
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
This commit is contained in:
@@ -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);
|
||||
flag_bits = log->GetMask().Get();
|
||||
for (; args[0]; args++)
|
||||
{
|
||||
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);
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user