diff --git a/core/libs/prx/libkernel/System/src/Coredump.cpp b/core/libs/prx/libkernel/System/src/Coredump.cpp index 9c6cc3986..1daea6429 100644 --- a/core/libs/prx/libkernel/System/src/Coredump.cpp +++ b/core/libs/prx/libkernel/System/src/Coredump.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "SceTypes.hpp" #include "prx/libc/include/General.hpp" @@ -23,4 +24,13 @@ int APS5_VABI sceCoredumpUnregisterCoredumpHandler(void) { return 0; } +// A libc that fails to throw (no handler: the exception is uncaught) reports it here right before +// std::terminate, after its own stderr line; the console keeps it for the core dump, we print it. +// The second argument is 0x400 from the libc that calls it; its meaning is not known. +int APS5_VABI sceKernelDebugWriteCppExceptionInfo(const void* exception, uint64_t unknown, const char* typeName, const char* what) { + (void)unknown; + std::fprintf(stderr, "[coredump] uncaught C++ exception %p of type %s%s%s\n", exception, typeName ? typeName : "(unknown)", what ? ", what(): " : "", what ? what : ""); + return 0; +} + }