]> granicus.if.org Git - yasm/commitdiff
* dbgfmt.h (yasm_dbgfmt_directive): Add section parameter to specify currently
authorPeter Johnson <peter@tortall.net>
Sun, 29 Jan 2006 21:04:00 +0000 (21:04 -0000)
committerPeter Johnson <peter@tortall.net>
Sun, 29 Jan 2006 21:04:00 +0000 (21:04 -0000)
active section at the time of the directive.
* null-dbgfmt.c, stabs-dbgfmt.c: Implement.
* gas-bison.y: Pass.

svn path=/trunk/yasm/; revision=1348

libyasm/dbgfmt.h
modules/dbgfmts/null/null-dbgfmt.c
modules/dbgfmts/stabs/stabs-dbgfmt.c
modules/parsers/gas/gas-bison.y

index e18182b322a68194f6be52beb4a60f9a7ca0f396..c355a8b6f17bef4b44c44b586713cfe48d76f5b7 100644 (file)
@@ -75,7 +75,8 @@ typedef struct yasm_dbgfmt_module {
      * Call yasm_dbgfmt_directive() instead of calling this function.
      */
     int (*directive) (yasm_dbgfmt *dbgfmt, const char *name,
-                     yasm_valparamhead *valparams, unsigned long line);
+                     yasm_section *sect, yasm_valparamhead *valparams,
+                     unsigned long line);
 
     /** Module-level implementation of yasm_dbgfmt_generate().
      * Call yasm_dbgfmt_generate() instead of calling this function.
@@ -113,13 +114,15 @@ void yasm_dbgfmt_destroy(/*@only@*/ yasm_dbgfmt *dbgfmt);
 /** DEBUG directive support.
  * \param dbgfmt       debug format
  * \param name         directive name
+ * \param sect         current active section
  * \param valparams    value/parameters
  * \param line         virtual line (from yasm_linemap)
  * \return Nonzero if directive was not recognized; 0 if directive was
  *            recognized even if it wasn't valid.
  */
 int yasm_dbgfmt_directive(yasm_dbgfmt *dbgfmt, const char *name,
-                         yasm_valparamhead *valparams, unsigned long line);
+                         yasm_section *sect, yasm_valparamhead *valparams,
+                         unsigned long line);
 
 /** Generate debugging information bytecodes.
  * \param dbgfmt       debug format
@@ -138,9 +141,9 @@ void yasm_dbgfmt_generate(yasm_dbgfmt *dbgfmt);
 
 #define yasm_dbgfmt_destroy(dbgfmt) \
     ((yasm_dbgfmt_base *)dbgfmt)->module->destroy(dbgfmt)
-#define yasm_dbgfmt_directive(dbgfmt, name, valparams, line) \
-    ((yasm_dbgfmt_base *)dbgfmt)->module->directive(dbgfmt, name, valparams, \
-                                                   line)
+#define yasm_dbgfmt_directive(dbgfmt, name, sect, valparams, line) \
+    ((yasm_dbgfmt_base *)dbgfmt)->module->directive(dbgfmt, name, sect, \
+                                                   valparams, line)
 #define yasm_dbgfmt_generate(dbgfmt) \
     ((yasm_dbgfmt_base *)dbgfmt)->module->generate(dbgfmt)
 
index ef11884066d762c1f528e6b021d207feae327831..04fbf75d56ef9c00dd1a10f390105b978bfdd6b2 100644 (file)
@@ -51,7 +51,8 @@ null_dbgfmt_destroy(/*@only@*/ yasm_dbgfmt *dbgfmt)
 
 static int
 null_dbgfmt_directive(yasm_dbgfmt *dbgfmt, const char *name,
-                     yasm_valparamhead *valparams, unsigned long line)
+                     yasm_section *sect, yasm_valparamhead *valparams,
+                     unsigned long line)
 {
     return 1;
 }
index 07794791ba7b525140954bccd947948cd33059bc..75939fb9fa9130f91b779d1af2887894383461d6 100644 (file)
@@ -493,7 +493,8 @@ stabs_bc_str_resolve(yasm_bytecode *bc, int save,
 
 static int
 stabs_dbgfmt_directive(yasm_dbgfmt *dbgfmt, const char *name,
-                      yasm_valparamhead *valparams, unsigned long line)
+                      yasm_section *sect, yasm_valparamhead *valparams,
+                      unsigned long line)
 {
     return 1;
 }
index 3bbe9c4689520318c33f67dc28bdd9b132dbff92..88348576d4a2aeea17b62866c9b837c2e031e529 100644 (file)
@@ -454,7 +454,8 @@ lineexp: instr
        vp = yasm_vp_create($3.contents, NULL);
        yasm_vps_append(&vps, vp);
 
-       yasm_dbgfmt_directive(parser_gas->dbgfmt, "file", &vps, cur_line);
+       yasm_dbgfmt_directive(parser_gas->dbgfmt, "file",
+                             parser_gas->cur_section, &vps, cur_line);
 
        yasm_vps_delete(&vps);
        $$ = NULL;
@@ -467,7 +468,8 @@ lineexp: instr
        vp = yasm_vp_create($2.contents, NULL);
        yasm_vps_append(&vps, vp);
 
-       yasm_dbgfmt_directive(parser_gas->dbgfmt, "file", &vps, cur_line);
+       yasm_dbgfmt_directive(parser_gas->dbgfmt, "file",
+                             parser_gas->cur_section, &vps, cur_line);
 
        yasm_vps_delete(&vps);
        $$ = NULL;
@@ -482,7 +484,8 @@ lineexp: instr
        vp = yasm_vp_create(NULL, p_expr_new_ident(yasm_expr_int($3)));
        yasm_vps_append(&vps, vp);
 
-       yasm_dbgfmt_directive(parser_gas->dbgfmt, "loc", &vps, cur_line);
+       yasm_dbgfmt_directive(parser_gas->dbgfmt, "loc",
+                             parser_gas->cur_section, &vps, cur_line);
 
        yasm_vps_delete(&vps);
        $$ = NULL;
@@ -499,7 +502,8 @@ lineexp: instr
        vp = yasm_vp_create(NULL, p_expr_new_ident(yasm_expr_int($4)));
        yasm_vps_append(&vps, vp);
 
-       yasm_dbgfmt_directive(parser_gas->dbgfmt, "loc", &vps, cur_line);
+       yasm_dbgfmt_directive(parser_gas->dbgfmt, "loc",
+                             parser_gas->cur_section, &vps, cur_line);
 
        yasm_vps_delete(&vps);
        $$ = NULL;