This is an archive of the discontinued LLVM Phabricator instance.

[API] Extend the `SBThreadPlan` interface
ClosedPublic

Authored by aleksandr.urakov on Oct 17 2018, 2:45 AM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

Presumably you are doing this so one scripted thread plan can use another one? This is the right way to do that, so this is great. Not sure why I didn't think of it.

BTW, looks like I added this without any tests. Totally my bad, this was a weekend experiment and was inert if not used, so I got the bits in and then wrote a bug on myself to write tests - demonstrating again why that's inadvisable...

If you are playing around with this and have a moment to formalize what you are doing into a test or two, I'd be grateful...

jingham accepted this revision.Oct 19 2018, 10:46 AM

And tick the checkbox...

This revision is now accepted and ready to land.Oct 19 2018, 10:46 AM

Thanks!

Yes, I've added this exactly to allow usage of a scripted plan from another scripted plan. Sure, I will add a test for this :) But I can't figure out how this part is tested, can you explain me this a little, please?

This should be easy to test with the python testsuite (lldbtest.) Start with the sample_test in packages/Python/lldbsuite/test - don't use the inline one, that won't be flexible enough. Then you can just make a scripted thread plan that just pushes a "step over" or "step in" plan, and step with it and make sure it landed where it should. Then to test your addition, make another scripted plan that calls your trivial stepping one, and make sure that stops where expected as well.

Ok, I'll do it, thanks!

I've added the test. Can you see, please, is it ok?

jingham accepted this revision.Oct 24 2018, 10:37 AM

That looks right. Thanks for adding the test!

This revision was automatically updated to reflect the committed changes.