From c4f2cd1f2772797afe658602e86513ddb51ac254 Mon Sep 17 00:00:00 2001 From: Dmitri Makarov Date: Wed, 18 Oct 2023 17:39:57 -0400 Subject: [PATCH] Enable or disable debug features based on trace command line option --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index b68fdab..58c563c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -132,6 +132,7 @@ fn load_program<'a>( filename: &Path, program_id: Pubkey, invoke_context: &InvokeContext<'a>, + output_trace: bool, ) -> Executable> { let mut file = File::open(filename).unwrap(); let mut magic = [0u8; 4]; @@ -151,7 +152,7 @@ fn load_program<'a>( &invoke_context.feature_set, invoke_context.get_compute_budget(), false, /* deployment */ - false, /* debugging_features */ + output_trace, /* debugging_features */ ) .unwrap(); // Allowing mut here, since it may be needed for jit compile, which is under a config flag @@ -283,7 +284,7 @@ fn run_tests(opt: Opt) -> Result<(), anyhow::Error> { ) .unwrap(); - let verified_executable = load_program(path.as_path(), program_id, &invoke_context); + let verified_executable = load_program(path.as_path(), program_id, &invoke_context, opt.trace); create_vm!( vm, &verified_executable,