jingham added a comment.

This needs some more design, I think.  The obvious solution to Ted's problem is 
that `target create` should make the new target the currently selected one.  
Then the second HandleCommand would have a selected target, and the second 
command would work.  But that doesn't seem right to me when you consider that 
there might be more than one process at a time in a target, which we definitely 
want to.

For instance, suppose I hit a breakpoint callback in Target A that creates a 
new target (B) when the breakpoint is hit, attaches that Target B to some other 
process, and continues.  If I'm stopped at a breakpoint in Target C, without 
anything that I can discern happening, Target B becomes the selected target, 
and all my commands start going to it.  That can't be right.

For the Driver, this is not so complicated.  If some one issues a target create 
command directly in the Driver, then it makes sense to select that target.  
That's clearly the user's intent.

But in scripting contexts, I don't think we should be switching around the 
selected target.  Instead, commands run in the script interpreter should be 
explicit about what execution context they are working on.  If I could 
deprecate one API it would be the HandleCommand with no exe_ctx...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111209/new/

https://reviews.llvm.org/D111209

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

Reply via email to