Add debug infos on panic
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
#[path = "unsupported/mod.rs"]
|
||||
mod unsupported;
|
||||
pub use self::unsupported::*;
|
||||
|
||||
#[path = "../../../../../crates/shared/src/syscall.rs"]
|
||||
mod syscall;
|
||||
|
||||
/// # Safety
|
||||
/// `argc` and `argv` are passed by the kernel
|
||||
#[unsafe(no_mangle)]
|
||||
@@ -9,3 +16,8 @@ pub unsafe extern "C" fn _start(argc: isize, argv: *const *const u8) -> isize {
|
||||
|
||||
unsafe { main(argc, argv) }
|
||||
}
|
||||
|
||||
pub fn abort_internal() -> ! {
|
||||
// todo real abort
|
||||
syscall::exit()
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
|
||||
|
||||
#[path = "unsupported.rs"]
|
||||
mod unsupported;
|
||||
pub use self::unsupported::{STDIN_BUF_SIZE, Stderr, Stdin, is_ebadf, panic_output};
|
||||
pub use self::unsupported::{STDIN_BUF_SIZE, Stderr, Stdin, is_ebadf};
|
||||
|
||||
pub struct Stdout;
|
||||
// pub struct Stdin;
|
||||
@@ -36,6 +36,11 @@ impl io::Write for Stdout {
|
||||
// }
|
||||
// }
|
||||
|
||||
pub fn panic_output() -> Option<impl io::Write> {
|
||||
// Todo, use Stderr
|
||||
Some(Stdout::new())
|
||||
}
|
||||
|
||||
#[repr(u64)]
|
||||
pub enum SysCall {
|
||||
Read = 0,
|
||||
|
||||
Reference in New Issue
Block a user