DisassemblePPCOpcode

Syntax

#include <cafe/ppc_disasm.h>

typedef void* (*DisasmGetSym) (unsigned long addr, unsigned char *symbolName,
                unsigned long nameBufSize);
  
BOOL DisassemblePPCOpcode(u32 *opcode, char *outputBuffer, u32 bufferSize,
                          DisasmGetSym disasmGetSym, u32 disasmOptions);

Parameters

opcode Pointer to the effective address of the instruction.
outputBuffer Pointer to the char buffer that holds the disassembled instruction.
bufferSize Size of given output buffer that must be less than or equal to PPC_DISASM_MAX_BUFFER (64).
disasmGetSym Get symbol names. Typically, use the OSGetSymbolName function.
disasmOptions Set to default or simplified mnemonics. For more information, see the following table.
Option Meaning Example
PPC_DISASM_DEFAULT Default mfspr r0,8
PPC_DISASM_SIMPLIFY Simplified mflr r0

Return Values

Returns TRUE when a valid operation code is found.

Description

Disassembles one PowerPC instruction.

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

DisassemblePPCRange
OSIsSchedulerLocked

Revision History

2015/03/17 Initial version.


CONFIDENTIAL