How can I debug a kernel PRX?
printf on screen or writing to a file or ...?
Debug PRX
I've tried both printf and Kprintf but none of them seems to work.
I've also tried this (from psplink.h):
still nothing :(
I've also tried this (from psplink.h):
Code: Select all
#define DEBUG_START { int fd; fd = sceIoOpen("ms0:/debug.txt", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0666); sceIoClose(fd); }
`
#define DEBUG_PRINTF(fmt, ...) \
{ \
int fd; \
fd = sceIoOpen("ms0:/debug.txt", PSP_O_WRONLY | PSP_O_APPEND, 0666); \
fdprintf(fd, fmt, ## __VA_ARGS__); \
sceIoClose(fd); \
}
You need this for kernel mode to write to memory stick, suppose you are trying to log from an exported function that is a syscall.
include systemctrl.h and add -lpspsystemctrl_kernel from M33SDK
include systemctrl.h and add -lpspsystemctrl_kernel from M33SDK
Code: Select all
int k1 = pspSdkSetK1(0);
int level = sctrlKernelSetUserLevel(8);
SceUID fp = sceIoOpen("ms0:/seplugins/log.txt", PSP_O_WRONLY|PSP_O_CREAT, 0777);
sceIoLseek(fp, 0, SEEK_END);
sceIoWrite(fp, "log data", strlen("log data"));
sceIoClose(fp);
sctrlKernelSetUserLevel(level);
pspSdkSetK1(k1);
I included the "systemctrl.h" from M33SDK (4.01M33 any newer?) and the following compile errors:
is it really this HARD to just SEE some text somewhere? :(
just for curiosity: what is the user level 8?
and what is this M33SDK at all? any doc around? :p
Code: Select all
psp/sdk/include/systemctrl.h (200) : error: expected ')' before '*' t
oken
psp/sdk/include/systemctrl.h (241) : error: expected '=', ',', ';', '
asm' or '__attribute__' before 'sctrlHENSetStartModuleHandler'
just for curiosity: what is the user level 8?
and what is this M33SDK at all? any doc around? :p