mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
HLE logging: Automatically log SCE_KERNEL_ERRORs as strings for functions returning 'i' and 'x' types.
This commit is contained in:
parent
9ad42bcd99
commit
b4f0e3dd5c
1 changed files with 15 additions and 2 deletions
|
@ -1016,15 +1016,28 @@ void hleDoLogInternal(Log t, LogLevel level, u64 res, const char *file, int line
|
|||
}
|
||||
|
||||
const char *fmt;
|
||||
const char *errStr;
|
||||
switch (retmask) {
|
||||
case 'x':
|
||||
// Truncate the high bits of the result (from any sign extension.)
|
||||
res = (u32)res;
|
||||
fmt = "%s%08llx=%s(%s)%s";
|
||||
if ((int)res < 0 && (errStr = KernelErrorToString((u32)res))) {
|
||||
// It's a known syscall error code, let's display it as string.
|
||||
res = (u64)(uintptr_t)errStr;
|
||||
fmt = "%sSCE_KERNEL_ERROR_%s=%s(%s)%s";
|
||||
} else {
|
||||
fmt = "%s%08llx=%s(%s)%s";
|
||||
}
|
||||
break;
|
||||
case 'i':
|
||||
case 'I':
|
||||
fmt = "%s%lld=%s(%s)%s";
|
||||
if ((int)res < 0 && (errStr = KernelErrorToString((u32)res))) {
|
||||
// It's a known syscall error code, let's display it as string.
|
||||
res = (u64)(uintptr_t)errStr;
|
||||
fmt = "%sSCE_KERNEL_ERROR_%s=%s(%s)%s";
|
||||
} else {
|
||||
fmt = "%s%lld=%s(%s)%s";
|
||||
}
|
||||
break;
|
||||
case 'f':
|
||||
// TODO: For now, floats are just shown as bits.
|
||||
|
|
Loading…
Add table
Reference in a new issue