]> granicus.if.org Git - yasm/commitdiff
Reintegrate stabs dbgfmt.
authorPeter Johnson <peter@tortall.net>
Sat, 10 Jun 2006 17:24:13 +0000 (17:24 -0000)
committerPeter Johnson <peter@tortall.net>
Sat, 10 Jun 2006 17:24:13 +0000 (17:24 -0000)
svn path=/branches/new-optimizer/; revision=1564

modules/dbgfmts/Makefile.inc
modules/dbgfmts/stabs/stabs-dbgfmt.c

index 845b3a7d7f9199a0ce64c7e703b06fddb1a240f5..cf0a5ffdf4164f4e4eeae5cfe900a6c6492ddf33 100644 (file)
@@ -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
index 30d2c8df1778ef7bfd83b2960e2768419398e563..66c2dde5dc8a49bc48911f1fa3b8c64de543657f 100644 (file)
@@ -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