[−][src]Function sunrise_kernel::i386::stack::dump_stack
pub unsafe fn dump_stack<'a>(
source: &StackDumpSource,
elf_symbols: Option<(&ElfFile<'a>, &'a [Entry32])>
)
Dumps the stack from the given information, displaying it in a frame-by-frame format.
This function can work on both a KernelStack and a stack in UserLand.
If esp
is in KernelLand, this function will consider that we're dumping
a KernelStack, check that every page of what we're expecting to be a stack is mapped,
and dump it.
Otherwise, it will get the UserLand mapping that esp
falls in, and dump only in this mapping.
Safety
This function checks whether the stack is properly mapped before attempting to access it. It then creates a &u8 from what could be a shared resource.
The caller must make sure the mapping pointed to by esp
cannot be modified while this
function is at work. This will often mean checking that the thread whose stack we're dumping
is stopped and will remain unscheduled at least until this function returns.