[Lldb-commits] [PATCH] fix for -Q option

dawn at burble.org dawn at burble.org
Tue Nov 18 08:08:20 PST 2014


On Mon, Nov 17, 2014 at 07:47:48PM -0800, dawn at burble.org wrote:
> This patch fixes the behavior of -Q to match the --help:
>     "Tells the debugger suppress output from commands provided in the -s, -S,
>       -O and -o commands."
> Without this patch, the -Q option does the reverse of its intent, so that 
> specifying a command file with option "-s" would *not* echo any commands
> *unless* -Q was specified.
> 
> (Also fixes a stray embedded tab in related code.)
> 
> Note: m_silent_run is used in SetOptionValue of
> source/Commands/CommandObjectCommands.cpp:
>                 case 's':
>                     error = m_silent_run.SetValueFromCString(option_arg);
>                     break;
> I didn't know how to invoke that code to test if it works as intended;
> does it need to be fixed as well?

This is used in lldb's "command source -s 1 cmdfile" command, which
works correctly with this patch.  Please commit?

> 
> Please check the use above, review and commit?
> 
> Thanks,
> -Dawn

> Index: source/Commands/CommandObjectCommands.cpp
> ===================================================================
> --- source/Commands/CommandObjectCommands.cpp	(revision 222209)
> +++ source/Commands/CommandObjectCommands.cpp	(working copy)
> @@ -366,7 +366,7 @@
>          // Instance variables to hold the values for command options.
>  
>          OptionValueBoolean m_stop_on_error;
> -	    OptionValueBoolean m_silent_run;
> +        OptionValueBoolean m_silent_run;
>          OptionValueBoolean m_stop_on_continue;
>      };
>      
> @@ -390,8 +390,8 @@
>                  CommandInterpreterRunOptions options;
>                  options.SetStopOnContinue(m_options.m_stop_on_continue.GetCurrentValue());
>                  options.SetStopOnError (m_options.m_stop_on_error.GetCurrentValue());
> -                options.SetEchoCommands (m_options.m_silent_run.GetCurrentValue());
> -                options.SetPrintResults (m_options.m_silent_run.GetCurrentValue());
> +                options.SetEchoCommands (!m_options.m_silent_run.GetCurrentValue());
> +                options.SetPrintResults (!m_options.m_silent_run.GetCurrentValue());
>  
>                  m_interpreter.HandleCommandsFromFile (cmd_file,
>                                                        exe_ctx,

> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits




More information about the lldb-commits mailing list