MCPcopy Create free account
hub / github.com/SeaQL/FireDBG.for.Rust / main

Function main

debugger/tests/function_return.rs:13–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12#[tokio::test]
13async fn main() -> Result<()> {
14 let testcase = "fn_return";
15
16 // this is the only way llvm would generate multiple return instructions
17 rustc_optimize(&format!("testcases/{testcase}"));
18
19 let debugger_params = DebuggerParams {
20 binary: format!("testcases/{testcase}.o"),
21 files: vec![
22 Default::default(),
23 SourceFile {
24 id: 1,
25 path: format!("testcases/{testcase}.rs"),
26 crate_name: testcase.into(),
27 modified: SystemTime::UNIX_EPOCH,
28 },
29 ],
30 breakpoints: vec![
31 Default::default(),
32 Breakpoint {
33 id: 1,
34 file_id: 1,
35 loc: LineColumn {
36 line: 27,
37 column: None,
38 },
39 loc_end: None,
40 breakpoint_type: BreakpointType::FunctionCall {
41 fn_name: "main".into(),
42 },
43 capture: VariableCapture::Arguments,
44 },
45 Breakpoint {
46 id: 2,
47 file_id: 1,
48 loc: LineColumn {
49 line: 2,
50 column: None,
51 },
52 loc_end: None,
53 breakpoint_type: BreakpointType::FunctionCall {
54 fn_name: "multi_return".into(),
55 },
56 capture: VariableCapture::Arguments,
57 },
58 ],
59 arguments: vec![],
60 };
61
62 let (producer, consumer) = setup(testcase).await?;
63
64 Debugger::run(debugger_params, producer.clone());
65
66 producer.end().await?;
67
68 let expected = vec![
69 Expected::FnCall {
70 name: "main".into(),

Callers

nothing calls this directly

Calls 8

rustc_optimizeFunction · 0.85
setupFunction · 0.85
into_bytesMethod · 0.80
nextMethod · 0.80
verifyFunction · 0.70
runFunction · 0.50
endMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected