Skip to content

Commit 3a99a1e

Browse files
authored
Supress symtab2gb debug output (rust-lang#1753)
Fixes a regression introduced by rust-lang#1453. The symtabl2gb prints a lot of debug messages, so we always suppressed the output except when there is an error in its execution.
1 parent 501e163 commit 3a99a1e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use std::iter::FromIterator;
3232
use std::path::Path;
3333
use std::process::Command;
3434
use std::rc::Rc;
35-
use tracing::{debug, warn};
35+
use tracing::{debug, error, warn};
3636

3737
#[derive(Clone)]
3838
pub struct GotocCodegenBackend {
@@ -405,7 +405,12 @@ fn symbol_table_to_gotoc(tcx: &TyCtxt, file: &Path) {
405405
cmd.args(args);
406406
debug!("calling: `{:?} {:?}`", cmd.get_program(), cmd.get_args());
407407

408-
if cmd.status().is_err() {
408+
let result = cmd
409+
.output()
410+
.expect(&format!("Failed to generate goto model for {}", input_filename.display()));
411+
if !result.status.success() {
412+
error!("Symtab error output:\n{}", String::from_utf8_lossy(&result.stderr));
413+
error!("Symtab output:\n{}", String::from_utf8_lossy(&result.stdout));
409414
let err_msg = format!(
410415
"Failed to generate goto model:\n\tsymtab2gb failed on file {}.",
411416
input_filename.display()

0 commit comments

Comments
 (0)