From 2d2771669fd64e4cc2219bd1bab18224b882c454 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 10 Jun 2006 17:24:13 +0000 Subject: [PATCH] Reintegrate stabs dbgfmt. svn path=/branches/new-optimizer/; revision=1564 --- modules/dbgfmts/Makefile.inc | 2 +- modules/dbgfmts/stabs/stabs-dbgfmt.c | 31 +++++++++++++++------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/modules/dbgfmts/Makefile.inc b/modules/dbgfmts/Makefile.inc index 845b3a7d..cf0a5ffd 100644 --- a/modules/dbgfmts/Makefile.inc +++ b/modules/dbgfmts/Makefile.inc @@ -8,4 +8,4 @@ EXTRA_DIST += modules/dbgfmts/stabs/Makefile.inc include modules/dbgfmts/codeview/Makefile.inc include modules/dbgfmts/dwarf2/Makefile.inc include modules/dbgfmts/null/Makefile.inc -#include modules/dbgfmts/stabs/Makefile.inc +include modules/dbgfmts/stabs/Makefile.inc diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index 30d2c8df..66c2dde5 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -122,8 +122,8 @@ typedef struct { static void stabs_bc_str_destroy(void *contents); static void stabs_bc_str_print(const void *contents, FILE *f, int indent_level); -static yasm_bc_resolve_flags stabs_bc_str_resolve - (yasm_bytecode *bc, int save, yasm_calc_bc_dist_func calc_bc_dist); +static int stabs_bc_str_calc_len + (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int stabs_bc_str_tobytes (yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_output_value_func output_value, @@ -132,8 +132,8 @@ static int stabs_bc_str_tobytes static void stabs_bc_stab_destroy(void *contents); static void stabs_bc_stab_print(const void *contents, FILE *f, int indent_level); -static yasm_bc_resolve_flags stabs_bc_stab_resolve - (yasm_bytecode *bc, int save, yasm_calc_bc_dist_func calc_bc_dist); +static int stabs_bc_stab_calc_len + (yasm_bytecode *bc, yasm_bc_add_span_func add_span, void *add_span_data); static int stabs_bc_stab_tobytes (yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_output_value_func output_value, @@ -145,7 +145,8 @@ static const yasm_bytecode_callback stabs_bc_str_callback = { stabs_bc_str_destroy, stabs_bc_str_print, yasm_bc_finalize_common, - stabs_bc_str_resolve, + stabs_bc_str_calc_len, + yasm_bc_expand_common, stabs_bc_str_tobytes, 0 }; @@ -154,7 +155,8 @@ static const yasm_bytecode_callback stabs_bc_stab_callback = { stabs_bc_stab_destroy, stabs_bc_stab_print, yasm_bc_finalize_common, - stabs_bc_stab_resolve, + stabs_bc_stab_calc_len, + yasm_bc_expand_common, stabs_bc_stab_tobytes, 0 }; @@ -378,6 +380,7 @@ stabs_dbgfmt_generate(yasm_dbgfmt *dbgfmt, yasm_errwarns *errwarns) stab = yasm_xmalloc(sizeof(stabs_stab)); dbgbc = yasm_bc_create_common(&stabs_bc_stab_callback, stab, 0); dbgbc->len = info.stablen; + dbgbc->offset = 0; yasm_section_bcs_append(info.stab, dbgbc); /* initial strtab bytecodes */ @@ -486,22 +489,22 @@ stabs_bc_str_print(const void *contents, FILE *f, int indent_level) fprintf(f, "%*s\"%s\"\n", indent_level, "", (const char *)contents); } -static yasm_bc_resolve_flags -stabs_bc_stab_resolve(yasm_bytecode *bc, int save, - yasm_calc_bc_dist_func calc_bc_dist) +static int +stabs_bc_stab_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, + void *add_span_data) { yasm_internal_error(N_("tried to resolve a stabs stab bytecode")); /*@notreached@*/ - return YASM_BC_RESOLVE_MIN_LEN; + return 0; } -static yasm_bc_resolve_flags -stabs_bc_str_resolve(yasm_bytecode *bc, int save, - yasm_calc_bc_dist_func calc_bc_dist) +static int +stabs_bc_str_calc_len(yasm_bytecode *bc, yasm_bc_add_span_func add_span, + void *add_span_data) { yasm_internal_error(N_("tried to resolve a stabs str bytecode")); /*@notreached@*/ - return YASM_BC_RESOLVE_MIN_LEN; + return 0; } static int -- 2.40.0