diff --git a/lldb/docs/man/lldb.rst b/lldb/docs/man/lldb.rst --- a/lldb/docs/man/lldb.rst +++ b/lldb/docs/man/lldb.rst @@ -111,7 +111,7 @@ .. option:: --source-quietly - Tells the debugger to execute this one-line lldb command before any file has been loaded. + Tells the debugger not to echo commands while sourcing files or one-line commands provided on the command line. .. option:: --source diff --git a/lldb/test/Shell/Driver/TestQuiet.test b/lldb/test/Shell/Driver/TestQuiet.test new file mode 100644 --- /dev/null +++ b/lldb/test/Shell/Driver/TestQuiet.test @@ -0,0 +1,7 @@ +RUN: %lldb -b -Q -o "expr 40 + 2" | FileCheck %s +RUN: %lldb -b -Q -O "expr 40 + 2" | FileCheck %s + +CHECK-NOT: expr +CHECK-NOT: lldb +CHECK-NOT: source +CHECK: 42 \ No newline at end of file diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp --- a/lldb/tools/driver/Driver.cpp +++ b/lldb/tools/driver/Driver.cpp @@ -609,6 +609,7 @@ options.SetSpawnThread(false); options.SetStopOnError(true); options.SetStopOnCrash(m_option_data.m_batch); + options.SetEchoCommands(!m_option_data.m_source_quietly); SBCommandInterpreterRunResult results = m_debugger.RunCommandInterpreter(options); diff --git a/lldb/tools/driver/Options.td b/lldb/tools/driver/Options.td --- a/lldb/tools/driver/Options.td +++ b/lldb/tools/driver/Options.td @@ -110,7 +110,7 @@ Group; def source_quietly: F<"source-quietly">, - HelpText<"Tells the debugger to execute this one-line lldb command before any file has been loaded.">, + HelpText<"Tells the debugger not to echo commands while sourcing files or one-line commands provided on the command line.">, Group; def: Flag<["-"], "Q">, Alias,