This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Provide tab completion for target select/delete
Needs ReviewPublic

Authored by teemperor on Sep 23 2019, 4:37 AM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Select and delete are similar enough to implement/test this in one batch.

Completion looks like this:

(lldb) target select 
Available completions:
	0 -- /Users/me/test/foo ( arch=x86_64-apple-macosx10.14.0, platform=host, pid=65449, state=stopped )
	1 -- /Users/me/test/basic ( arch=x86_64-apple-macosx10.14.0, platform=host )

Diff Detail

Event Timeline

teemperor created this revision.Sep 23 2019, 4:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2019, 4:37 AM
JDevlieghere added inline comments.Sep 23 2019, 9:28 AM
lldb/source/Commands/CommandObjectTarget.cpp
63

Can we convert these boolean flags with a new enum or struct TargetInfoDumpOptions?

kwk added a subscriber: kwk.EditedJan 5 2020, 11:19 PM

Why don't we always print the target index? Wouldn't that be much simpler?

lldb/source/Commands/CommandObjectTarget.cpp
76

Happy New Years! For the rest of file and in particular for the target properties (e.g. arch, platform), we use a one line strm.Printf. But I can understand that you don't want to introduce a ?: for every argument of the Printf. However why don't we always print the target index? Wouldn't that be much simpler?

xgupta added a subscriber: xgupta.Mar 12 2020, 2:09 PM