| 1 | //===-- CommandObjectLanguage.cpp -----------------------------------------===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include "CommandObjectLanguage.h" |
| 10 | |
| 11 | |
| 12 | |
| 13 | #include "lldb/Target/LanguageRuntime.h" |
| 14 | |
| 15 | using namespace lldb; |
| 16 | using namespace lldb_private; |
| 17 | |
| 18 | CommandObjectLanguage::CommandObjectLanguage(CommandInterpreter &interpreter) |
| 19 | : CommandObjectMultiword( |
| 20 | interpreter, "language" , "Commands specific to a source language." , |
| 21 | "language <language-name> <subcommand> [<subcommand-options>]" ) { |
| 22 | // Let the LanguageRuntime populates this command with subcommands |
| 23 | LanguageRuntime::InitializeCommands(parent: this); |
| 24 | SetHelpLong( |
| 25 | R"( |
| 26 | Language specific subcommands may be used directly (without the `language |
| 27 | <language-name>` prefix), when stopped on a frame written in that language. For |
| 28 | example, from a C++ frame, users may run `demangle` directly, instead of |
| 29 | `language cplusplus demangle`. |
| 30 | |
| 31 | Language specific subcommands are only available when the command name cannot be |
| 32 | misinterpreted. Take the `demangle` command for example, if a Python command |
| 33 | named `demangle-tree` were loaded, then the invocation `demangle` would run |
| 34 | `demangle-tree`, not `language cplusplus demangle`. |
| 35 | )" ); |
| 36 | } |
| 37 | |
| 38 | CommandObjectLanguage::~CommandObjectLanguage() = default; |
| 39 | |