1 //===-- MICmdCmdGdbInfo.h --------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 // File: MICmdCmdGdbInfo.h
13 // Overview: CMICmdCmdGdbInfo interface.
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:
21 // For an introduction to adding a new command see CMICmdCmdSupportInfoMiCmdQuery
22 // command class as an example.
24 // Environment: Compilers: Visual C++ 12.
25 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
26 // Libraries: See MIReadmetxt.
33 // Third party headers:
37 #include "MICmdBase.h"
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.
51 // Authors: Illya Rudkin 05/06/2014.
54 class CMICmdCmdGdbInfo : public CMICmdBase
58 // Required by the CMICmdFactory when registering *this command
59 static CMICmdBase * CreateSelf( void );
63 /* ctor */ CMICmdCmdGdbInfo( void );
67 // From CMICmdInvoker::ICmd
68 virtual bool Execute( void );
69 virtual bool Acknowledge( void );
70 virtual bool ParseArgs( void );
72 /* dtor */ virtual ~CMICmdCmdGdbInfo( void );
76 typedef bool (CMICmdCmdGdbInfo::*FnPrintPtr)();
77 typedef std::map< CMIUtilString, FnPrintPtr > MapPrintFnNameToPrintFn_t;
81 bool GetPrintFn( const CMIUtilString & vrPrintFnName, FnPrintPtr & vrwpFn ) const;
82 bool PrintFnSharedLibrary( void );
86 const static MapPrintFnNameToPrintFn_t ms_mapPrintFnNameToPrintFn;
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;