You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pub(crate)const parse_instrument_xray_opts:&str = "a comma separated list of settings: `always` or `never` (mutually exclusive), `ignore-loops`, `instruction-threshold=N`, `skip-entry`, `skip-exit`";
786
+
pub(crate)const parse_instrument_function:&str = "`fentry` | `mcount` | `xray`, and an optional colon with a list of comma separated options.";
788
787
pub(crate)const parse_unpretty:&str = "`string` or `string=string`";
789
788
pub(crate)const parse_treat_err_as_bug:&str = "either no value or a non-negative number";
790
789
pub(crate)const parse_next_solver_config:&str =
@@ -1543,15 +1542,42 @@ pub mod parse {
1543
1542
slot:&mutInstrumentFunction,
1544
1543
v:Option<&str>,
1545
1544
) -> bool{
1545
+
// Argument looks like the regex: type(:sub_opt(,sub_opt)*)?
1546
1546
letSome(v) = v else{returnfalse};
1547
-
match v {
1548
-
"fentry" => *slot = InstrumentFunction::Fentry,
1549
-
"mcount" => *slot = InstrumentFunction::Mcount,
1550
-
"xray" => *slot = InstrumentFunction::XRay,
1551
-
"none" => *slot = InstrumentFunction::No,
1552
-
_ => returnfalse,
1547
+
let opts:Vec<_> = v.split(':').collect();
1548
+
if opts.len() > 2{
1549
+
println!("too many opts");
1550
+
returnfalse;
1553
1551
}
1554
-
true
1552
+
let sub_opts = opts.get(1).copied();
1553
+
letmut parsed = false;
1554
+
1555
+
match opts[0]{
1556
+
"fentry" => {
1557
+
parsed = sub_opts.is_none();
1558
+
*slot = InstrumentFunction::Fentry;
1559
+
}
1560
+
"mcount" => {
1561
+
parsed = sub_opts.is_none();
1562
+
*slot = InstrumentFunction::Mcount;
1563
+
}
1564
+
"xray" => {
1565
+
// Accept this option multiple times, this allows replacing or
0 commit comments