vitasdk
Documentation of the vitasdk

Exports for Kernel. More...

Typedefs

typedef SceInt32() SceDbgpBreakpointHandler(ScePID pid, SceUID thid, ScePVoid bkpt_addr, SceUIntPtr sp, SceUInt32 cpsr, SceUInt32 arm_opcode, SceUInt16 thumb_opcode, SceBool is_thumb)
 DTrace breakpoint callback.
 

Functions

SceDbgpBreakpointHandler * ksceDbgpGetDTraceBreakpointHandler (void)
 Get the DTrace fasttrap BKPT #0x91 handler.
 
SceDbgpBreakpointHandler * ksceDbgpGetDTraceUsdtHandler (void)
 Get the DTrace USDT BKPT #0x90 handler.
 
void ksceDbgpSetDTraceBreakpointHandler (SceDbgpBreakpointHandler *handler)
 Set the DTrace fasttrap BKPT #0x91 handler.
 
void ksceDbgpSetDTraceUsdtHandler (SceDbgpBreakpointHandler *handler)
 Set the DTrace USDT BKPT #0x90 handler.
 

Detailed Description

Exports for Kernel.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceDeci4pDbgpForDriver_stub



Typedef Documentation

◆ SceDbgpBreakpointHandler

typedef SceInt32() SceDbgpBreakpointHandler(ScePID pid, SceUID thid, ScePVoid bkpt_addr, SceUIntPtr sp, SceUInt32 cpsr, SceUInt32 arm_opcode, SceUInt16 thumb_opcode, SceBool is_thumb)

DTrace breakpoint callback.

The callback runs from SceDeci4pDbgp's prefetch-abort hook for a user-mode breakpoint, with IRQs enabled. Exactly one opcode argument is initialized: arm_opcode when is_thumb is false, or thumb_opcode when it is true. The other opcode argument is not initialized and contains data from the exception stack. Do not read it. The opcode value uses the CPU's native little-endian representation.

The handler registered by ksceDbgpSetDTraceUsdtHandler is called for ARM opcode 0xE1200970 or Thumb opcode 0xBE90, both of which encode BKPT #0x90. If the handler returns 0 or greater, Dbgp treats the breakpoint as handled and advances the saved PC. If it returns less than 0, Dbgp continues normal debugger handling. The handler registered by ksceDbgpSetDTraceBreakpointHandler is called for ARM opcode 0xE1200971 or Thumb opcode 0xBE91, which encode BKPT #0x91; SceDeci4pDbgp ignores its return value.

Parameters
[in]pidID of the process containing the faulting thread.
[in]thidFaulting thread ID.
[in]bkpt_addrAddress of the breakpoint instruction in pid.
[in]spSaved stack pointer at the breakpoint.
[in]cpsrSaved CPSR at the breakpoint.
[in]arm_opcodeARM instruction word; valid only when is_thumb is false.
[in]thumb_opcodeThumb instruction halfword; valid only when is_thumb is true.
[in]is_thumbNonzero when the fault occurred in Thumb state.

Function Documentation

◆ ksceDbgpGetDTraceBreakpointHandler()

SceDbgpBreakpointHandler * ksceDbgpGetDTraceBreakpointHandler ( void  )

Get the DTrace fasttrap BKPT #0x91 handler.

Returns
The currently registered handler, or NULL if none is registered.

◆ ksceDbgpGetDTraceUsdtHandler()

SceDbgpBreakpointHandler * ksceDbgpGetDTraceUsdtHandler ( void  )

Get the DTrace USDT BKPT #0x90 handler.

Returns
The currently registered handler, or NULL if none is registered.

◆ ksceDbgpSetDTraceBreakpointHandler()

void ksceDbgpSetDTraceBreakpointHandler ( SceDbgpBreakpointHandler *  handler)

Set the DTrace fasttrap BKPT #0x91 handler.

This function stores the handler pointer without locking, validation, reference counting, or taking ownership. The callback and its containing module must remain valid while registered.

Parameters
[in]handlerHandler to register, or NULL to unregister it.

◆ ksceDbgpSetDTraceUsdtHandler()

void ksceDbgpSetDTraceUsdtHandler ( SceDbgpBreakpointHandler *  handler)

Set the DTrace USDT BKPT #0x90 handler.

This function stores the handler pointer without locking, validation, reference counting, or taking ownership. The callback and its containing module must remain valid while registered.

Parameters
[in]handlerHandler to register, or NULL to unregister it.