> On Feb 5, 2016, at 4:43 PM, Enrico Granata via lldb-commits 
> <lldb-commits@lists.llvm.org> wrote:
> 
> Modified: lldb/trunk/source/Target/LanguageRuntime.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/LanguageRuntime.cpp?rev=259964&r1=259963&r2=259964&view=diff
> ==============================================================================
> --- lldb/trunk/source/Target/LanguageRuntime.cpp (original)
> +++ lldb/trunk/source/Target/LanguageRuntime.cpp Fri Feb  5 18:43:07 2016
> @@ -336,6 +336,10 @@ LanguageRuntime::InitializeCommands (Com
>             CommandObjectSP command = 
> command_callback(parent->GetCommandInterpreter());
>             if (command)
>             {
> +                // the CommandObject vended by a Language plugin cannot be 
> created once and cached because
> +                // we may create multiple debuggers and need one instance of 
> the command each - the implementing function
> +                // is meant to create a new instance of the command each 
> time it is invoked
> +                assert(&command->GetCommandInterpreter() == 
> &parent->GetCommandInterpreter() && "language plugin returned command for a 
> mismatched CommandInterpreter");

Should CommandObject::LoadSubCommand do this check?

>                 parent->LoadSubCommand(command->GetCommandName(), command);
>             }
>         }

Jim

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to