Added a new "module" log channel which covers module creation, deletion, and common module list actions.

Also added a new option for "log enable" which is "--stack" which will print out a stack backtrace for each log line.

This was used to track down the leaking module issue I fixed last week.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165438 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectCommands.cpp b/source/Commands/CommandObjectCommands.cpp
index 64f80a0..364c6f5 100644
--- a/source/Commands/CommandObjectCommands.cpp
+++ b/source/Commands/CommandObjectCommands.cpp
@@ -1186,7 +1186,7 @@
     }
     
     virtual bool
-    IsRemovable ()
+    IsRemovable () const
     {
         return true;
     }
diff --git a/source/Commands/CommandObjectLog.cpp b/source/Commands/CommandObjectLog.cpp
index 7c77e69..fb98297 100644
--- a/source/Commands/CommandObjectLog.cpp
+++ b/source/Commands/CommandObjectLog.cpp
@@ -144,6 +144,7 @@
             case 'T':  log_options |= LLDB_LOG_OPTION_PREPEND_TIMESTAMP;      break;
             case 'p':  log_options |= LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD;break;
             case 'n':  log_options |= LLDB_LOG_OPTION_PREPEND_THREAD_NAME;    break;
+            case 'S':  log_options |= LLDB_LOG_OPTION_BACKTRACE;              break;
             default:
                 error.SetErrorStringWithFormat ("unrecognized option '%c'", short_option);
                 break;
@@ -215,6 +216,7 @@
 { LLDB_OPT_SET_1, false, "timestamp",  'T', no_argument,       NULL, 0, eArgTypeNone,       "Prepend all log lines with a timestamp." },
 { LLDB_OPT_SET_1, false, "pid-tid",    'p', no_argument,       NULL, 0, eArgTypeNone,       "Prepend all log lines with the process and thread ID that generates the log line." },
 { LLDB_OPT_SET_1, false, "thread-name",'n', no_argument,       NULL, 0, eArgTypeNone,       "Prepend all log lines with the thread name for the thread that generates the log line." },
+{ LLDB_OPT_SET_1, false, "stack",      'S', no_argument,       NULL, 0, eArgTypeNone,       "Append a stack backtrace to each log line." },
 { 0, false, NULL,                       0,  0,                 NULL, 0, eArgTypeNone,       NULL }
 };