MCPcopy Create free account
hub / github.com/GJDuck/e9patch / e9panic

Function e9panic

src/e9patch/e9loader_elf.cpp:113–128  ·  view source on GitHub ↗

* Something went wrong, print an error and abort. */

Source from the content-addressed store, hash-verified

111 * Something went wrong, print an error and abort.
112 */
113static NO_INLINE NO_RETURN void e9panic(const char *msg, ...)
114{
115 char buf[BUFSIZ], *str = buf;
116 str = e9write_str(str, "e9patch loader error: ");
117 va_list ap;
118 va_start(ap, msg);
119 str = e9write_format(str, msg, ap);
120 va_end(ap);
121 str = e9write_char(str, '\n');
122
123 size_t len = str - buf;
124 e9syscall(SYS_write, STDERR_FILENO, buf, len);
125 e9syscall(SYS_kill, /*pid=*/0, SIGABRT);
126 while (true)
127 asm volatile ("ud2");
128}
129
130/*
131 * Write a debug message.

Callers 4

e9scratchFunction · 0.70
e9load_mapsFunction · 0.70
e9filterFunction · 0.70
e9initFunction · 0.70

Calls 3

e9write_strFunction · 0.85
e9write_formatFunction · 0.85
e9write_charFunction · 0.85

Tested by

no test coverage detected