This is an archive of the discontinued LLVM Phabricator instance.

[lldb] List platform plugin *instances* in "platform list"
AcceptedPublic

Authored by labath on Feb 7 2022, 4:57 AM.

Details

Summary

Following up on the discussion on the mailing list
https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594,
this patch is the first of the series meant to bring more structure into
our handling of platform plugins and their instances.

It enhances the "platform list" command so that it gives a more
complete picture of the state of the debugger. In addition to listing
the available plugins (the current behavior), it also prints a list of
active instances to each plugin type. Currently, its main effect is to
illustrate the current nonsensical behavior of creating multiple plugin
instances with identical names, but once this is fixed (in subsequent
patches), the command output will be more sensible, and the command
itself can be then used to test the effects of other commands.

This patch also removes the registration of a host macos platform
plugin. The plugin could never be instantiated (host platform is created
at startup), none of the other platform plugins register a noop
platform, and its presence was messing up the command output.

Diff Detail

Event Timeline

labath requested review of this revision.Feb 7 2022, 4:57 AM
labath created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2022, 4:57 AM
JDevlieghere accepted this revision.Feb 8 2022, 9:27 PM

LGTM

lldb/source/Commands/CommandObjectPlatform.cpp
243

TIL

This revision is now accepted and ready to land.Feb 8 2022, 9:27 PM
clayborg accepted this revision.Feb 9 2022, 11:11 AM

Thanks for the review.

BTW, I don't know if you're following discourse, Greg, but there is a continuation of the mailing list thread there https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594, and I'd like to hear your thoughts on it.