[Lldb-commits] [PATCH] D111209: Don't push null ExecutionContext on CommandInterpreter exectx stack

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 3 10:09:24 PDT 2021


jingham added a comment.

I think we should make simple cases like this work for sure.  But OTOH, if you are writing a script that you might use anywhere non-trivial, SBCommandInterpreter.HandleCommand(char *, SBError) is NOT a safe thing to call.  You could be in an lldb session with more than one Target, and while your command is running, the other target could have hit a breakpoint that it intended to stop at, and so it becomes the currently selected target.

I'm not sure there's a good way to enforce this, but if you have an execution context in mind when running a command with HandleCommand, you really need to use the version of HandleCommand that takes an execution context, rather than just hoping that when the command is run your execution context is still the currently selected one.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111209



More information about the lldb-commits mailing list