mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +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,
|
output: &mut implementation::OutputWriter,
|
||||||
sender: xous::MessageSender,
|
sender: xous::MessageSender,
|
||||||
msg: &xous::ScalarMessage,
|
msg: &xous::ScalarMessage,
|
||||||
|
sender_pid: xous::PID,
|
||||||
) {
|
) {
|
||||||
match msg.id {
|
match msg.id {
|
||||||
1000 => writeln!(output, "PANIC in process {}", sender).unwrap(),
|
1000 => writeln!(output, "PANIC from PID {} | {}", sender_pid, sender).unwrap(),
|
||||||
1100 => (),
|
1100 => (),
|
||||||
1101..=1132 => {
|
1101..=1132 => {
|
||||||
let mut output_bfr = [0u8; core::mem::size_of::<usize>() * 4];
|
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;
|
let sender = envelope.sender;
|
||||||
// writeln!(output, "LOG: Got message envelope: {:?}", envelope).unwrap();
|
// writeln!(output, "LOG: Got message envelope: {:?}", envelope).unwrap();
|
||||||
match &mut envelope.body {
|
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) => {
|
xous::Message::BlockingScalar(msg) => {
|
||||||
writeln!(
|
writeln!(
|
||||||
output,
|
output,
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ impl<'a> core::ops::DerefMut for XousBuffer<'a> {
|
||||||
impl<'a> Drop for XousBuffer<'a> {
|
impl<'a> Drop for XousBuffer<'a> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if self.should_drop {
|
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 {
|
impl core::fmt::Display for MessageSender {
|
||||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
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