]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdCmdGdbInfo.h
Merge ^/head r275685 through r275714.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdCmdGdbInfo.h
1 //===-- MICmdCmdGdbInfo.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:                MICmdCmdGdbInfo.h
12 //
13 // Overview:    CMICmdCmdGdbInfo        interface.
14 //
15 //                              To implement new MI commands derive a new command class from the command base 
16 //                              class. To enable the new command for interpretation add the new command class
17 //                              to the command factory. The files of relevance are:
18 //                                      MICmdCommands.cpp
19 //                                      MICmdBase.h / .cpp
20 //                                      MICmdCmd.h / .cpp
21 //                              For an introduction to adding a new command see CMICmdCmdSupportInfoMiCmdQuery
22 //                              command class as an example.
23 //
24 // Environment: Compilers:      Visual C++ 12.
25 //                                                      gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
26 //                              Libraries:      See MIReadmetxt. 
27 //
28 // Copyright:   None.
29 //--
30
31 #pragma once
32
33 // Third party headers:
34 #include <map>
35
36 // In-house headers:
37 #include "MICmdBase.h"
38
39 //++ ============================================================================
40 // Details:     MI command class. MI commands derived from the command base class.
41 //                      *this class implements GDB command "info".
42 //                      The design of matching the info request to a request action (or 
43 //                      command) is very simple. The request function which carries out
44 //                      the task of information gathering and printing to stdout is part of
45 //                      *this class. Should the request function become more complicated then
46 //                      that request should really reside in a command type class. Then this
47 //                      class instantiates a request info command for a matching request. The
48 //                      design/code of *this class then does not then become bloated. Use a
49 //                      lightweight version of the current MI command system.
50 // Gotchas:     None.
51 // Authors:     Illya Rudkin 05/06/2014.
52 // Changes:     None.
53 //--
54 class CMICmdCmdGdbInfo : public CMICmdBase
55 {
56 // Statics:
57 public:
58         // Required by the CMICmdFactory when registering *this command
59         static CMICmdBase *     CreateSelf( void );
60
61 // Methods:
62 public:
63         /* ctor */      CMICmdCmdGdbInfo( void );
64
65 // Overridden:
66 public:
67         // From CMICmdInvoker::ICmd
68         virtual bool    Execute( void );
69         virtual bool    Acknowledge( void );
70         virtual bool    ParseArgs( void );
71         // From CMICmnBase
72         /* dtor */ virtual ~CMICmdCmdGdbInfo( void );
73
74 // Typedefs:
75 private:
76         typedef bool (CMICmdCmdGdbInfo::*FnPrintPtr)();
77         typedef std::map< CMIUtilString, FnPrintPtr >   MapPrintFnNameToPrintFn_t;
78
79 // Methods:
80 private:
81         bool    GetPrintFn( const CMIUtilString & vrPrintFnName, FnPrintPtr & vrwpFn ) const;
82         bool    PrintFnSharedLibrary( void );
83
84 // Attributes:
85 private:
86         const static MapPrintFnNameToPrintFn_t  ms_mapPrintFnNameToPrintFn;
87         //
88         const CMIUtilString     m_constStrArgNamedPrint;
89         bool                            m_bPrintFnRecognised;           // True = This command has a function with a name that matches the Print argument, false = not found 
90         bool                            m_bPrintFnSuccessful;           // True = The print function completed its task ok, false = function failed for some reason
91         CMIUtilString           m_strPrintFnName;
92         CMIUtilString           m_strPrintFnError;
93 };