When it runs, lldb-mi creates a log file. There is an option --noLog to disable
the creation but it does not work and you end up with log file. This happens as
log is enabled in a few places in the code although it has been disabled by
this option.
This revision tried to fix the problem in the following way.
1. Log file generation is disabled by default.
2. You can enable it by giving --log option. It is the only way to enable it.
Rest of the call have been removed.
So the code basically remove the calls that enable the log unconditionally and
changes the option --noLog to --log.
http://reviews.llvm.org/D7344
Files:
tools/lldb-mi/MICmnLog.cpp
tools/lldb-mi/MICmnResources.cpp
tools/lldb-mi/MICmnResources.h
tools/lldb-mi/MIDriverMgr.cpp
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
Index: tools/lldb-mi/MICmnLog.cpp
===================================================================
--- tools/lldb-mi/MICmnLog.cpp
+++ tools/lldb-mi/MICmnLog.cpp
@@ -73,7 +73,6 @@
// Mediums set inside because explicitly initing in MIDriverMain.cpp causes compile errors with CAtlFile
CMICmnLogMediumFile &rFileLog(CMICmnLogMediumFile::Instance());
bool bOk = RegisterMedium(rFileLog);
- bOk = bOk && SetEnabled(true);
if (bOk)
{
// Set the Log trace file's header
Index: tools/lldb-mi/MICmnResources.cpp
===================================================================
--- tools/lldb-mi/MICmnResources.cpp
+++ tools/lldb-mi/MICmnResources.cpp
@@ -82,7 +82,7 @@
{IDE_MI_APP_ARG_EXECUTEABLE, "--executable\n\tUse the MI Driver in MI mode for the debugging the specified\n\texecutable. Any LLDB "
"command line options are ignored even\n\tif the MI Driver falls through to the LLDB driver. "
"(Depends\n\ton the build configuration see MICmnConfig.h)\n\tNormally specified from the command line."},
- {IDE_MI_APP_ARG_NO_APP_LOG, "--noLog\n\tUse this argument to tell the MI Driver not to update it's log\n\tfile '%s'."},
+ {IDE_MI_APP_ARG_APP_LOG, "--log\n\tUse this argument to tell the MI Driver to update it's log\n\tfile '%s'."},
{IDE_MI_APP_ARG_EXAMPLE, "Example MI command:\n\t3-info-gdb-mi-command gdb-set\n\t3^done,command={exists=\"true\"}"},
{IDE_MI_APP_ARG_EXECUTABLE, "executable (NOT IMPLEMENTED)\n\tThe file path to the executable i.e. '\"C:\\My Dev\\foo.exe\"'."},
{IDS_STDIN_ERR_INVALID_PROMPT, "Stdin. Invalid prompt description '%s'"},
Index: tools/lldb-mi/MICmnResources.h
===================================================================
--- tools/lldb-mi/MICmnResources.h
+++ tools/lldb-mi/MICmnResources.h
@@ -89,7 +89,7 @@
IDE_MI_APP_ARG_VERSION_LONG,
IDE_MI_APP_ARG_INTERPRETER,
IDE_MI_APP_ARG_EXECUTEABLE,
- IDE_MI_APP_ARG_NO_APP_LOG,
+ IDE_MI_APP_ARG_APP_LOG,
IDE_MI_APP_ARG_EXAMPLE,
IDE_MI_APP_ARG_EXECUTABLE,
Index: tools/lldb-mi/MIDriverMgr.cpp
===================================================================
--- tools/lldb-mi/MIDriverMgr.cpp
+++ tools/lldb-mi/MIDriverMgr.cpp
@@ -125,8 +125,6 @@
if (vbAppExitOk)
{
- // The MI Driver's log updating may have been switched off switch back on to say all is ok.
- CMICmnLog::Instance().SetEnabled(true);
#if _DEBUG
CMICmnStreamStdout::Instance().Write(MIRSRC(IDE_MI_APP_EXIT_OK)); // Both stdout and Log
#else
@@ -144,8 +142,6 @@
}
else
{
- // The MI Driver's log updating may have been switched off switch back on to say there has been problem.
- rAppLog.SetEnabled(true);
const CMIUtilString msg(
CMIUtilString::Format(MIRSRC(IDE_MI_APP_EXIT_WITH_PROBLEM_NO_LOG), CMICmnLogMediumFile::Instance().GetFileName().c_str()));
CMICmnStreamStdout::Instance().Write(msg);
@@ -495,7 +491,7 @@
// --interpreter
// --version
// --versionLong
-// --noLog
+// --log
// --executable
// The above arguments are not handled by any driver object except for --executable.
// The options --interpreter and --executable in code act very similar. The
@@ -552,7 +548,7 @@
bool bHaveArgInterpret = false;
bool bHaveArgVersion = false;
bool bHaveArgVersionLong = false;
- bool bHaveArgNoLog = false;
+ bool bHaveArgLog = false;
bool bHaveArgHelp = false;
// Hardcode the use of the MI driver
@@ -582,9 +578,9 @@
{
bHaveArgVersionLong = true;
}
- if (0 == strArg.compare("--noLog"))
+ if (0 == strArg.compare("--log"))
{
- bHaveArgNoLog = true;
+ bHaveArgLog = true;
}
if ((0 == strArg.compare("--help")) || (0 == strArg.compare("-h")))
{
@@ -593,9 +589,9 @@
}
}
- if (bHaveArgNoLog)
+ if (bHaveArgLog)
{
- CMICmnLog::Instance().SetEnabled(false);
+ CMICmnLog::Instance().SetEnabled(true);
}
// Todo: Remove this output when MI is finished. It is temporary to persuade Ecllipse plugin to work.
@@ -687,7 +683,7 @@
MIRSRC(IDE_MI_APP_ARG_VERSION_LONG),
MIRSRC(IDE_MI_APP_ARG_INTERPRETER),
MIRSRC(IDE_MI_APP_ARG_EXECUTEABLE),
- CMIUtilString::Format(MIRSRC(IDE_MI_APP_ARG_NO_APP_LOG), CMICmnLogMediumFile::Instance().GetFileName().c_str()),
+ CMIUtilString::Format(MIRSRC(IDE_MI_APP_ARG_APP_LOG), CMICmnLogMediumFile::Instance().GetFileName().c_str()),
MIRSRC(IDE_MI_APP_ARG_EXECUTABLE),
MIRSRC(IDS_CMD_QUIT_HELP),
MIRSRC(IDE_MI_APP_ARG_EXAMPLE)};
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits