This is an archive of the discontinued LLVM Phabricator instance.

Make "process attach -c" work again, add a test for it.
ClosedPublic

Authored by jingham on Sep 29 2021, 4:33 PM.

Details

Summary

process attach -c

stopped working at some point. Since there was no test for this feature, I'm not sure when it broke, but I think it was when we started being more rigorous about tracking the interpreter execution context.

The continue in the CommandObjectProcessAttach was handled by calling HandleCommand("process attach", ...). That seems a little odd at first blush, but makes sense because it means the result of the continue gets reported just as an ordinary user "continue" would.

The problem is that though we've made a new process (and maybe even a new target) in the basic attach command, we haven't told the command interpreter about them yet, so CheckRequirements will fail before we get a chance to run the command.

In this case, since we know exactly which process we want to continue, we should just be explicit and pass an execution context for that process to HandleCommand.

Also added a test for this.

Diff Detail

Event Timeline

jingham requested review of this revision.Sep 29 2021, 4:33 PM
jingham created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSep 29 2021, 4:33 PM
JDevlieghere accepted this revision.Sep 29 2021, 4:47 PM

LGTM. Thanks Jim!

This revision is now accepted and ready to land.Sep 29 2021, 4:47 PM