From 581448e0e959767f7addf33ada3a49cb68bd8c73 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 11 Jun 2009 15:59:11 -0700 Subject: [PATCH] Add debug while compiling --- orc/orccompiler.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/orc/orccompiler.c b/orc/orccompiler.c index 0a4712e..7d5b193 100644 --- a/orc/orccompiler.c +++ b/orc/orccompiler.c @@ -144,6 +144,7 @@ orc_program_compile_full (OrcProgram *program, OrcTarget *target, int i; OrcCompileResult result; + ORC_INFO("initializing compiler"); compiler = malloc (sizeof(OrcCompiler)); memset (compiler, 0, sizeof(OrcCompiler)); @@ -152,14 +153,16 @@ orc_program_compile_full (OrcProgram *program, OrcTarget *target, compiler->target_flags = flags; { + ORC_LOG("variables"); for(i=0;ivars[i].name, program->vars[i].size, program->vars[i].vartype); } + ORC_LOG("instructions"); for(i=0;in_insns;i++){ - ORC_INFO("%d: %s %d %d %d %d", i, + ORC_LOG("%d: %s %d %d %d %d", i, program->insns[i].opcode->name, program->insns[i].dest_args[0], program->insns[i].dest_args[1], @@ -200,10 +203,12 @@ orc_program_compile_full (OrcProgram *program, OrcTarget *target, orc_compiler_rewrite_vars2 (compiler); if (compiler->error) goto error; + ORC_INFO("allocating code memory"); //if (compiler->target != ORC_TARGET_C) { orc_compiler_allocate_codemem (compiler); //} + ORC_INFO("compiling for target"); compiler->target->compile (compiler); if (compiler->error) goto error; @@ -212,6 +217,7 @@ orc_program_compile_full (OrcProgram *program, OrcTarget *target, result = compiler->result; free (compiler); + ORC_INFO("finished compiling (success)"); return result; error: @@ -222,6 +228,7 @@ error: result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } free (compiler); + ORC_INFO("finished compiling (fail)"); return result; } -- 2.7.4