Skip to content

Commit

Permalink
Allow specification of several breakpoints from cmdline args
Browse files Browse the repository at this point in the history
  • Loading branch information
zaddach committed Jan 31, 2025
1 parent 8ea0c31 commit 78ead19
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions debugger/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ struct CliArgs {
grammar_file: Option<PathBuf>,
input_file: Option<PathBuf>,
rule: Option<String>,
breakpoint: Option<String>,
breakpoints: Vec<String>,
session_file: Option<PathBuf>,
no_update: bool,
}
Expand All @@ -233,7 +233,7 @@ impl Default for CliArgs {
grammar_file: None,
input_file: None,
rule: None,
breakpoint: None,
breakpoints: Vec::new(),
session_file: None,
no_update: false,
};
Expand Down Expand Up @@ -268,7 +268,7 @@ impl Default for CliArgs {
}
"-b" | "--breakpoint" => {
if let Some(breakpoint) = iter.next() {
result.breakpoint = Some(breakpoint);
result.breakpoints.push(breakpoint);
} else {
eprintln!("Error: missing breakpoint");
std::process::exit(1);
Expand Down Expand Up @@ -326,8 +326,8 @@ impl CliArgs {
eprintln!("Error: {}", e);
}
}
if let Some(breakpoint) = &self.breakpoint {
context.breakpoint(breakpoint);
for breakpoint in self.breakpoints {
context.breakpoint(& breakpoint);
}
if let Some(rule) = self.rule {
if let Err(e) = context.run(&rule) {
Expand Down

0 comments on commit 78ead19

Please sign in to comment.