]> granicus.if.org Git - yasm/commitdiff
* gas-bison.y: Pass .loc and .file directives onto dbgfmt. Note: no dbgfmt
authorPeter Johnson <peter@tortall.net>
Mon, 23 Jan 2006 07:32:18 +0000 (07:32 -0000)
committerPeter Johnson <peter@tortall.net>
Mon, 23 Jan 2006 07:32:18 +0000 (07:32 -0000)
yet supports these (DWARF2 will).

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

modules/parsers/gas/gas-bison.y

index 2b745d29f37482c70bc621fe2d65383a18d42a97..3bbe9c4689520318c33f67dc28bdd9b132dbff92 100644 (file)
@@ -445,19 +445,63 @@ lineexp: instr
        $$ = NULL;
     }
     | DIR_FILE INTNUM STRING {
-       /* TODO */
+       yasm_valparamhead vps;
+       yasm_valparam *vp;
+
+       yasm_vps_initialize(&vps);
+       vp = yasm_vp_create(NULL, p_expr_new_ident(yasm_expr_int($2)));
+       yasm_vps_append(&vps, vp);
+       vp = yasm_vp_create($3.contents, NULL);
+       yasm_vps_append(&vps, vp);
+
+       yasm_dbgfmt_directive(parser_gas->dbgfmt, "file", &vps, cur_line);
+
+       yasm_vps_delete(&vps);
        $$ = NULL;
     }
     | DIR_FILE STRING {
-       /* TODO */
+       yasm_valparamhead vps;
+       yasm_valparam *vp;
+
+       yasm_vps_initialize(&vps);
+       vp = yasm_vp_create($2.contents, NULL);
+       yasm_vps_append(&vps, vp);
+
+       yasm_dbgfmt_directive(parser_gas->dbgfmt, "file", &vps, cur_line);
+
+       yasm_vps_delete(&vps);
        $$ = NULL;
     }
     | DIR_LOC INTNUM INTNUM {
-       /* TODO */
+       yasm_valparamhead vps;
+       yasm_valparam *vp;
+
+       yasm_vps_initialize(&vps);
+       vp = yasm_vp_create(NULL, p_expr_new_ident(yasm_expr_int($2)));
+       yasm_vps_append(&vps, vp);
+       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_vps_delete(&vps);
        $$ = NULL;
     }
     | DIR_LOC INTNUM INTNUM INTNUM {
-       /* TODO */
+       yasm_valparamhead vps;
+       yasm_valparam *vp;
+
+       yasm_vps_initialize(&vps);
+       vp = yasm_vp_create(NULL, p_expr_new_ident(yasm_expr_int($2)));
+       yasm_vps_append(&vps, vp);
+       vp = yasm_vp_create(NULL, p_expr_new_ident(yasm_expr_int($3)));
+       yasm_vps_append(&vps, vp);
+       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_vps_delete(&vps);
        $$ = NULL;
     }
     | DIR_TYPE label_id ',' '@' label_id {