[Lldb-commits] [lldb] r259962 - Fix "thread backtrace -s": option was misparsed because of a missing break.

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 5 16:54:09 PST 2016


Yes, I thought about this, but I'm not sure the right way to do it is to go add by hand tests for all the legal option sets for commands one by one.  After all, the commands know what combinations of options are available, so it should be possible to write a "CommandObject::GetAllCommandSets" that used the types in the command tables to produce all the legal command options with "correct" bogus values, then just try to parse - not execute - them and see that they parsed.  That would catch this sort of error.

Jim
  


> On Feb 5, 2016, at 4:46 PM, Zachary Turner <zturner at google.com> wrote:
> 
> Sounds like we don't have a test for thread backtrace -s.  I know I usually argue against tests of the CLI, but only when they're used instead of tests for the api.  Seems like we should have at least one test for every option of every command.
> 
> On Fri, Feb 5, 2016 at 4:35 PM Jim Ingham via lldb-commits <lldb-commits at lists.llvm.org> wrote:
> Author: jingham
> Date: Fri Feb  5 18:31:23 2016
> New Revision: 259962
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=259962&view=rev
> Log:
> Fix "thread backtrace -s": option was misparsed because of a missing break.
> 
> <rdar://problem/24525106>
> 
> Modified:
>     lldb/trunk/source/Commands/CommandObjectThread.cpp
> 
> Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=259962&r1=259961&r2=259962&view=diff
> ==============================================================================
> --- lldb/trunk/source/Commands/CommandObjectThread.cpp (original)
> +++ lldb/trunk/source/Commands/CommandObjectThread.cpp Fri Feb  5 18:31:23 2016
> @@ -194,6 +194,7 @@ public:
>                      if (!success)
>                          error.SetErrorStringWithFormat("invalid integer value for option '%c'", short_option);
>                  }
> +                break;
>                  case 'e':
>                  {
>                      bool success;
> 
> 
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits



More information about the lldb-commits mailing list