mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-07 14:16:09 +00:00

accessed by the objects that own the settings. The previous approach wasn't very usable and made for a lot of unnecessary code just to access variables that were already owned by the objects. While I fixed those things, I saw that CommandObject objects should really have a reference to their command interpreter so they can access the terminal with if they want to output usaage. Fixed up all CommandObjects to take an interpreter and cleaned up the API to not need the interpreter to be passed in. Fixed the disassemble command to output the usage if no options are passed down and arguments are passed (all disassebmle variants take options, there are no "args only"). llvm-svn: 114252
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
//===-- CommandObjectQuit.cpp -----------------------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "CommandObjectQuit.h"
|
|
|
|
// C Includes
|
|
// C++ Includes
|
|
// Other libraries and framework includes
|
|
// Project includes
|
|
#include "lldb/Interpreter/CommandInterpreter.h"
|
|
#include "lldb/Interpreter/CommandReturnObject.h"
|
|
|
|
using namespace lldb;
|
|
using namespace lldb_private;
|
|
|
|
//-------------------------------------------------------------------------
|
|
// CommandObjectQuit
|
|
//-------------------------------------------------------------------------
|
|
|
|
CommandObjectQuit::CommandObjectQuit (CommandInterpreter &interpreter) :
|
|
CommandObject (interpreter, "quit", "Quit out of the LLDB debugger.", "quit")
|
|
{
|
|
}
|
|
|
|
CommandObjectQuit::~CommandObjectQuit ()
|
|
{
|
|
}
|
|
|
|
bool
|
|
CommandObjectQuit::Execute
|
|
(
|
|
Args& args,
|
|
CommandReturnObject &result
|
|
)
|
|
{
|
|
m_interpreter.BroadcastEvent (CommandInterpreter::eBroadcastBitQuitCommandReceived);
|
|
result.SetStatus (eReturnStatusQuit);
|
|
return true;
|
|
}
|
|
|