aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-04-17 12:55:00 +0200
committerTom de Vries <tdevries@suse.de>2024-04-17 12:55:00 +0200
commit0f91492fcf3e75a014c605bc61fc7eed8ad5100e (patch)
treec2d8428bf1d73afe84c2c907c917dc89018bb870 /gdb/testsuite/gdb.dwarf2
parentf0d556d14b1d1c3f8e2f9c13b08adca22e1b8c9c (diff)
downloadgdb-0f91492fcf3e75a014c605bc61fc7eed8ad5100e.zip
gdb-0f91492fcf3e75a014c605bc61fc7eed8ad5100e.tar.gz
gdb-0f91492fcf3e75a014c605bc61fc7eed8ad5100e.tar.bz2
[gdb/testsuite] Require DW_LNE_end_sequence
The dwarf standard requires that every line number program sequence ends with a DW_LNE_end_sequence instruction. Enforce this in the dwarf assembler for the last sequence in a line number program (we have no means to enforce this for earlier sequences), and fix a few test-case that don't have it. Tested on aarch64-linux. PR testsuite/31618 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31618
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2')
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-noloc.exp3
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-symtab-includes-lookup.exp7
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-symtab-includes.exp7
3 files changed, 17 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-noloc.exp b/gdb/testsuite/gdb.dwarf2/dw2-noloc.exp
index 8c96ab8..bd74760 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-noloc.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-noloc.exp
@@ -203,6 +203,9 @@ Dwarf::assemble $asm_file {
line [gdb_get_line_number "main start"]
DW_LNS_set_prologue_end
DW_LNS_copy
+
+ DW_LNE_set_address $main_end
+ DW_LNE_end_sequence
}
}
}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes-lookup.exp b/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes-lookup.exp
index 14bc848..96a5284 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes-lookup.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes-lookup.exp
@@ -50,6 +50,8 @@ Dwarf::assemble $asm_file {
declare_labels partial_label lines_label
global srcdir subdir srcfile
+ get_func_info main
+
cu {} {
partial_label: partial_unit {
{stmt_list ${lines_label} DW_FORM_sec_offset}
@@ -77,7 +79,12 @@ Dwarf::assemble $asm_file {
include_dir "${srcdir}/${subdir}"
file_name "dw2-symtab-includes.h" 1
program {
+ DW_LNE_set_address $main_start
DW_LNS_advance_line 1
+ DW_LNS_copy
+
+ DW_LNE_set_address $main_end
+ DW_LNE_end_sequence
}
}
}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes.exp b/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes.exp
index 09007f2..dc4a788 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes.exp
@@ -29,6 +29,8 @@ Dwarf::assemble $asm_file {
declare_labels partial_label lines_label
global srcdir subdir srcfile
+ get_func_info main
+
cu {} {
partial_label: partial_unit {} {
}
@@ -49,7 +51,12 @@ Dwarf::assemble $asm_file {
include_dir "${srcdir}/${subdir}"
file_name "dw2-symtab-includes.h" 1
program {
+ DW_LNE_set_address $main_start
DW_LNS_advance_line 1
+ DW_LNS_copy
+
+ DW_LNE_set_address $main_end
+ DW_LNE_end_sequence
}
}
}