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 //===----------------------------------------------------------------------===//
10 // Overview: CMICmdCmdGdbInfo interface.
12 // To implement new MI commands derive a new command class from the
14 // class. To enable the new command for interpretation add the new
16 // to the command factory. The files of relevance are:
20 // For an introduction to adding a new command see
21 // CMICmdCmdSupportInfoMiCmdQuery
22 // command class as an example.
26 // Third party headers:
30 #include "MICmdBase.h"
33 //============================================================================
34 // Details: MI command class. MI commands derived from the command base class.
35 // *this class implements GDB command "info".
36 // The design of matching the info request to a request action (or
37 // command) is very simple. The request function which carries out
38 // the task of information gathering and printing to stdout is part of
39 // *this class. Should the request function become more complicated
41 // that request should really reside in a command type class. Then this
42 // class instantiates a request info command for a matching request.
44 // design/code of *this class then does not then become bloated. Use a
45 // lightweight version of the current MI command system.
47 class CMICmdCmdGdbInfo : public CMICmdBase {
50 // Required by the CMICmdFactory when registering *this command
51 static CMICmdBase *CreateSelf();
55 /* ctor */ CMICmdCmdGdbInfo();
59 // From CMICmdInvoker::ICmd
60 bool Execute() override;
61 bool Acknowledge() override;
62 bool ParseArgs() override;
64 /* dtor */ ~CMICmdCmdGdbInfo() override;
68 typedef bool (CMICmdCmdGdbInfo::*FnPrintPtr)();
69 typedef std::map<CMIUtilString, FnPrintPtr> MapPrintFnNameToPrintFn_t;
73 bool GetPrintFn(const CMIUtilString &vrPrintFnName, FnPrintPtr &vrwpFn) const;
74 bool PrintFnSharedLibrary();
78 const static MapPrintFnNameToPrintFn_t ms_mapPrintFnNameToPrintFn;
80 const CMIUtilString m_constStrArgNamedPrint;
81 bool m_bPrintFnRecognised; // True = This command has a function with a name
82 // that matches the Print argument, false = not
84 bool m_bPrintFnSuccessful; // True = The print function completed its task ok,
85 // false = function failed for some reason
86 CMIUtilString m_strPrintFnName;
87 CMIUtilString m_strPrintFnError;