aboutsummaryrefslogtreecommitdiff
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Breakpoint/BreakpointOptions.cpp1
-rw-r--r--lldb/source/Commands/CommandObjectBugreport.cpp1
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp1
-rw-r--r--lldb/source/Commands/CommandObjectSettings.cpp1
-rw-r--r--lldb/source/Commands/CommandObjectWatchpointCommand.cpp1
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp24
-rw-r--r--lldb/source/Target/Target.cpp1
7 files changed, 27 insertions, 3 deletions
diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp
index 16d0bd43..f6f279d 100644
--- a/lldb/source/Breakpoint/BreakpointOptions.cpp
+++ b/lldb/source/Breakpoint/BreakpointOptions.cpp
@@ -646,6 +646,7 @@ bool BreakpointOptions::BreakpointOptionsCallbackFunction(
options.SetStopOnError(data->stop_on_error);
options.SetEchoCommands(true);
options.SetPrintResults(true);
+ options.SetPrintErrors(true);
options.SetAddToHistory(false);
debugger.GetCommandInterpreter().HandleCommands(commands, &exe_ctx,
diff --git a/lldb/source/Commands/CommandObjectBugreport.cpp b/lldb/source/Commands/CommandObjectBugreport.cpp
index abad6f8..515cc9a 100644
--- a/lldb/source/Commands/CommandObjectBugreport.cpp
+++ b/lldb/source/Commands/CommandObjectBugreport.cpp
@@ -94,6 +94,7 @@ protected:
options.SetStopOnError(false);
options.SetEchoCommands(true);
options.SetPrintResults(true);
+ options.SetPrintErrors(true);
options.SetAddToHistory(false);
m_interpreter.HandleCommands(commands, &m_exe_ctx, options, result);
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 7025171..4092e76 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -322,6 +322,7 @@ protected:
options.SetSilent(true);
} else {
options.SetPrintResults(true);
+ options.SetPrintErrors(true);
options.SetEchoCommands(m_interpreter.GetEchoCommands());
options.SetEchoCommentCommands(m_interpreter.GetEchoCommentCommands());
}
diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp
index 806b0c1..e7e72de 100644
--- a/lldb/source/Commands/CommandObjectSettings.cpp
+++ b/lldb/source/Commands/CommandObjectSettings.cpp
@@ -501,6 +501,7 @@ protected:
options.SetAddToHistory(false);
options.SetEchoCommands(false);
options.SetPrintResults(true);
+ options.SetPrintErrors(true);
options.SetStopOnError(false);
m_interpreter.HandleCommandsFromFile(file, &clean_ctx, options, result);
return result.Succeeded();
diff --git a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp
index 3c8eb59..8be6688 100644
--- a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp
@@ -295,6 +295,7 @@ are no syntax errors may indicate that a function was declared but never called.
options.SetStopOnError(data->stop_on_error);
options.SetEchoCommands(false);
options.SetPrintResults(true);
+ options.SetPrintErrors(true);
options.SetAddToHistory(false);
debugger.GetCommandInterpreter().HandleCommands(commands, &exe_ctx,
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 0811822..df583bc 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2173,6 +2173,7 @@ void CommandInterpreter::SourceInitFile(bool in_cwd,
const bool saved_batch = SetBatchCommandMode(true);
CommandInterpreterRunOptions options;
options.SetSilent(true);
+ options.SetPrintErrors(true);
options.SetStopOnError(false);
options.SetStopOnContinue(true);
@@ -2364,7 +2365,8 @@ enum {
eHandleCommandFlagEchoCommand = (1u << 2),
eHandleCommandFlagEchoCommentCommand = (1u << 3),
eHandleCommandFlagPrintResult = (1u << 4),
- eHandleCommandFlagStopOnCrash = (1u << 5)
+ eHandleCommandFlagPrintErrors = (1u << 5),
+ eHandleCommandFlagStopOnCrash = (1u << 6)
};
void CommandInterpreter::HandleCommandsFromFile(
@@ -2463,6 +2465,17 @@ void CommandInterpreter::HandleCommandsFromFile(
flags |= eHandleCommandFlagPrintResult;
}
+ if (options.m_print_errors == eLazyBoolCalculate) {
+ if (m_command_source_flags.empty()) {
+ // Print output by default
+ flags |= eHandleCommandFlagPrintErrors;
+ } else if (m_command_source_flags.back() & eHandleCommandFlagPrintErrors) {
+ flags |= eHandleCommandFlagPrintErrors;
+ }
+ } else if (options.m_print_errors == eLazyBoolYes) {
+ flags |= eHandleCommandFlagPrintErrors;
+ }
+
if (flags & eHandleCommandFlagPrintResult) {
debugger.GetOutputFile()->Printf("Executing commands in '%s'.\n",
cmd_file_path.c_str());
@@ -2790,7 +2803,9 @@ void CommandInterpreter::IOHandlerInputComplete(IOHandler &io_handler,
HandleCommand(line.c_str(), eLazyBoolCalculate, result);
// Now emit the command output text from the command we just executed
- if (io_handler.GetFlags().Test(eHandleCommandFlagPrintResult)) {
+ if ((result.Succeeded() &&
+ io_handler.GetFlags().Test(eHandleCommandFlagPrintResult)) ||
+ io_handler.GetFlags().Test(eHandleCommandFlagPrintErrors)) {
// Display any STDOUT/STDERR _prior_ to emitting the command result text
GetProcessOutput();
@@ -2960,8 +2975,11 @@ CommandInterpreter::GetIOHandler(bool force_create,
flags |= eHandleCommandFlagEchoCommentCommand;
if (options->m_print_results != eLazyBoolNo)
flags |= eHandleCommandFlagPrintResult;
+ if (options->m_print_errors != eLazyBoolNo)
+ flags |= eHandleCommandFlagPrintErrors;
} else {
- flags = eHandleCommandFlagEchoCommand | eHandleCommandFlagPrintResult;
+ flags = eHandleCommandFlagEchoCommand | eHandleCommandFlagPrintResult |
+ eHandleCommandFlagPrintErrors;
}
m_command_io_handler_sp = std::make_shared<IOHandlerEditline>(
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 5fbe33b..58f2325 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -2652,6 +2652,7 @@ void Target::RunStopHooks() {
options.SetStopOnError(true);
options.SetEchoCommands(false);
options.SetPrintResults(true);
+ options.SetPrintErrors(true);
options.SetAddToHistory(false);
// Force Async: