Commit 845f7e2b authored by Matthias Braun's avatar Matthias Braun
Browse files

bedbgout: improve function names, ensure that the end of compilation unit thing is actually called

parent d9f5e57b
......@@ -35,11 +35,11 @@ void be_dbg_open(void);
/** close a debug handler. */
void be_dbg_close(void);
/** start a new source object (compilation unit) */
void be_dbg_so(const char *filename);
/** start a compilation unit */
void be_dbg_unit_begin(const char *filename);
/** Main program */
void be_dbg_main_program(void);
/** end compilation unit */
void be_dbg_unit_end(void);
/** debug for a method begin */
void be_dbg_method_begin(const ir_entity *ent);
......
......@@ -41,11 +41,11 @@ typedef struct debug_ops {
/** close the stabs handler. */
void (*close)(dbg_handle *handle);
/** start a new source object (compilation unit) */
void (*so)(dbg_handle *handle, const char *filename);
/** start a compilation unit */
void (*unit_begin)(dbg_handle *handle, const char *filename);
/** Main Program */
void (*main_program)(dbg_handle *handle);
/** end compilation unit */
void (*unit_end)(dbg_handle *handle);
/** dumps the stabs for a method begin */
void (*method_begin)(dbg_handle *handle, const ir_entity *ent);
......
......@@ -38,16 +38,16 @@ void be_dbg_close(void)
handle->ops->close(handle);
}
void be_dbg_so(const char *filename)
void be_dbg_unit_begin(const char *filename)
{
if (handle->ops->so)
handle->ops->so(handle, filename);
if (handle->ops->unit_begin)
handle->ops->unit_begin(handle, filename);
}
void be_dbg_main_program(void)
void be_dbg_unit_end(void)
{
if (handle->ops->main_program)
handle->ops->main_program(handle);
if (handle->ops->unit_end)
handle->ops->unit_end(handle);
}
void be_dbg_method_begin(const ir_entity *ent)
......
......@@ -511,7 +511,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
be_init_env(&env, file_handle);
env.cup_name = cup_name;
be_dbg_so(cup_name);
be_dbg_unit_begin(cup_name);
be_dbg_types();
arch_env = env.arch_env;
......@@ -800,6 +800,9 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
be_free_birg(irg);
stat_ev_ctx_pop("bemain_irg");
}
be_dbg_unit_end();
ir_profile_free();
be_done_env(&env);
......
......@@ -625,27 +625,24 @@ static void gen_types(stabs_handle *h)
/**
* start a new source object (compilation unit)
*/
static void stabs_so(dbg_handle *handle, const char *filename)
static void stabs_unit_begin(dbg_handle *handle, const char *filename)
{
stabs_handle *h = (stabs_handle *)handle;
h->main_file = h->curr_file = filename;
be_emit_irprintf("\t.stabs\t\"%s\",%d,0,0,%stext0\n", filename, N_SO, be_gas_get_private_prefix());
be_emit_write_line();
} /* stabs_so */
}
/**
* Main Program
*/
static void stabs_main_program(dbg_handle *handle)
static void stabs_unit_end(dbg_handle *handle)
{
ir_graph *irg = get_irp_main_irg();
(void) handle;
if (irg) {
be_emit_irprintf("\t.stabs\t\"%s\",%d,0,0,0\n", get_entity_name(get_irg_entity(irg)), N_MAIN);
be_emit_write_line();
ir_entity *entity = get_irg_entity(irg);
be_emit_irprintf("\t.stabs\t\"%s\",%d,0,0,0\n",
get_entity_ld_name(entity), N_MAIN);
}
} /* stabs_main_program */
}
static void stabs_set_dbg_info(dbg_handle *h, dbg_info *dbgi)
{
......@@ -852,8 +849,8 @@ static void stabs_close(dbg_handle *handle)
/** The stabs operations. */
static const debug_ops stabs_ops = {
stabs_close,
stabs_so,
stabs_main_program,
stabs_unit_begin,
stabs_unit_end,
stabs_method_begin,
stabs_method_end,
stabs_types,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment