MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / test_debug_info

Function test_debug_info

rust/tests/debug_info.rs:54–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52
53#[test]
54fn test_debug_info() {
55 let _session = Session::new().expect("Failed to initialize session");
56 let out_dir = env!("OUT_DIR").parse::<PathBuf>().unwrap();
57
58 // Register test parser
59 DebugInfoParser::register("test", TestDebugInfoParser);
60
61 // Make sure it exists.
62 let _parser = DebugInfoParser::from_name("test").expect("Debug info test parser exists");
63
64 {
65 let view = binaryninja::load(out_dir.join("atox.obj")).expect("Failed to create view");
66 view.type_by_name("test_dbg")
67 .expect("Debug info test type exists");
68
69 let func = view
70 .function_at(&view.default_platform().unwrap(), 0x3b440)
71 .expect("Debug info test function exists");
72 assert_eq!(func.symbol().raw_name().to_string(), "test_func");
73 view.file().close();
74 }
75
76 // Disable the parser for other tests, so we don't introduce any unwanted behavior.
77 TEST_PARSER_ENABLED.store(false, Ordering::SeqCst);
78}

Callers

nothing calls this directly

Calls 8

joinMethod · 0.80
function_atMethod · 0.80
default_platformMethod · 0.80
loadFunction · 0.50
type_by_nameMethod · 0.45
closeMethod · 0.45
fileMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected