Skip to content

Commit 05d5676

Browse files
committed
module size in debug output
1 parent 9492d65 commit 05d5676

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/module.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,19 @@ impl ModuleTag {
3737
pub fn end_address(&self) -> u32 {
3838
self.mod_end
3939
}
40+
41+
/// The size of the module/the BLOB in memory.
42+
pub fn module_size(&self) -> u32 {
43+
self.mod_end - self.mod_start
44+
}
4045
}
4146

4247
impl Debug for ModuleTag {
4348
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
4449
f.debug_struct("ModuleTag")
4550
.field("type", &self.typ)
46-
.field("size", &self.size)
51+
.field("size (tag)", &self.size)
52+
.field("size (module)", &(self.module_size()))
4753
.field("mod_start", &(self.mod_start as *const usize))
4854
.field("mod_end", &(self.mod_end as *const usize))
4955
.field("cmdline", &self.cmdline())

0 commit comments

Comments
 (0)