mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
add debug output to log_string
This commit is contained in:
parent
9a8c402cc2
commit
c8a2f34998
1 changed files with 7 additions and 0 deletions
|
|
@ -13,6 +13,13 @@ impl<'a> LogString<'a> {
|
||||||
// println!("Message address is at {:08x}", message.buf.addr.get());
|
// println!("Message address is at {:08x}", message.buf.addr.get());
|
||||||
let raw_slice = unsafe { slice::from_raw_parts_mut(message.buf.as_ptr() as *mut u8, message.buf.len()) };
|
let raw_slice = unsafe { slice::from_raw_parts_mut(message.buf.as_ptr() as *mut u8, message.buf.len()) };
|
||||||
let starting_length = message.valid.map(|x| x.get()).unwrap_or(0);
|
let starting_length = message.valid.map(|x| x.get()).unwrap_or(0);
|
||||||
|
|
||||||
|
print!("String @ {:08x}:", message.buf.as_ptr() as usize);
|
||||||
|
for offset in 0..starting_length {
|
||||||
|
print!(" {:02x}", raw_slice[offset]);
|
||||||
|
}
|
||||||
|
println!(" (length: {})", starting_length);
|
||||||
|
|
||||||
LogString {
|
LogString {
|
||||||
s: unsafe {
|
s: unsafe {
|
||||||
core::str::from_utf8_unchecked(slice::from_raw_parts(
|
core::str::from_utf8_unchecked(slice::from_raw_parts(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue