From 2cf718fcb685abf854e4ab776748932db7f32383 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 31 Jan 2006 03:12:59 +0000 Subject: [PATCH] * dwarf2-dbgfmt.c (dwarf2_dbgfmt_generate_section): Propogate last-label refs to following locations in case there is no intermediate label. * dwarf64_2loc.asm: Test for this. svn path=/trunk/yasm/; revision=1354 --- modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c | 4 +- .../dbgfmts/dwarf2/tests/pass64/Makefile.inc | 3 + .../dwarf2/tests/pass64/dwarf64_2loc.asm | 6 + .../dwarf2/tests/pass64/dwarf64_2loc.errwarn | 0 .../dwarf2/tests/pass64/dwarf64_2loc.hex | 752 ++++++++++++++++++ 5 files changed, 764 insertions(+), 1 deletion(-) create mode 100644 modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.asm create mode 100644 modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.errwarn create mode 100644 modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.hex diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c index 56354e26..2b7c86a1 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c @@ -366,6 +366,7 @@ dwarf2_dbgfmt_generate_section(yasm_section *sect, /*@null@*/ void *d) /*@null@*/ dwarf2_section_data *dsd; /*@null@*/ dwarf2_loc *loc; /*@null@*/ yasm_bytecode *precbc = NULL, *bc; + /*@dependent@*/ yasm_symrec *lastsym = NULL; unsigned long addr_delta; /* registers for state machine for each sequence */ @@ -394,12 +395,13 @@ dwarf2_dbgfmt_generate_section(yasm_section *sect, /*@null@*/ void *d) if (bc->symrecs) { int i = 0; while (bc->symrecs[i]) { - loc->sym = bc->symrecs[i]; + lastsym = bc->symrecs[i]; i++; } } bc = yasm_bc__next(bc); } + loc->sym = lastsym; loc->bc = bc; } diff --git a/modules/dbgfmts/dwarf2/tests/pass64/Makefile.inc b/modules/dbgfmts/dwarf2/tests/pass64/Makefile.inc index 4d8574e4..84fb033e 100644 --- a/modules/dbgfmts/dwarf2/tests/pass64/Makefile.inc +++ b/modules/dbgfmts/dwarf2/tests/pass64/Makefile.inc @@ -3,6 +3,9 @@ TESTS += modules/dbgfmts/dwarf2/tests/pass64/dwarf2_pass64_test.sh EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass64/dwarf2_pass64_test.sh +EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.asm +EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.errwarn +EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.hex EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.asm EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.errwarn EXTRA_DIST += modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex diff --git a/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.asm b/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.asm new file mode 100644 index 00000000..2e6c5969 --- /dev/null +++ b/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.asm @@ -0,0 +1,6 @@ +.file 1 "dwarf64_2loc.c" + +.text +.loc 1 1 0 +.loc 1 2 0 + xorq %rax, %rax diff --git a/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.errwarn b/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.hex b/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.hex new file mode 100644 index 00000000..0a8a2eeb --- /dev/null +++ b/modules/dbgfmts/dwarf2/tests/pass64/dwarf64_2loc.hex @@ -0,0 +1,752 @@ +7f +45 +4c +46 +02 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +30 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +40 +00 +07 +00 +01 +00 +48 +31 +c0 +3c +00 +00 +00 +02 +00 +25 +00 +00 +00 +01 +01 +fb +0e +0d +00 +01 +01 +01 +01 +00 +00 +00 +01 +00 +00 +01 +00 +64 +77 +61 +72 +66 +36 +34 +5f +32 +6c +6f +63 +2e +63 +00 +00 +00 +00 +00 +00 +09 +02 +00 +00 +00 +00 +00 +00 +00 +00 +13 +02 +03 +00 +01 +01 +00 +32 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2e +74 +65 +78 +74 +00 +2e +64 +65 +62 +75 +67 +5f +6c +69 +6e +65 +00 +2e +72 +65 +6c +61 +2e +64 +65 +62 +75 +67 +5f +6c +69 +6e +65 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +9c +00 +00 +00 +00 +00 +00 +00 +3e +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +24 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +dc +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +2c +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +e0 +00 +00 +00 +00 +00 +00 +00 +48 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +03 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +43 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +13 +00 +00 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +84 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +05 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 -- 2.40.0