Files
clang-p2996/lldb/tools/lldb-mi/MIDriverBase.cpp
Kate Stone b9c1b51e45 *** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style.  This kind of mass change has
*** two obvious implications:

Firstly, merging this particular commit into a downstream fork may be a huge
effort.  Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit.  The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):

    find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
    find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;

The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.

Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit.  There are alternatives available that will attempt
to look through this change and find the appropriate prior commit.  YMMV.

llvm-svn: 280751
2016-09-06 20:57:50 +00:00

192 lines
6.4 KiB
C++

//===-- MIDriverBase.cpp ----------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// Third party headers:
#include "lldb/API/SBBroadcaster.h"
#include "lldb/API/SBEvent.h"
// In-house headers:
#include "MIDriverBase.h"
//++
//------------------------------------------------------------------------------------
// Details: CMIDriverBase constructor.
// Type: Method.
// Args: None.
// Return: None.
// Throws: None.
//--
CMIDriverBase::CMIDriverBase()
: m_pDriverFallThru(nullptr), m_pDriverParent(nullptr), m_bExitApp(false) {}
//++
//------------------------------------------------------------------------------------
// Details: CMIDriverBase destructor.
// Type: Overrideable.
// Args: None.
// Return: None.
// Throws: None.
//--
CMIDriverBase::~CMIDriverBase() { m_pDriverFallThru = NULL; }
//++
//------------------------------------------------------------------------------------
// Details: This function allows *this driver to call on another driver to
// perform work
// should this driver not be able to handle the client data input.
// Type: Overrideable.
// Check the error message if the function returns a failure.
// Type: Overridden.
// Args: vCmd - (R) Command instruction to interpret.
// vwErrMsg - (W) Error description on command failing.
// Return: MIstatus::success - Command succeeded.
// MIstatus::failure - Command failed.
// Throws: None.
//--
bool CMIDriverBase::DoFallThruToAnotherDriver(const CMIUtilString &vCmd,
CMIUtilString &vwErrMsg) {
// Do nothing - override and implement. Use m_pDriverFallThru.
return MIstatus::success;
}
//++
//------------------------------------------------------------------------------------
// Details: This function allows *this driver to call on another driver to
// perform work
// should this driver not be able to handle the client data input.
// Type: Overrideable.
// Args: vrOtherDriver - (R) Reference to another driver object.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool CMIDriverBase::SetDriverToFallThruTo(const CMIDriverBase &vrOtherDriver) {
MIunused(vrOtherDriver);
// Do nothing - override and implement. Set m_pDriverFallThru.
return MIstatus::success;
}
//++
//------------------------------------------------------------------------------------
// Details: This function allows *this driver to call functionality on the
// parent driver
// ask for information for example.
// Type: Overrideable.
// Args: vrOtherDriver - (R) Reference to another driver object.
// Return: MIstatus::success - Functional succeeded.
// MIstatus::failure - Functional failed.
// Throws: None.
//--
bool CMIDriverBase::SetDriverParent(const CMIDriverBase &vrOtherDriver) {
MIunused(vrOtherDriver);
// Do nothing - override and implement. Set m_pDriverParent.
return MIstatus::success;
}
//++
//------------------------------------------------------------------------------------
// Details: Retrieve the parent driver to *this driver if one assigned. If
// assigned *this
// is the pass through driver that the parent driver passes work to.
// Type: Method.
// Args: None.
// Return: CMIDriverBase * - Pointer to a driver object.
// - NULL = there is not parent to *this driver.
// Throws: None.
//--
CMIDriverBase *CMIDriverBase::GetDriversParent() const {
return m_pDriverParent;
}
//++
//------------------------------------------------------------------------------------
// Details: Retrieve the pointer to the other fall through driver *this driver
// is using
// (or not using).
// Type: Method.
// Args: None.
// Return: CMIDriverBase * - Pointer to other driver.
// - NULL if no driver set.
// Throws: None.
//--
CMIDriverBase *CMIDriverBase::GetDriverToFallThruTo() const {
return m_pDriverFallThru;
}
//++
//------------------------------------------------------------------------------------
// Details: *this driver provides a file stream to other drivers on which *this
// driver
// write's out to and they read as expected input. *this driver is
// passing
// through commands to the (child) pass through assigned driver.
// Type: Overrideable.
// Args: None.
// Return: FILE * - Pointer to stream.
// Throws: None.
//--
FILE *CMIDriverBase::GetStdin() const {
// Do nothing - override and implement
return nullptr;
}
//++
//------------------------------------------------------------------------------------
// Details: *this driver provides a file stream to other pass through assigned
// drivers
// so they know what to write to.
// Type: Overrideable.
// Args: None.
// Return: FILE * - Pointer to stream.
// Throws: None.
//--
FILE *CMIDriverBase::GetStdout() const {
// Do nothing - override and implement
return nullptr;
}
//++
//------------------------------------------------------------------------------------
// Details: *this driver provides a error file stream to other pass through
// assigned drivers
// so they know what to write to.
// Type: Overrideable.
// Args: None.
// Return: FILE * - Pointer to stream.
// Throws: None.
//--
FILE *CMIDriverBase::GetStderr() const {
// Do nothing - override and implement
return nullptr;
}
//++
//------------------------------------------------------------------------------------
// Details: Set the MI Driver's exit application flag. The application checks
// this flag
// after every stdin line is read so the exit may not be instantaneous.
// If vbForceExit is false the MI Driver queries its state and
// determines if is
// should exit or continue operating depending on that running state.
// Type: Overrideable.
// Args: vbForceExit - (R) True = Do not query, set state to exit, false =
// query if can/should exit right now.
// Return: None.
// Throws: None.
//--
void CMIDriverBase::SetExitApplicationFlag(const bool vbForceExit) {
MIunused(vbForceExit);
// Do nothing - override and implement
}