]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/tools/lldb-mi/MIDriverBase.h
Unbreak DRM KMS build by adding the needed compatibility field in the LinuxKPI.
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / tools / lldb-mi / MIDriverBase.h
1 //===-- MIDriverBase.h ------------------------------------------*- C++ -*-===//
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 #pragma once
10
11 // Third party headers:
12 #include "lldb/API/SBBroadcaster.h"
13 #include "lldb/API/SBDebugger.h"
14
15 // In-house headers:
16 #include "MIUtilString.h"
17
18 // Declarations:
19 namespace lldb {
20 class SBBroadcaster;
21 }
22
23 //++
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.
33 //--
34 class CMIDriverBase {
35   // Methods:
36 public:
37   /* ctor */ CMIDriverBase();
38
39   CMIDriverBase *GetDriverToFallThruTo() const;
40   CMIDriverBase *GetDriversParent() const;
41
42   // Overrideable:
43 public:
44   /* dtor */ virtual ~CMIDriverBase();
45
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);
53
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;
58
59   // Attributes:
60 protected:
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
64                                   // driver to do work
65   CMIUtilString m_strDriverId;
66   bool m_bExitApp; // True = Yes, exit application, false = continue execution
67 };