From 633d416d9feb55903b7fe2adf987d752e49cfdf7 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 20 Dec 2021 00:15:30 +0100 Subject: [PATCH] =?UTF-8?q?Print=20panic!()=20info=20to=20Dolphin=E2=80=99?= =?UTF-8?q?s=20HLE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This has the same limitation as println!(), it works only in Dolphin until #9 gets merged. --- luma_runtime/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/luma_runtime/src/lib.rs b/luma_runtime/src/lib.rs index f0eb381..376ddc9 100644 --- a/luma_runtime/src/lib.rs +++ b/luma_runtime/src/lib.rs @@ -7,11 +7,14 @@ #![no_std] #![feature(asm_experimental_arch, lang_items, alloc_error_handler)] +extern crate alloc; + use core::arch::global_asm; use core::{alloc::Layout, panic::PanicInfo}; use linked_list_allocator::LockedHeap; #[allow(unused_imports)] use luma_core::cache::*; +use luma_core::println; // Import linker symbols for allocator initialization. extern "C" { @@ -66,7 +69,8 @@ impl Termination for () {} /// This function is called on panic. #[cfg_attr(not(test), panic_handler)] #[no_mangle] -fn panic(_info: &PanicInfo) -> ! { +fn panic(info: &PanicInfo) -> ! { + println!("{}", info); loop {} }