]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.dwarf2/dw2-lines.exp
gdb/testsuite/dwarf: don't automatically add directory and file entry for DWARF 5
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / dw2-lines.exp
index 3cbbd28fd48832dc8ae85e5d204e4a2e9e631548..b24eec0c8d2c0a27608b36ce97ac31e426896484 100644 (file)
@@ -79,10 +79,15 @@ proc test_1 { _cv _cdw64 _lv _ldw64 {_string_form ""}} {
        }
 
        lines [list version $lv is_64 $ldw64 string_form $string_form] Llines {
-           include_dir "${srcdir}/${subdir}"
-           file_name "$srcfile" 1
+           set diridx [include_dir "${srcdir}/${subdir}"]
+           file_name "$srcfile" $diridx
 
            program {
+               # If using DWARF 5, we want to refer to file 0, but the LNP
+               # state machine is still initialized with file 1.  So we need
+               # to set the current file explicitly.
+               DW_LNS_set_file $diridx
+
                DW_LNE_set_address bar_label
                line [line_for bar_label]
                DW_LNS_copy