diff --git a/src/unwind_info.rs b/src/unwind_info.rs index a1cdb9d..988311e 100644 --- a/src/unwind_info.rs +++ b/src/unwind_info.rs @@ -175,58 +175,6 @@ impl<'a> UnwindInfoBuilder<'a> { }) } - pub fn to_vec(path: &str) -> anyhow::Result> { - let mut result = Vec::new(); - let mut last_function_end_addr: Option = None; - - let builder = UnwindInfoBuilder::with_callback(path, |unwind_data| { - match unwind_data { - UnwindData::Function(_, end_addr) => { - // Add a function marker for the previous function. - if let Some(addr) = last_function_end_addr { - let marker = end_of_function_marker(addr); - let row = CompactUnwindRow { - pc: marker.pc, - cfa_offset: marker.cfa_offset, - cfa_type: marker.cfa_type, - rbp_type: marker.rbp_type, - rbp_offset: marker.rbp_offset, - }; - result.push(row) - } - last_function_end_addr = Some(*end_addr); - } - UnwindData::Instruction(compact_row) => { - let row = CompactUnwindRow { - pc: compact_row.pc, - cfa_offset: compact_row.cfa_offset, - cfa_type: compact_row.cfa_type, - rbp_type: compact_row.rbp_type, - rbp_offset: compact_row.rbp_offset, - }; - result.push(row); - } - } - }); - - builder?.process()?; - - // Add marker for the last function. - if let Some(last_addr) = last_function_end_addr { - let marker = end_of_function_marker(last_addr); - let row = CompactUnwindRow { - pc: marker.pc, - cfa_offset: marker.cfa_offset, - cfa_type: marker.cfa_type, - rbp_type: marker.rbp_type, - rbp_offset: marker.rbp_offset, - }; - result.push(row); - } - - Ok(result) - } - pub fn process(mut self) -> Result<(), anyhow::Error> { let object_file = object::File::parse(&self.mmap[..])?; let eh_frame_section = object_file