IDEBUGGER_SHELL Class Reference

#include <debugger-shell.H>

Inherited by DEBUGGER_SHELL.

List of all members.

Public Member Functions

virtual BOOL Enable (const DEBUGGER_SHELL_ARGS &args)=0
virtual unsigned GetHelpCount ()=0
virtual BOOL GetHelpString (unsigned index, std::string *cmd, std::string *description)=0
virtual REG GetSkipOneRegister ()=0
virtual ~IDEBUGGER_SHELL ()


Detailed Description

Pin tools that run with the "-appdebug" switch can use this class to implement some common custom debugger commands. Once enabled, these commands can be typed interactively at the debugger prompt. In GDB, type "monitor help" to see a list of the available commands.

Typical usage in the tool is as follows:

include "debugger-shell.H"

int main(int argc, char **argv) { if (PIN_Init(argc,argv)) return 1;

IDEBUGGER_SHELL *shell = CreateDebuggerShell(); DEBUGGER_SHELL_ARGS args; if (!shell->Enable(args)) return 1;

PIN_StartProgram(); }

The tool must also compile and link with "debugger-shell.cpp".


Constructor & Destructor Documentation

virtual IDEBUGGER_SHELL::~IDEBUGGER_SHELL  )  [inline, virtual]
 

Destroys the DEBUGGER_SHELL object.


Member Function Documentation

virtual BOOL IDEBUGGER_SHELL::Enable const DEBUGGER_SHELL_ARGS args  )  [pure virtual]
 

This method must be called once, typically from the tool's main() function. It enables the Pin instrumentation which implements the debugger extensions.

Parameters:
[in] args Arguments that customize the debugger shell.
Returns:
TRUE on success. If there is an error, a diagnostic is printed this method returns FALSE.

virtual unsigned IDEBUGGER_SHELL::GetHelpCount  )  [pure virtual]
 

Tools that set DEBUGGER_SHELL_ARGS._enableHelp to FALSE, may want to use this method and GetHelpString() to print their own help message.

Returns:
The number of help commands.

virtual BOOL IDEBUGGER_SHELL::GetHelpString unsigned  index,
std::string *  cmd,
std::string *  description
[pure virtual]
 

Get the help message describing a single debugger command.

Parameters:
[in] index An index telling which command to return help for. Must be in the range [0,n-1], where n is the value returned by GetHelpCount().
[out] cmd Receives the name of the debugger command.
[out] description Receives a description of what the command does.
Returns:
TRUE on success, FALSE if index is out of range.

virtual REG IDEBUGGER_SHELL::GetSkipOneRegister  )  [pure virtual]
 

Tools that override the default instrumentation with IDEBUGGER_SHELL_INSTRUMENTOR may need a virtual register to hold the "skip one" flag. This method provides the register number to use for this.

Returns:
The Pin virtual register to use for the "skip one" flag. This is one of the REG_INST_Gn registers.


The documentation for this class was generated from the following file:
Generated on Tue Dec 15 03:24:17 2009 for Pin by  doxygen 1.4.6