diff options
-rw-r--r-- | lldb/source/Commands/CommandObjectLog.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp index 05ba89cf6e2..221c975bc99 100644 --- a/lldb/source/Commands/CommandObjectLog.cpp +++ b/lldb/source/Commands/CommandObjectLog.cpp @@ -138,7 +138,7 @@ public: switch (short_option) { - case 'f': log_file = option_arg; break; + case 'f': log_file.SetFile(option_arg, true); break; case 't': log_options |= LLDB_LOG_OPTION_THREADSAFE; break; case 'v': log_options |= LLDB_LOG_OPTION_VERBOSE; break; case 'g': log_options |= LLDB_LOG_OPTION_DEBUG; break; @@ -158,7 +158,7 @@ public: void OptionParsingStarting () { - log_file.clear(); + log_file.Clear(); log_options = 0; } @@ -174,7 +174,7 @@ public: // Instance variables to hold the values for command options. - std::string log_file; + FileSpec log_file; uint32_t log_options; }; @@ -191,9 +191,14 @@ protected: { std::string channel(args.GetArgumentAtIndex(0)); args.Shift (); // Shift off the channel + char log_file[PATH_MAX]; + if (m_options.log_file) + m_options.log_file.GetPath(log_file, sizeof(log_file)); + else + log_file[0] = '\0'; bool success = m_interpreter.GetDebugger().EnableLog (channel.c_str(), args.GetConstArgumentVector(), - m_options.log_file.c_str(), + log_file, m_options.log_options, result.GetErrorStream()); if (success) |