diff options
| author | Enrico Granata <egranata@apple.com> | 2016-03-24 23:06:42 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2016-03-24 23:06:42 +0000 |
| commit | 701338a75f0a33b4feee85df8fe8e6f74fe7abda (patch) | |
| tree | 260077d9b94fc948460ba55beeb11e7df0b655bb /lldb/source/Commands | |
| parent | fd3eaa8c5c044910463dad0a17bdfd080fc1383b (diff) | |
| download | bcm5719-llvm-701338a75f0a33b4feee85df8fe8e6f74fe7abda.tar.gz bcm5719-llvm-701338a75f0a33b4feee85df8fe8e6f74fe7abda.zip | |
Make it possible for language plugins to provide additional custom help for 'type lookup'
llvm-svn: 264356
Diffstat (limited to 'lldb/source/Commands')
| -rw-r--r-- | lldb/source/Commands/CommandObjectType.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index 23e3c0e9075..ac714538a36 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -3265,8 +3265,8 @@ public: CommandObjectTypeLookup (CommandInterpreter &interpreter) : CommandObjectRaw (interpreter, "type lookup", - "Lookup a type by name in the select target.", - "type lookup <typename>", + "Lookup types and declarations in the current target, following language-specific naming conventions.", + "type lookup <type-specifier>", eCommandRequiresTarget), m_option_group(interpreter), m_command_options() @@ -3283,6 +3283,32 @@ public: return &m_option_group; } + const char* + GetHelpLong () override + { + if (m_cmd_help_long.empty()) + { + StreamString stream; + // FIXME: hardcoding languages is not good + lldb::LanguageType languages[] = {eLanguageTypeObjC,eLanguageTypeC_plus_plus}; + + for(const auto lang_type : languages) + { + if (auto language = Language::FindPlugin(lang_type)) + { + if (const char* help = language->GetLanguageSpecificTypeLookupHelp()) + { + stream.Printf("%s\n", help); + } + } + } + + if (stream.GetData()) + m_cmd_help_long.assign(stream.GetString()); + } + return this->CommandObject::GetHelpLong(); + } + bool DoExecute (const char *raw_command_line, CommandReturnObject &result) override { |

