This is an archive of the discontinued LLVM Phabricator instance.

[lldb] tab completion for `thread plan discard`
ClosedPublic

Authored by MrHate on Jul 6 2020, 8:31 AM.

Details

Summary

Dedicated completion for the command thread plan discard with a corresponding test case.

Diff Detail

Event Timeline

MrHate created this revision.Jul 6 2020, 8:31 AM
JDevlieghere added inline comments.Jul 7 2020, 10:27 AM
lldb/source/Target/Thread.cpp
1113

How about while(p) and incrementing i in plans.GetPlanByIndex.

1118

What's the reason for doing this rather than

p = plans.GetPlanByIndex(i + 1, false);
lldb/test/API/functionalities/completion/thread_plan_script.py
21

As pointed out by phab.

MrHate updated this revision to Diff 276278.Jul 7 2020, 5:32 PM
  1. refactored for-loop into while-loop;
  2. added a new line at the end of thread_plan_script.py.
teemperor accepted this revision.Aug 6 2020, 3:05 AM
teemperor added a subscriber: jingham.

+Jim, but this LGTM now (minus the kinda hidden increment, but I can fix that when merging).

lldb/source/Target/Thread.cpp
1117

I think having the i++ in its own statement makes it easier to spot where we increment it.

This revision is now accepted and ready to land.Aug 6 2020, 3:05 AM

The implementation looks fine.

The ThreadPlan that you push doesn't make any sense. That's fine because you never ask it to do anything, but you never know what people will take as an example, so it might be good to give it a name or add a comment indicating that this is a non-functional toy.

MrHate updated this revision to Diff 283777.Aug 6 2020, 5:41 PM
  • Added a comment in thread_plan_script.py.
This revision was automatically updated to reflect the committed changes.