vitasdk
Documentation of the vitasdk

Exports for Kernel. More...

Data Structures

struct  SceKernelCallFrame
 

Macros

#define SCE_KERNEL_BACKTRACE_CONTEXT_CURRENT   (0x00000000)
 Current thread.
 

Enumerations

enum  SceKernelBacktraceMode { SCE_KERNEL_BACKTRACE_MODE_USER = 0x00000000 , SCE_KERNEL_BACKTRACE_MODE_KERNEL = 0x00000001 , SCE_KERNEL_BACKTRACE_MODE_DONT_EXCEED = 0x00000002 , SCE_KERNEL_BACKTRACE_MODE_UNK_0x00000008 = 0x00000008 }
 

Functions

 VITASDK_BUILD_ASSERT_EQ (1, SceKernelBacktraceMode)
 
 VITASDK_BUILD_ASSERT_EQ (8, SceKernelCallFrame)
 
int ksceKernelBacktrace (SceUID thread_id, SceKernelCallFrame *call_frame_buffer, SceSize num_bytes_buffer, SceUInt32 *num_frames, SceInt32 mode)
 Get a thread backtrace.
 

Variables

SceUIntVAddr SceKernelCallFrame::sp
 Stack pointer.
 
SceUIntVAddr SceKernelCallFrame::pc
 Program counter.
 

Detailed Description

Exports for Kernel.


Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceBacktraceForDriver_stub




Data Structure Documentation

◆ SceKernelCallFrame

struct SceKernelCallFrame
Data Fields
SceUIntVAddr sp Stack pointer.
SceUIntVAddr pc Program counter.

Macro Definition Documentation

◆ SCE_KERNEL_BACKTRACE_CONTEXT_CURRENT

#define SCE_KERNEL_BACKTRACE_CONTEXT_CURRENT   (0x00000000)

Current thread.

Enumeration Type Documentation

◆ SceKernelBacktraceMode

Enumerator
SCE_KERNEL_BACKTRACE_MODE_USER 

Unwind the user-mode stack.

SCE_KERNEL_BACKTRACE_MODE_KERNEL 

Unwind the kernel-mode stack.

SCE_KERNEL_BACKTRACE_MODE_DONT_EXCEED 

Stop unwinding when the output buffer is full.

SCE_KERNEL_BACKTRACE_MODE_UNK_0x00000008 

Accepted but ignored on FW 3.60.

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/2]

VITASDK_BUILD_ASSERT_EQ ( 1  ,
SceKernelBacktraceMode   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/2]

VITASDK_BUILD_ASSERT_EQ ( 8  ,
SceKernelCallFrame   
)

◆ ksceKernelBacktrace()

int ksceKernelBacktrace ( SceUID  thread_id,
SceKernelCallFrame *  call_frame_buffer,
SceSize  num_bytes_buffer,
SceUInt32 *  num_frames,
SceInt32  mode 
)

Get a thread backtrace.

Parameters
[in]thread_idThread ID, or SCE_KERNEL_BACKTRACE_CONTEXT_CURRENT.
[out]call_frame_bufferBuffer that receives call frames, or NULL when num_bytes_buffer is 0.
[in]num_bytes_bufferSize of the call-frame buffer in bytes. A non-NULL buffer must have room for at least one frame.
[out]num_framesReceives the number of frames written to the output buffer. May be NULL.
[in]modeBitwise OR of SceKernelBacktraceMode values.
Returns
On success, 0 with SCE_KERNEL_BACKTRACE_MODE_DONT_EXCEED set; otherwise, the total number of frames in the call stack, including frames that did not fit in the output buffer. Returns < 0 on error.
Note
On FW 3.60 this function requires development mode. Kernel-mode unwinding also requires the corresponding QAF permission.

Variable Documentation

◆ sp

SceUIntVAddr SceKernelCallFrame::sp

Stack pointer.

◆ pc

SceUIntVAddr SceKernelCallFrame::pc

Program counter.