DisassemblePPCRange

Syntax

#include <cafe/ppc_disasm.h>

typedef void (*DisasmReport)(char* outputBuffer, ...);

typedef void* (*DisasmGetSym) (unsigned long addr, unsigned char *symbolName,
                unsigned long nameBufSize);

void DisassemblePPCRange(void *rangeStart, void *rangeEnd,
                         DisasmReport disasmReport, DisasmGetSym disasmGetSym,
                         u32 disasmOptions);

Parameters

rangeStart Pointer to the start of the effective address range to be disassembled.
rangeEnd Pointer to the end of the effective address range to be disassembled.
disasmReport Callback function that can store the disassembly.
disasmGetSym Get symbol names. Typically, use the OSGetSymbolName function.
disasmOptions Sets what and how the char info is given to the call back function.

Return Values

None.

Description

Disassembles PowerPC instructions from effective address rangeStart until effective address rangeEnd. This function expects a message containing printf-style codes and a list of arguments to print that are based on those codes.

Output String Given to Callback

Effective Address Hex Operation Code Operation Instruction Registers
0x020000cc 0x7c0802a6 mfspr r0,8
Options
PPC_DISASM_DEFAULT : Default.
0x020000cc 0x7c0802a6 mfspr r0,8
PPC_DISASM_SIMPLIFY : Uses simplified mnemonics.
0x020000cc 0x7c0802a6 mflr r0
PPC_DISASM_REG_SPACES : Add space between registers.
0x020000cc 0x7c0802a6 mfspr r0,8
PPC_DISASM_EMIT_DISASM : Disassembly only.
mfspr r0,8
PPC_DISASM_EMIT_ADDR : Disassembly and effective address.
0x020000cc mfspr r0,8
PPC_DISASM_EMIT_FUNCS : Displays function names before and during disassembly.
For example, if in crash_demo.c, and in the main function, the following is displayed: crash_demo|main+0x0 0x020000cc 0x7c...
0x020000cc 0x7c0802a6 mfspr r0,8

Demo

A crash dump demo is available at the following location.

$CAFE_ROOT/system/src/demo/crash_dump/crash_dump.c

Do Not Call From

None.

See Also

DisassemblePPCOpcode
OSIsSchedulerLocked

Revision History

2015/03/17 Initial version.


CONFIDENTIAL