aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2025-02-04 13:53:20 +0100
committerTom de Vries <tdevries@suse.de>2025-02-04 13:53:20 +0100
commita03e9c2782b42ba82a80164ffc9cf956b9dc092c (patch)
tree5da04b1e539a45f2f27db63df83425de59e0148d /gdb/testsuite/gdb.dwarf2
parent2470de6c0cbe3528f180e8aa7ea9bfd2e4f9ce37 (diff)
downloadbinutils-a03e9c2782b42ba82a80164ffc9cf956b9dc092c.zip
binutils-a03e9c2782b42ba82a80164ffc9cf956b9dc092c.tar.gz
binutils-a03e9c2782b42ba82a80164ffc9cf956b9dc092c.tar.bz2
[gdb/testsuite] Use c++ flag in c++ test-cases
In some cases, test-cases use c++, but don't add "c++" to the compilation flags. This can cause problems with some compilers. Fix this in some test-cases. Approved-By: Tom Tromey <tom@tromey.com> PR testsuite/30380 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30380
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2')
-rw-r--r--gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp1
-rw-r--r--gdb/testsuite/gdb.dwarf2/method-ptr.exp2
-rw-r--r--gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp16
-rw-r--r--gdb/testsuite/gdb.dwarf2/subrange.exp2
4 files changed, 17 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp b/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp
index a62de7b..7083ab7 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp
@@ -19,6 +19,7 @@ standard_testfile index.cc
set opts {}
lappend opts debug
+lappend opts c++
lappend opts additional_flags=-std=c++11
if {[prepare_for_testing "failed to prepare" "${testfile}" \
diff --git a/gdb/testsuite/gdb.dwarf2/method-ptr.exp b/gdb/testsuite/gdb.dwarf2/method-ptr.exp
index 4b4c222..9bb4776 100644
--- a/gdb/testsuite/gdb.dwarf2/method-ptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/method-ptr.exp
@@ -76,7 +76,7 @@ Dwarf::assemble $asm_file {
}
if { [prepare_for_testing "failed to prepare" ${testfile} \
- [list $srcfile $asm_file] {nodebug}] } {
+ [list $srcfile $asm_file] {nodebug c++}] } {
return -1
}
diff --git a/gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp b/gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp
index 06bd896..869b29f 100644
--- a/gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp
+++ b/gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp
@@ -25,6 +25,17 @@ require dwarf2_support
standard_testfile .cc .S
+set debug_flags {}
+lappend debug_flags debug
+lappend debug_flags c++
+
+set nodebug_flags {}
+lappend nodebug_flags nodebug
+lappend nodebug_flags c++
+
+get_func_info main $debug_flags
+
+
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
cu {} {
@@ -47,7 +58,8 @@ Dwarf::assemble $asm_file {
DW_TAG_subprogram {
{DW_AT_name "main"}
- {MACRO_AT_range "main"}
+ {DW_AT_low_pc $::main_start DW_FORM_addr}
+ {DW_AT_high_pc $::main_end DW_FORM_addr}
{DW_AT_type :$int}
{DW_AT_external 1 DW_FORM_flag}
} {
@@ -141,7 +153,7 @@ Dwarf::assemble $asm_file {
}
if { [prepare_for_testing "failed to prepare" ${testfile} \
- [list $srcfile $asm_file] {nodebug c++}] } {
+ [list $srcfile $asm_file] $nodebug_flags] } {
return -1
}
diff --git a/gdb/testsuite/gdb.dwarf2/subrange.exp b/gdb/testsuite/gdb.dwarf2/subrange.exp
index 2671f82..d384fb6 100644
--- a/gdb/testsuite/gdb.dwarf2/subrange.exp
+++ b/gdb/testsuite/gdb.dwarf2/subrange.exp
@@ -102,7 +102,7 @@ Dwarf::assemble $asm_file {
}
if { [prepare_for_testing "failed to prepare" ${testfile} \
- [list $srcfile $asm_file] {nodebug}] } {
+ [list $srcfile $asm_file] {nodebug c++}] } {
return -1
}