debug
Index
int DecodeLocationA(
void * addr,
struct TagItem * tags );
int DecodeLocation(
void * addr,
TAG tag, ... );
Locate the given address in the list of registered modules and return
information about it.
addr - An address to resolve
tags - An optional taglist. ti_Tag can be one of the following tags and
ti_Data is always a pointer to a storage of specified type.
Resulting values will be placed into specified locations if the
function succeeds.
DL_ModuleName (char *) - Module name
DL_SegmentName (char *) - Segment name. Can be NULL if there were
no segment names provided for the module.
DL_SegmentPointer (BPTR) - DOS pointer to the corresponding segment.
Note that it will be different from
KDL_SegmentStart value
DL_SegmentNumber (unsigned int) - Order number of the segment in the
module
DL_SegmentStart (void *) - Start address of actual segment contents
in memory.
DL_SegmentEnd (void *) - End address of actual segment contents
in memory.
DL_FirstSegment (BPTR) - DOS pointer to the first segment.
The following tags may return NULL values if there was no corresponding
information provided for the module:
DL_SymbolName (char *) - Symbol name (function or variable name)
DL_SymbolStart (void *) - Start address of contents described by this
symbol.
DL_SymbolEnd (void *) - End address of contents described by this
symbol.
Zero if lookup failed and no corresponding module found, nonzero
otherwise.
If the function fails values pointed to by taglist will not be changed.
IPTR DisassembleCtx(
APTR ctx );
Disassemble the next instruction for the given context handle.
ctx - Disassembly context handle.
returns the size of the disassembled instruction.
void EnumerateSymbolsA(
struct Hook * handler,
struct TagItem * tags );
void EnumerateSymbols(
struct Hook * handler,
TAG tag, ... );
Function will call the handler hook for all symbols from kickstart and
loaded modules that match the given search criteria.
The message that is passed to hook contains a pointer to struct SymbolInfo.
void FreeDisassembleCtx(
APTR ctx );
Free the disassemble context
ctx - Disassembly context handle.
APTR GetCtxInstructionA(
APTR ctx,
struct TagItem * tags );
APTR GetCtxInstruction(
APTR ctx,
TAG tag, ... );
Get the requested attributes for the disasembled
instruction, for the specified Disassembly context.
ctx - Disassembly context handle.
tags - Taglist of requested attributes.
DCIT_Instruction_Offset - instructions offset relative to the PC.
DCIT_Instruction_HexStr - instruction in hex format
DCIT_Instruction_Asm - disassembled instruction
number of handled attributes.
APTR InitDisassembleCtx(
APTR start,
APTR end,
APTR pc );
Initializes a disassembly context for the given inputs.
start - Start address of disassembly
end - End address of disassembly
pc - Program Counter value.
returns a disassembly context handle.
void RegisterModule(
const char * name,
BPTR segList,
ULONG debugType,
APTR debugInfo );
Add information about the loaded executable module to the
debug information database
name - Module name
segList - DOS segment list for the module
debugType - Type of supplied debug information. The only currently
supported type is DEBUG_ELF.
debugInfo - Debug information data. For DEBUG_ELF type this should be
a pointer to struct ELF_DebugInfo, filled in as follows:
eh - a pointer to ELF file header.
sh - a pointer to an array of ELF section headers.
void UnregisterModule(
BPTR segList );
Remove previously registered module from the debug information database
segList - DOS segment list for the module to remove
The function correctly supports partial removal of the module
(when an existing seglist is broken and only a part of the module
is unloaded).
|
|