MCPcopy Create free account
hub / github.com/doldecomp/mkdd / panic_f_va

Method panic_f_va

libs/JSystem/JUtility/JUTException.cpp:145–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145void JUTException::panic_f_va(const char *file, int line, const char *fmt, va_list vl)
146{
147 char buf[256];
148 int n = vsnprintf(buf, sizeof(buf) - 1, fmt, vl);
149 if(sErrorManager == nullptr) {
150 OSPanic(file, line, buf);
151 }
152 static OSContext context;
153 memcpy(&context, OSGetCurrentContext(), sizeof(OSContext));
154 sErrorManager->mStackPointer = OSGetStackPointer();
155 exCallbackObject.callback = sPreUserCallback;
156 exCallbackObject.error = 0xff;
157 exCallbackObject.context = &context;
158 exCallbackObject.dsisr = 0;
159 exCallbackObject.dar = 0;
160
161 if (sConsole == nullptr || sConsole && FLAG_ON(sConsole->getOutput(), JUTConsole::OUTPUT_CONSOLE))
162 {
163 OSReport("%s in \"%s\" on line %d\n", buf, file, line);
164 }
165
166 if(sConsole)
167 sConsole->print_f("%s in \"%s\" on line %d\n", buf, file, line);
168
169 OSSendMessage(&sMessageQueue, &exCallbackObject, OS_MESSAGE_BLOCK);
170 OSSuspendThread(OSGetCurrentThread());
171}
172
173void JUTException::panic_f(const char *file, int line, const char *fmt, ...) {
174 va_list vl;

Callers

nothing calls this directly

Calls 9

vsnprintfFunction · 0.85
OSPanicFunction · 0.85
memcpyFunction · 0.85
OSReportFunction · 0.85
OSSendMessageFunction · 0.85
OSSuspendThreadFunction · 0.85
OSGetCurrentThreadFunction · 0.85
getOutputMethod · 0.80
print_fMethod · 0.80

Tested by

no test coverage detected