Make the .mdebug line parser support EE-GCC (PS2) (#362)

This commit is contained in:
Dávid Balatoni
2026-07-10 07:45:53 +02:00
committed by GitHub
parent 282783c081
commit b8f401b0ba
3 changed files with 107 additions and 16 deletions
+25
View File
@@ -102,3 +102,28 @@ fn mwcc_dwarf1_line_numbers_multiple_functions() {
);
}
}
#[test]
#[cfg(feature = "mips")]
fn ee_gcc_mdebug_line_numbers() {
let diff_config = diff::DiffObjConfig::default();
let obj = obj::read::parse(
include_object!("data/mips/ee_gcc_lines_example.o"),
&diff_config,
diff::DiffSide::Base,
)
.unwrap();
let text_section = obj.sections.iter().find(|s| s.name == ".text").unwrap();
assert_eq!(text_section.line_info.get(&0), Some(&1));
assert_eq!(text_section.line_info.get(&12), Some(&2));
assert_eq!(text_section.line_info.get(&20), Some(&4));
assert_eq!(text_section.line_info.get(&40), Some(&5));
assert_eq!(text_section.line_info.get(&64), Some(&7));
assert_eq!(text_section.line_info.get(&80), Some(&8));
assert_eq!(text_section.line_info.get(&88), Some(&10));
assert_eq!(text_section.line_info.get(&96), Some(&11));
assert_eq!(text_section.line_info.get(&104), Some(&12));
assert_eq!(text_section.line_info.get(&144), Some(&13));
assert_eq!(text_section.line_info.len(), 10);
}
Binary file not shown.