1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
fn result_a() -> Result<(), u32> {
Ok(())
}
fn result_b() -> Result<i32, u32> {
Ok(0)
}
fn result_c() -> Result<&'static str, i32> {
Ok("hi")
}
fn result_d() -> Result<&'static str, &'static str> {
Err("eh")
}
use firedbg_protocol::source::*;
use firedbg_rust_parser::*;
pub fn get_breakpoints() -> Vec<FunctionDef> {
vec![
FunctionDef {
ty: FunctionType::FreeFn {
fn_name: "result_a".into(),
is_async: false,
return_type: true,
},
loc: BreakableSpan {
start: LineColumn {
line: 1,
column: Some(35),
},
end: LineColumn {
line: 2,
column: Some(5),
},
},
},
FunctionDef {
ty: FunctionType::FreeFn {
fn_name: "result_b".into(),
is_async: false,
return_type: true,
},
loc: BreakableSpan {
start: LineColumn {
line: 5,
column: Some(36),
},
end: LineColumn {
line: 6,
column: Some(5),
},
},
},
FunctionDef {
ty: FunctionType::FreeFn {
fn_name: "result_c".into(),
is_async: false,
return_type: true,
},
loc: BreakableSpan {
start: LineColumn {
line: 9,
column: Some(45),
},
end: LineColumn {
line: 10,
column: Some(5),
},
},
},
FunctionDef {
ty: FunctionType::FreeFn {
fn_name: "result_d".into(),
is_async: false,
return_type: true,
},
loc: BreakableSpan {
start: LineColumn {
line: 13,
column: Some(54),
},
end: LineColumn {
line: 14,
column: Some(5),
},
},
},
]
}