From 2fd4dcddd6c4a792dda44a23b0d9aad59dd6921a Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 13 Oct 2023 16:14:24 -0700 Subject: [PATCH] threads: use hex addresses in log messages In #7220, we began logging the arguments of WebAssembly `wait` and `notify` as these instructions are executed. This change prints the addresses using hexadecimal, which is simply more convenient when dealing with addressing. --- crates/runtime/src/memory.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/runtime/src/memory.rs b/crates/runtime/src/memory.rs index 59cac8cab968..ecdeda3f1897 100644 --- a/crates/runtime/src/memory.rs +++ b/crates/runtime/src/memory.rs @@ -565,7 +565,7 @@ impl SharedMemory { /// Implementation of `memory.atomic.notify` for this shared memory. pub fn atomic_notify(&self, addr_index: u64, count: u32) -> Result { validate_atomic_addr(&self.0.def.0, addr_index, 4, 4)?; - log::trace!("memory.atomic.notify(addr={addr_index}, count={count})"); + log::trace!("memory.atomic.notify(addr={addr_index:#x}, count={count})"); Ok(self.0.spot.unpark(addr_index, count)) } @@ -578,7 +578,7 @@ impl SharedMemory { ) -> Result { let addr = validate_atomic_addr(&self.0.def.0, addr_index, 4, 4)?; log::trace!( - "memory.atomic.wait32(addr={addr_index}, expected={expected}, timeout={timeout:?})" + "memory.atomic.wait32(addr={addr_index:#x}, expected={expected}, timeout={timeout:?})" ); // SAFETY: `addr_index` was validated by `validate_atomic_addr` above. @@ -603,7 +603,7 @@ impl SharedMemory { ) -> Result { let addr = validate_atomic_addr(&self.0.def.0, addr_index, 8, 8)?; log::trace!( - "memory.atomic.wait64(addr={addr_index}, expected={expected}, timeout={timeout:?})" + "memory.atomic.wait64(addr={addr_index:#x}, expected={expected}, timeout={timeout:?})" ); // SAFETY: `addr_index` was validated by `validate_atomic_addr` above.