Annotation of nono/lib/panic.cpp, revision 1.1.1.1

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2022 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
                      7: //
                      8: // パニック
                      9: //
                     10: 
                     11: #include "header.h"
                     12: #include "mpu.h"
                     13: 
                     14: // パニック (PC を表示しない)
                     15: void
                     16: panic(const char *funcname, const char *fmt, ...)
                     17: {
                     18:        char fmtbuf[1024];
                     19:        va_list ap;
                     20: 
                     21:        va_start(ap, fmt);
                     22:        vsnprintf(fmtbuf, sizeof(fmtbuf), fmt, ap);
                     23:        va_end(ap);
                     24: 
                     25:        // panic の場合ここでプロセス終了するのでログではなく stderr に出力
                     26:        fprintf(stderr, "panic! %s at %s\n", fmtbuf, funcname);
                     27:        abort();
                     28: }
                     29: 
                     30: // VM 用パニック (PC を表示する)
                     31: void
                     32: vmpanic(const char *funcname, const char *fmt, ...)
                     33: {
                     34:        char fmtbuf[1024];
                     35:        va_list ap;
                     36: 
                     37:        va_start(ap, fmt);
                     38:        vsnprintf(fmtbuf, sizeof(fmtbuf), fmt, ap);
                     39:        va_end(ap);
                     40: 
                     41:        // panic の場合ここでプロセス終了するのでログではなく stderr に出力
                     42:        fprintf(stderr, "panic! PC=$%08x %s at %s\n",
                     43:                gMPU->GetPPC(), fmtbuf, funcname);
                     44:        abort();
                     45: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.