mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
make panic messages a bit more helpful
This commit is contained in:
parent
5917ff4664
commit
4640dc404f
3 changed files with 5 additions and 4 deletions
|
|
@ -182,9 +182,10 @@ fn handle_scalar(
|
|||
output: &mut implementation::OutputWriter,
|
||||
sender: xous::MessageSender,
|
||||
msg: &xous::ScalarMessage,
|
||||
sender_pid: xous::PID,
|
||||
) {
|
||||
match msg.id {
|
||||
1000 => writeln!(output, "PANIC in process {}", sender).unwrap(),
|
||||
1000 => writeln!(output, "PANIC from PID {} | {}", sender_pid, sender).unwrap(),
|
||||
1100 => (),
|
||||
1101..=1132 => {
|
||||
let mut output_bfr = [0u8; core::mem::size_of::<usize>() * 4];
|
||||
|
|
@ -248,7 +249,7 @@ fn reader_thread(mut output: implementation::OutputWriter) {
|
|||
let sender = envelope.sender;
|
||||
// writeln!(output, "LOG: Got message envelope: {:?}", envelope).unwrap();
|
||||
match &mut envelope.body {
|
||||
xous::Message::Scalar(msg) => handle_scalar(&mut output, sender, msg),
|
||||
xous::Message::Scalar(msg) => handle_scalar(&mut output, sender, msg, envelope.sender.pid().unwrap()),
|
||||
xous::Message::BlockingScalar(msg) => {
|
||||
writeln!(
|
||||
output,
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ impl<'a> core::ops::DerefMut for XousBuffer<'a> {
|
|||
impl<'a> Drop for XousBuffer<'a> {
|
||||
fn drop(&mut self) {
|
||||
if self.should_drop {
|
||||
crate::unmap_memory(self.range).unwrap();
|
||||
crate::unmap_memory(self.range).expect("XousBuffer: failed to drop memory.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ impl core::default::Default for MessageSender {
|
|||
|
||||
impl core::fmt::Display for MessageSender {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
write!(f, "data: {}", self.data)
|
||||
write!(f, "MessageSender.data: 0x{:08x}", self.data)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue