Remove unnecessary fields from CodeInfo
This commit is contained in:
@@ -91,8 +91,7 @@ fn handle_module(options: &Options, path: &Path, name: &str, fisa: FlagsOrIsa) -
|
||||
print_all(
|
||||
isa,
|
||||
&mem,
|
||||
code_info.code_size,
|
||||
code_info.jumptables_size + code_info.rodata_size,
|
||||
code_info.total_size,
|
||||
&relocs,
|
||||
&traps,
|
||||
&stack_maps,
|
||||
|
||||
@@ -193,14 +193,12 @@ pub fn print_all(
|
||||
isa: &dyn TargetIsa,
|
||||
mem: &[u8],
|
||||
code_size: u32,
|
||||
rodata_size: u32,
|
||||
relocs: &PrintRelocs,
|
||||
traps: &PrintTraps,
|
||||
stack_maps: &PrintStackMaps,
|
||||
) -> Result<()> {
|
||||
print_bytes(&mem);
|
||||
print_disassembly(isa, &mem[0..code_size as usize])?;
|
||||
print_readonly_data(&mem[code_size as usize..(code_size + rodata_size) as usize]);
|
||||
println!("\n{}\n{}\n{}", &relocs.text, &traps.text, &stack_maps.text);
|
||||
Ok(())
|
||||
}
|
||||
@@ -218,25 +216,3 @@ pub fn print_bytes(mem: &[u8]) {
|
||||
}
|
||||
println!();
|
||||
}
|
||||
|
||||
pub fn print_readonly_data(mem: &[u8]) {
|
||||
if mem.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
||||
println!("\nFollowed by {} bytes of read-only data:", mem.len());
|
||||
|
||||
for (i, byte) in mem.iter().enumerate() {
|
||||
if i % 16 == 0 {
|
||||
if i != 0 {
|
||||
println!();
|
||||
}
|
||||
print!("{:4}: ", i);
|
||||
}
|
||||
if i % 4 == 0 {
|
||||
print!(" ");
|
||||
}
|
||||
print!("{:02x} ", byte);
|
||||
}
|
||||
println!();
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ fn handle_module(options: &Options, path: &Path, name: &str, fisa: FlagsOrIsa) -
|
||||
for (def_index, func) in dummy_environ.info.function_bodies.iter() {
|
||||
context.func = func.clone();
|
||||
|
||||
let mut saved_sizes = None;
|
||||
let mut saved_size = None;
|
||||
let func_index = num_func_imports + def_index.index();
|
||||
let mut mem = vec![];
|
||||
let mut relocs = PrintRelocs::new(options.print);
|
||||
@@ -285,10 +285,7 @@ fn handle_module(options: &Options, path: &Path, name: &str, fisa: FlagsOrIsa) -
|
||||
}
|
||||
|
||||
if options.disasm {
|
||||
saved_sizes = Some((
|
||||
code_info.code_size,
|
||||
code_info.jumptables_size + code_info.rodata_size,
|
||||
));
|
||||
saved_size = Some(code_info.total_size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,16 +322,8 @@ fn handle_module(options: &Options, path: &Path, name: &str, fisa: FlagsOrIsa) -
|
||||
vprintln!(options.verbose, "");
|
||||
}
|
||||
|
||||
if let Some((code_size, rodata_size)) = saved_sizes {
|
||||
print_all(
|
||||
isa,
|
||||
&mem,
|
||||
code_size,
|
||||
rodata_size,
|
||||
&relocs,
|
||||
&traps,
|
||||
&stack_maps,
|
||||
)?;
|
||||
if let Some(total_size) = saved_size {
|
||||
print_all(isa, &mem, total_size, &relocs, &traps, &stack_maps)?;
|
||||
}
|
||||
|
||||
context.clear();
|
||||
|
||||
Reference in New Issue
Block a user