debug: make *all* the null debug routines available as a library
authorH. Peter Anvin <hpa@zytor.com>
Sun, 28 Jun 2009 04:58:21 +0000 (21:58 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 28 Jun 2009 04:58:21 +0000 (21:58 -0700)
Make all the null debug routines available as a library, so we can use
them whenever appropriate.  We really don't need to have a bunch of
dummy functions scattered all over the code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
nasmlib.h
output/outelf32.c
output/outelf64.c

index d901520..1470b37 100644 (file)
--- a/nasmlib.h
+++ b/nasmlib.h
@@ -323,7 +323,17 @@ int src_get(int32_t *xline, char **xname);
 
 char *nasm_strcat(const char *one, const char *two);
 
+/* Do-nothing versions of all the debug routines */
+struct ofmt;
+void null_debug_init(struct ofmt *of, void *id, FILE * fp, efunc error);
+void null_debug_linenum(const char *filename, int32_t linenumber,
+                       int32_t segto);
+void null_debug_deflabel(char *name, int32_t segment, int64_t offset,
+                         int is_global, char *special);
 void null_debug_routine(const char *directive, const char *params);
+void null_debug_typevalue(int32_t type);
+void null_debug_output(int type, void *param);
+void null_debug_cleanup(void);
 extern struct dfmt null_debug_form;
 extern struct dfmt *null_debug_arr[2];
 
index a374adc..1e2d76f 100644 (file)
@@ -186,7 +186,6 @@ static void debug32_deflabel(char *, int32_t, int64_t, int, char *);
 static void debug32_directive(const char *, const char *);
 
 /* stabs debugging routines */
-static void stabs32_init(struct ofmt *, void *, FILE *, efunc);
 static void stabs32_linenum(const char *filename, int32_t linenumber, int32_t);
 static void stabs32_output(int, void *);
 static void stabs32_generate(void);
@@ -1431,7 +1430,7 @@ static struct dfmt df_dwarf = {
 static struct dfmt df_stabs = {
     "ELF32 (i386) stabs debug format for Linux/Unix",
     "stabs",
-    stabs32_init,
+    null_debug_init,
     stabs32_linenum,
     debug32_deflabel,
     debug32_directive,
@@ -1479,14 +1478,6 @@ struct ofmt of_elf = {
 };
 /* again, the stabs debugging stuff (code) */
 
-static void stabs32_init(struct ofmt *of, void *id, FILE * fp, efunc error)
-{
-    (void)of;
-    (void)id;
-    (void)fp;
-    (void)error;
-}
-
 static void stabs32_linenum(const char *filename, int32_t linenumber,
                            int32_t segto)
 {
index 5d53bd2..7068764 100644 (file)
@@ -193,7 +193,6 @@ static void debug64_deflabel(char *, int32_t, int64_t, int, char *);
 static void debug64_directive(const char *, const char *);
 
 /* stabs debugging routines */
-static void stabs64_init(struct ofmt *, void *, FILE *, efunc);
 static void stabs64_linenum(const char *filename, int32_t linenumber, int32_t);
 static void stabs64_output(int, void *);
 static void stabs64_generate(void);
@@ -1521,7 +1520,7 @@ static struct dfmt df_dwarf = {
 static struct dfmt df_stabs = {
     "ELF64 (x86-64) stabs debug format for Linux/Unix",
     "stabs",
-    stabs64_init,
+    null_debug_init,
     stabs64_linenum,
     debug64_deflabel,
     debug64_directive,
@@ -1631,14 +1630,6 @@ static void debug64_typevalue(int32_t type)
 }
 
 /* stabs debugging routines */
-static void stabs64_init(struct ofmt *of, void *id, FILE * fp, efunc error)
-{
-    (void)of;
-    (void)id;
-    (void)fp;
-    (void)error;
-}
-
 
 static void stabs64_linenum(const char *filename, int32_t linenumber, int32_t segto)
 {