bidhan-a 1 неделя назад
Родитель
Сommit
44fe385ba0
2 измененных файлов с 2 добавлено и 12 удалено
  1. 0 4
      crates/disassembler/src/section_header_entry.rs
  2. 2 8
      src/commands/disassemble.rs

+ 0 - 4
crates/disassembler/src/section_header_entry.rs

@@ -1,6 +1,5 @@
 use {
     crate::errors::DisassemblerError,
-    sbpf_common::instruction::Instruction,
     serde::{Deserialize, Serialize},
     std::fmt::Debug,
 };
@@ -10,8 +9,6 @@ pub struct SectionHeaderEntry {
     pub label: String,
     pub offset: usize,
     pub data: Vec<u8>,
-    #[serde(skip_serializing_if = "Vec::is_empty")]
-    pub ixs: Vec<Instruction>,
     #[serde(skip_serializing_if = "String::is_empty")]
     pub utf8: String,
 }
@@ -22,7 +19,6 @@ impl SectionHeaderEntry {
             label,
             offset,
             data,
-            ixs: vec![],
             utf8: String::new(),
         };
 

+ 2 - 8
src/commands/disassemble.rs

@@ -14,15 +14,9 @@ pub fn disassemble(filename: String, asm: bool) -> Result<(), Error> {
         println!(
             "{}",
             program
-                .section_header_entries
+                .to_ixs()?
                 .iter()
-                .map(|h| h.ixs.clone())
-                .filter(|ixs| !ixs.is_empty())
-                .map(|ixs| ixs
-                    .iter()
-                    .map(|i| i.to_asm().unwrap())
-                    .collect::<Vec<String>>()
-                    .join("\n"))
+                .map(|ix| ix.to_asm().unwrap())
                 .collect::<Vec<String>>()
                 .join("\n")
         );