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

Function main

debugger/tests/pointer.rs:14–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13#[tokio::test]
14async fn main() -> Result<()> {
15 let testcase = "pointer";
16 let (producer, consumer) = setup(testcase).await?;
17
18 rustc(&format!("testcases/{testcase}"));
19
20 Debugger::run(
21 DebuggerParams {
22 binary: format!("testcases/{testcase}.o"),
23 files: vec![
24 Default::default(),
25 SourceFile {
26 id: 1,
27 path: format!("testcases/{testcase}.rs"),
28 crate_name: testcase.into(),
29 modified: SystemTime::UNIX_EPOCH,
30 },
31 ],
32 breakpoints: vec![
33 Default::default(),
34 Breakpoint {
35 id: 1,
36 file_id: 1,
37 loc: LineColumn {
38 line: 30,
39 column: None,
40 },
41 loc_end: None,
42 breakpoint_type: BreakpointType::Breakpoint,
43 capture: VariableCapture::Locals,
44 },
45 Breakpoint {
46 id: 2,
47 file_id: 1,
48 loc: LineColumn {
49 line: 44,
50 column: None,
51 },
52 loc_end: None,
53 breakpoint_type: BreakpointType::Breakpoint,
54 capture: VariableCapture::Locals,
55 },
56 ],
57 arguments: vec![],
58 },
59 producer.clone(),
60 );
61
62 producer.end().await?;
63 for i in 0..2 {
64 let payload = consumer.next().await?.message().into_bytes();
65 let event = EventStream::read_from(Bytes::from(payload));
66 match event {
67 Event::Breakpoint { mut locals, .. } => match i {
68 0 => {
69 assert!(locals.len() >= 3);
70 for (j, (name, value)) in locals.iter_mut().enumerate().take(3) {
71 value.redact_addr();

Callers

nothing calls this directly

Calls 7

setupFunction · 0.85
rustcFunction · 0.85
into_bytesMethod · 0.80
nextMethod · 0.80
redact_addrMethod · 0.80
runFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected