This is an archive of the discontinued LLVM Phabricator instance.

[lldb][Language] List supported languages in expr error text
ClosedPublic

Authored by Michael137 on Jan 18 2023, 8:57 AM.

Details

Summary

Before:

(lldb) expr --language abc -- 1 + 1
error: unknown language type: 'abc' for expression

After:

(lldb) expr --language abc -- 1 + 1
error: unknown language type: 'abc' for expression. List of supported languages:
  c++
  objective-c++
  c++03
  c++11
  c++14
  objc++

We choose to only list the languages which expr will actually
accept instead of all the language constants defined in Language.cpp
since that's what the user will most likely need.

Diff Detail

Event Timeline

Michael137 created this revision.Jan 18 2023, 8:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2023, 8:57 AM
Michael137 requested review of this revision.Jan 18 2023, 8:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2023, 8:57 AM
  • Use GetLanguagesSupportingTypeSystemsForExpressions instead of GetSupportedLanguages
Michael137 edited the summary of this revision. (Show Details)Jan 18 2023, 9:30 AM
Michael137 edited the summary of this revision. (Show Details)
  • Language name pair can be const &
aprantl accepted this revision.Jan 18 2023, 9:51 AM

Nice. IIUC, this will query every already registered plugin, so it should also work without modification for e.g., LLDB with Swift support.

This revision is now accepted and ready to land.Jan 18 2023, 9:51 AM