MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / __assert_fail

Function __assert_fail

src/libcxx/kstd_libcxx.cpp:199–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197 * @param function 函数名
198 */
199extern "C" [[noreturn]] void __assert_fail(const char* assertion,
200 const char* file, unsigned int line,
201 const char* function) {
202 klog::RawPut("\n[ASSERT FAILED] ");
203 klog::RawPut(file);
204 etl_putchar(':');
205 char buf_line[12];
206 auto* end = etl::format_to_n(buf_line, sizeof(buf_line) - 1, "{}", line);
207 *end = '\0';
208 klog::RawPut(" in ");
209 klog::RawPut(function);
210 klog::RawPut("\n Expression: ");
211 klog::RawPut(assertion);
212 etl_putchar('\n');
213 while (1) {
214 cpu_io::Pause();
215 }
216}
217
218/**
219 * c++ 全局对象构造

Callers

nothing calls this directly

Calls 3

RawPutFunction · 0.85
PauseFunction · 0.85
etl_putcharFunction · 0.50

Tested by

no test coverage detected