#include <debugger-shell.H>
Some tools may need to define their own analysis routine that stops at a debugger breakpoint. Such tools can define their own class, which derives from ICUSTOM_INSTRUMENTOR. Pass a pointer to that object to STARTUP_ARGUMENTS::_customInstrumentor.
Most tools do not need to override the default instrumentation, so most tools need not use this interface.
◆ InsertBreakpointAfter()
virtual VOID DEBUGGER_SHELL::ICUSTOM_INSTRUMENTOR::InsertBreakpointAfter |
( |
INS |
ins, |
|
|
BBL |
bbl, |
|
|
IPOINT |
ipoint, |
|
|
CALL_ORDER |
order, |
|
|
const std::string & |
message |
|
) |
| |
|
pure virtual |
The debugger shell calls this method to insert a "then" instrumentation call to an analysis routine that stops at a debugger breakpoint after an instruction. The default instrumentation looks like this. Tools that implement this method should insert similar instrumentation:
const std::string &message)
{
IARG_END);
}
VOID TriggerBreakpointAfter(
CONTEXT *ctxt, ADDRINT pc,
THREADID tid,
const char *message)
{
std::ostringstream os;
os << message << "\n";
os << "Breakpoint triggered after instruction at 0x" << std::hex << pc;
}
- Parameters
-
[in] | ins | Insert the instrumentation after this instruction. |
[in] | bbl | The basic block containing ins. |
[in] | ipoint | Tells whether to instrument IPOINT_AFTER or IPOINT_TAKEN_BRANCH. |
[in] | order | The instrumentation call order to use for the instrumentation. |
[in] | message | String telling why the breakpoint is triggered. The string is allocated in permanent storage, so the client can pass it directly to an analysis routine. If the debugger shell removes instrumentation, it will also deallocate this string. |
◆ InsertBreakpointBefore()
virtual VOID DEBUGGER_SHELL::ICUSTOM_INSTRUMENTOR::InsertBreakpointBefore |
( |
INS |
ins, |
|
|
BBL |
bbl, |
|
|
CALL_ORDER |
order, |
|
|
const std::string & |
message |
|
) |
| |
|
pure virtual |
The debugger shell calls this method to insert a "then" instrumentation call to an analysis routine that stops at a debugger breakpoint before an instruction. The default instrumentation looks like this. Tools that implement this method should insert similar instrumentation:
{
IARG_END);
}
VOID TriggerBreakpointBefore(
CONTEXT *ctxt,
THREADID tid, UINT32 regSkipOne,
const char *message)
{
if (skipPc == pc)
return
}
See the method ISHELL::GetSkipOneRegister() for the register number to use for RegSkipOne.
- Parameters
-
[in] | ins | Insert the instrumentation before this instruction. |
[in] | bbl | The basic block containing ins. |
[in] | order | The instrumentation call order to use for the instrumentation. |
[in] | message | String telling why the breakpoint is triggered. The string is allocated in permanent storage, so the client can pass it directly to an analysis routine. If the debugger shell removes instrumentation, it will also deallocate this string. |
The documentation for this class was generated from the following file: