decompiler  1.0.0
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
GhidraCapability Class Reference

Registration point and dispatcher for commands sent to the decompiler. More...

#include <ghidra_process.hh>

Inheritance diagram for GhidraCapability:
CapabilityPoint GhidraDecompCapability

Public Member Functions

const string & getName (void) const
 Get the capability name.
 
- Public Member Functions inherited from CapabilityPoint
virtual ~CapabilityPoint (void)
 Destructor.
 
virtual void initialize (void)=0
 Complete initialization of an extension point. More...
 

Static Public Member Functions

static int4 readCommand (istream &sin, ostream &out)
 Dispatch a Ghidra command. More...
 
static void shutDown (void)
 Release all GhidraCommand resources.
 
- Static Public Member Functions inherited from CapabilityPoint
static void initializeAll (void)
 Finish initialization for all extension points. More...
 

Protected Attributes

string name
 Identifier for capability and associated commands.
 

Static Protected Attributes

static map< string, GhidraCommand * > commandmap
 The central map from name to Ghidra command.
 

Additional Inherited Members

- Protected Member Functions inherited from CapabilityPoint
 CapabilityPoint (void)
 Construct extension capability exactly once. More...
 

Detailed Description

Registration point and dispatcher for commands sent to the decompiler.

This is the base class for command capabilities (sets of commands). All sets register their commands with a static commandmap. This class provides the method readCommand(), which does the work of parsing a command from the stream and dispatching to the correct GhidraCommand object.

Member Function Documentation

int4 GhidraCapability::readCommand ( istream &  sin,
ostream &  out 
)
static

Dispatch a Ghidra command.

A command is read from the Ghidra client. The matching GhidraCommand object is looked up in the commandmap, and control is handed over to the command, with the i/o streams. The command must be issued following the proper message protocol (see ArchitectureGhidra::readToAnyBurst) or an exception is thrown.

Parameters
sinis the input stream from the client
outis the output stream to the client
Returns
the result code of the command

References ArchitectureGhidra::readStringStream(), and ArchitectureGhidra::readToAnyBurst().

Referenced by getName(), and GhidraDecompCapability::initialize().


The documentation for this class was generated from the following files: