Detailed information on abort using macro and new __abort function

This commit is contained in:
Jeremy Soller
2023-03-09 20:19:27 -07:00
parent 04d2f296a9
commit 47bd55451f
5 changed files with 35 additions and 11 deletions
+15 -2
View File
@@ -90,8 +90,21 @@ pub unsafe extern "C" fn a64l(s: *const c_char) -> c_long {
}
#[no_mangle]
pub unsafe extern "C" fn abort() {
eprintln!("abort() called");
pub unsafe extern "C" fn __abort(
func: *const c_char,
file: *const c_char,
line: c_int,
) {
let func = CStr::from_ptr(func).to_str().unwrap();
let file = CStr::from_ptr(file).to_str().unwrap();
eprintln!(
"{}: {}:{}: Abort",
func,
file,
line
);
intrinsics::abort();
}