From 7fa27ce4a07f19b07799a767fc29416f3b625afb Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 26 Jul 2023 21:03:47 +0200 Subject: Vendor import of llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the last commit before the upstream release/17.x branch was created. --- lldb/source/Commands/CommandObjectLog.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'lldb/source/Commands/CommandObjectLog.cpp') diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp index c63d8ce4f9e4..5dd6f8989837 100644 --- a/lldb/source/Commands/CommandObjectLog.cpp +++ b/lldb/source/Commands/CommandObjectLog.cpp @@ -177,6 +177,20 @@ protected: return false; } + if ((m_options.handler != eLogHandlerCircular && + m_options.handler != eLogHandlerStream) && + m_options.buffer_size.GetCurrentValue() != 0) { + result.AppendError("a buffer size can only be specified for the circular " + "and stream buffer handler.\n"); + return false; + } + + if (m_options.handler != eLogHandlerStream && m_options.log_file) { + result.AppendError( + "a file name can only be specified for the stream handler.\n"); + return false; + } + // Store into a std::string since we're about to shift the channel off. const std::string channel = std::string(args[0].ref()); args.Shift(); // Shift off the channel @@ -490,7 +504,7 @@ public: protected: bool DoExecute(Args &args, CommandReturnObject &result) override { - Timer::DumpCategoryTimes(&result.GetOutputStream()); + Timer::DumpCategoryTimes(result.GetOutputStream()); Timer::SetDisplayDepth(0); result.SetStatus(eReturnStatusSuccessFinishResult); @@ -513,7 +527,7 @@ public: protected: bool DoExecute(Args &args, CommandReturnObject &result) override { - Timer::DumpCategoryTimes(&result.GetOutputStream()); + Timer::DumpCategoryTimes(result.GetOutputStream()); result.SetStatus(eReturnStatusSuccessFinishResult); if (!result.Succeeded()) { -- cgit v1.3