diff --git a/src/debugger.rs b/src/debugger.rs index 90fab32382..ad914fc3bf 100644 --- a/src/debugger.rs +++ b/src/debugger.rs @@ -225,10 +225,6 @@ pub unsafe fn debugger(target_id: Option<*const RwSpinlock>) { pub unsafe fn debugger(target_id: Option<*const RwSpinlock>) { use crate::memory::{get_page_info, the_zeroed_frame, RefCount}; - unsafe { - x86::bits64::rflags::stac(); - } - println!("DEBUGGER START"); println!(); @@ -303,6 +299,9 @@ pub unsafe fn debugger(target_id: Option<*const RwSpinlock>) { let mut rsp = regs.iret.rsp; println!("stack: {:>016x}", rsp); + unsafe { + x86::bits64::rflags::stac(); + } //Maximum 64 qwords for _ in 0..64 { if context.addr_space.as_ref().map_or(false, |space| { @@ -326,6 +325,9 @@ pub unsafe fn debugger(target_id: Option<*const RwSpinlock>) { break; } } + unsafe { + x86::bits64::rflags::clac(); + } } // Switch to original page table @@ -360,11 +362,6 @@ pub unsafe fn debugger(target_id: Option<*const RwSpinlock>) { "({} kernel-owned references were not counted)", temporarily_taken_htbufs ); - - println!("DEBUGGER END"); - unsafe { - x86::bits64::rflags::clac(); - } } #[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))] use {crate::memory::Frame, hashbrown::HashMap};