[lldb][Language] List supported languages in expr error text
authorMichael Buch <michaelbuch12@gmail.com>
Wed, 18 Jan 2023 16:42:20 +0000 (16:42 +0000)
committerMichael Buch <michaelbuch12@gmail.com>
Wed, 18 Jan 2023 18:18:52 +0000 (18:18 +0000)
commitb4a0b9fab4dcb7b808612b49604709c2aeadf9f8
tree8259212dc50bfea6d929e4c33f817aed9f0c5e56
parent0246c5d11c20c6d8c3686bc4cbfc6e8ca3e8bd41
[lldb][Language] List supported languages in expr error text

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.

Differential Revision: https://reviews.llvm.org/D142034
lldb/include/lldb/Target/Language.h
lldb/source/Commands/CommandObjectExpression.cpp
lldb/source/Target/Language.cpp
lldb/test/API/commands/expression/invalid-args/TestInvalidArgsExpression.py