1 //===-- MIDriverBase.h ------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // Third party headers:
13 #include "lldb/API/SBBroadcaster.h"
14 #include "lldb/API/SBDebugger.h"
17 #include "MIUtilString.h"
25 //============================================================================
26 // Details: MI driver base implementation class. This class has been created so
27 // not have to edit the lldb::SBBroadcaster class code. Functionality
28 // and attributes need to be common to the LLDB Driver class and the
29 // MI Driver class (derived from lldb::SBBroadcaster) so they can call
30 // upon each other for functionality fall through and allow the
31 // CDriverMgr to manage either (any) driver to be operated on.
32 // Each driver instance (the CMIDriver, LLDB::Driver) has its own
33 // LLDB::SBDebugger object.
38 /* ctor */ CMIDriverBase();
40 CMIDriverBase *GetDriverToFallThruTo() const;
41 CMIDriverBase *GetDriversParent() const;
45 /* dtor */ virtual ~CMIDriverBase();
47 virtual bool DoFallThruToAnotherDriver(const CMIUtilString &vCmd,
48 CMIUtilString &vwErrMsg);
49 virtual bool SetDriverToFallThruTo(const CMIDriverBase &vrOtherDriver);
50 virtual bool SetDriverParent(const CMIDriverBase &vrOtherDriver);
51 virtual const CMIUtilString &GetDriverName() const = 0;
52 virtual const CMIUtilString &GetDriverId() const = 0;
53 virtual void SetExitApplicationFlag(const bool vbForceExit);
55 // MI provide information for the pass through (child) assigned driver
56 virtual FILE *GetStdin() const;
57 virtual FILE *GetStdout() const;
58 virtual FILE *GetStderr() const;
62 CMIDriverBase *m_pDriverFallThru; // Child driver to use should *this driver
63 // not be able to handle client input
64 CMIDriverBase *m_pDriverParent; // The parent driver who passes work to *this
66 CMIUtilString m_strDriverId;
67 bool m_bExitApp; // True = Yes, exit application, false = continue execution