From: Peter Johnson Date: Mon, 23 Jan 2006 07:32:18 +0000 (-0000) Subject: * gas-bison.y: Pass .loc and .file directives onto dbgfmt. Note: no dbgfmt X-Git-Tag: v0.5.0rc1~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c1cf2657b7c245b3b8b51af31be777c9b22bddac;p=yasm * gas-bison.y: Pass .loc and .file directives onto dbgfmt. Note: no dbgfmt yet supports these (DWARF2 will). svn path=/trunk/yasm/; revision=1343 --- diff --git a/modules/parsers/gas/gas-bison.y b/modules/parsers/gas/gas-bison.y index 2b745d29..3bbe9c46 100644 --- a/modules/parsers/gas/gas-bison.y +++ b/modules/parsers/gas/gas-bison.y @@ -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 {