LLDB  mainline
CommandObjectVersion.cpp
Go to the documentation of this file.
1 //===-- CommandObjectVersion.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 "CommandObjectVersion.h"
10 
12 #include "lldb/lldb-private.h"
13 
14 using namespace lldb;
15 using namespace lldb_private;
16 
17 // CommandObjectVersion
18 
19 CommandObjectVersion::CommandObjectVersion(CommandInterpreter &interpreter)
20  : CommandObjectParsed(interpreter, "version",
21  "Show the LLDB debugger version.", "version") {}
22 
24 
26  if (args.GetArgumentCount() == 0) {
27  result.AppendMessageWithFormat("%s\n", lldb_private::GetVersion());
29  } else {
30  result.AppendError("the version command takes no arguments.");
31  }
32  return true;
33 }
lldb_private::CommandObjectParsed
Definition: CommandObject.h:394
CommandObjectVersion.h
lldb_private::Args
Definition: Args.h:33
CommandReturnObject.h
lldb_private::CommandReturnObject::SetStatus
void SetStatus(lldb::ReturnStatus status)
Definition: CommandReturnObject.cpp:121
lldb_private::CommandInterpreter
Definition: CommandInterpreter.h:214
lldb_private::CommandObjectVersion::DoExecute
bool DoExecute(Args &args, CommandReturnObject &result) override
Definition: CommandObjectVersion.cpp:25
lldb_private::CommandObjectVersion::~CommandObjectVersion
~CommandObjectVersion() override
lldb-private.h
lldb_private::CommandReturnObject
Definition: CommandReturnObject.h:25
lldb::eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishResult
Definition: lldb-enumerations.h:261
lldb_private::CommandReturnObject::AppendMessageWithFormat
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
Definition: CommandReturnObject.cpp:64
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::CommandReturnObject::AppendError
void void AppendError(llvm::StringRef in_string)
Definition: CommandReturnObject.cpp:100
lldb_private::Args::GetArgumentCount
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
Definition: Args.h:118
lldb
Definition: SBAddress.h:15