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