Skip to content

Commit 6b7e16f

Browse files
committed
Add more debugging options
1 parent ed570f6 commit 6b7e16f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/back/write.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ pub(crate) unsafe fn codegen(cgcx: &CodegenContext<GccCodegenBackend>, _diag_han
5757
if env::var("CG_GCCJIT_DUMP_TO_FILE").as_deref() == Ok("1") {
5858
let _ = fs::create_dir("/tmp/gccjit_dumps");
5959
let path = &format!("/tmp/gccjit_dumps/{}.c", module.name);
60+
context.set_debug_info(true);
6061
context.dump_to_file(path, true);
6162
}
6263
context.compile_to_file(OutputKind::ObjectFile, obj_out.to_str().expect("path to str"));

src/base.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ pub fn compile_codegen_unit<'tcx>(tcx: TyCtxt<'tcx>, cgu_name: Symbol, supports_
126126
context.add_command_line_option("-fdata-sections");
127127
}
128128

129+
if env::var("CG_GCCJIT_DUMP_TREE_ALL").as_deref() == Ok("1") {
130+
context.add_command_line_option("-fdump-tree-all");
131+
}
129132
if env::var("CG_GCCJIT_DUMP_CODE").as_deref() == Ok("1") {
130133
context.set_dump_code_on_compile(true);
131134
}

0 commit comments

Comments
 (0)