1 //===-- MIDriverBase.h ------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
11 // Third party headers:
12 #include "lldb/API/SBBroadcaster.h"
13 #include "lldb/API/SBDebugger.h"
16 #include "MIUtilString.h"
24 //============================================================================
25 // Details: MI driver base implementation class. This class has been created so
26 // not have to edit the lldb::SBBroadcaster class code. Functionality
27 // and attributes need to be common to the LLDB Driver class and the
28 // MI Driver class (derived from lldb::SBBroadcaster) so they can call
29 // upon each other for functionality fall through and allow the
30 // CDriverMgr to manage either (any) driver to be operated on.
31 // Each driver instance (the CMIDriver, LLDB::Driver) has its own
32 // LLDB::SBDebugger object.
37 /* ctor */ CMIDriverBase();
39 CMIDriverBase *GetDriverToFallThruTo() const;
40 CMIDriverBase *GetDriversParent() const;
44 /* dtor */ virtual ~CMIDriverBase();
46 virtual bool DoFallThruToAnotherDriver(const CMIUtilString &vCmd,
47 CMIUtilString &vwErrMsg);
48 virtual bool SetDriverToFallThruTo(const CMIDriverBase &vrOtherDriver);
49 virtual bool SetDriverParent(const CMIDriverBase &vrOtherDriver);
50 virtual const CMIUtilString &GetDriverName() const = 0;
51 virtual const CMIUtilString &GetDriverId() const = 0;
52 virtual void SetExitApplicationFlag(const bool vbForceExit);
54 // MI provide information for the pass through (child) assigned driver
55 virtual FILE *GetStdin() const;
56 virtual FILE *GetStdout() const;
57 virtual FILE *GetStderr() const;
61 CMIDriverBase *m_pDriverFallThru; // Child driver to use should *this driver
62 // not be able to handle client input
63 CMIDriverBase *m_pDriverParent; // The parent driver who passes work to *this
65 CMIUtilString m_strDriverId;
66 bool m_bExitApp; // True = Yes, exit application, false = continue execution