]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmnMIOutOfBandRecord.h
Update LLDB snapshot to upstream r241361
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmnMIOutOfBandRecord.h
1 //===-- MICmnMIOutOfBandRecord.h --------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #pragma once
11
12 // Third party headers:
13 #include <map>
14
15 // In-house headers:
16 #include "MICmnBase.h"
17 #include "MIUtilString.h"
18 #include "MICmnMIValueConst.h"
19 #include "MICmnMIValueResult.h"
20
21 //++ ============================================================================
22 // Details: MI common code MI Out-of-band (Async) Record class. A class that encapsulates
23 //          MI result record data and the forming/format of data added to it.
24 //          Out-of-band records are used to notify the GDB/MI client of additional
25 //          changes that have occurred. Those changes can either be a consequence
26 //          of GDB/MI (e.g., a breakpoint modified) or a result of target activity
27 //          (e.g., target stopped).
28 //          The syntax is as follows:
29 //          "*" type ( "," result )*
30 //          type ==> running | stopped
31 //
32 //          The Out-of-band record can be retrieve at any time *this object is
33 //          instantiated so unless work is done on *this Out-of-band record then it is
34 //          possible to return a malformed Out-of-band record. If nothing has been set
35 //          or added to *this MI Out-of-band record object then text "<Invalid>" will
36 //          be returned.
37 //
38 //          More information see:
39 //          http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_22.html//
40 //          Gotchas: None.
41 // Authors: Illya Rudkin 24/02/2014.
42 // Changes: None.
43 //--
44 class CMICmnMIOutOfBandRecord : public CMICmnBase
45 {
46     // Enumerations:
47   public:
48     //++
49     // Details: Enumeration of the type of Out-of-band for *this Out-of-band record
50     //--
51     enum OutOfBand_e
52     {
53         eOutOfBand_Running = 0,
54         eOutOfBand_Stopped,
55         eOutOfBand_BreakPointCreated,
56         eOutOfBand_BreakPointModified,
57         eOutOfBand_Thread,
58         eOutOfBand_ThreadGroupAdded,
59         eOutOfBand_ThreadGroupExited,
60         eOutOfBand_ThreadGroupRemoved,
61         eOutOfBand_ThreadGroupStarted,
62         eOutOfBand_ThreadCreated,
63         eOutOfBand_ThreadExited,
64         eOutOfBand_ThreadSelected,
65         eOutOfBand_TargetModuleLoaded,
66         eOutOfBand_TargetModuleUnloaded,
67         eOutOfBand_TargetStreamOutput,
68         eOutOfBand_count // Always the last one
69     };
70
71     // Typedefs:
72   public:
73     typedef std::map<OutOfBand_e, CMIUtilString> MapOutOfBandToOutOfBandText_t;
74     typedef std::map<OutOfBand_e, CMIUtilString> MapOutOfBandToToken_t;
75
76     // Methods:
77   public:
78     /* ctor */ CMICmnMIOutOfBandRecord(void);
79     /* ctor */ CMICmnMIOutOfBandRecord(const OutOfBand_e veType);
80     /* ctor */ CMICmnMIOutOfBandRecord(const OutOfBand_e veType, const CMICmnMIValueConst &vConst);
81     /* ctor */ CMICmnMIOutOfBandRecord(const OutOfBand_e veType, const CMICmnMIValueResult &vResult);
82     //
83     const CMIUtilString &GetString(void) const;
84     bool Add(const CMICmnMIValueResult &vResult);
85
86     // Overridden:
87   public:
88     // From CMICmnBase
89     /* dtor */ virtual ~CMICmnMIOutOfBandRecord(void);
90
91     // Methods:
92   private:
93     bool BuildAsyncRecord(void);
94
95     // Attributes:
96   private:
97     static MapOutOfBandToOutOfBandText_t ms_constMapOutOfBandToAsyncRecordText;
98     static MapOutOfBandToToken_t ms_constMapOutOfBandTextToToken;
99     //
100     OutOfBand_e m_eResultAsyncRecordClass;
101     CMIUtilString m_strAsyncRecord; // Holds the text version of the result record to date
102     CMICmnMIValueResult m_partResult;
103 };