aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
diff options
context:
space:
mode:
authorBhuvanendra Kumar N <Bhuvanendra.KumarN@amd.com>2021-10-05 13:10:16 +0200
committerTom de Vries <tdevries@suse.de>2021-10-05 13:10:16 +0200
commita5ea23036d8a85d2ef133458a4c54a339857c152 (patch)
tree74fbc63e0edb067f2869caaf12a5882131cb415a /gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
parentb1f0f2841871f407d116e3e7f0dfca3e410633d4 (diff)
downloadgdb-a5ea23036d8a85d2ef133458a4c54a339857c152.zip
gdb-a5ea23036d8a85d2ef133458a4c54a339857c152.tar.gz
gdb-a5ea23036d8a85d2ef133458a4c54a339857c152.tar.bz2
[gdb/testsuite] Use function_range in gdb.dwarf2/dw2-ref-missing-frame.exp
Following 2 test points are failing with clang compiler (gdb) FAIL: gdb.dwarf2/dw2-ref-missing-frame.exp: func_nofb print (gdb) FAIL: gdb.dwarf2/dw2-ref-missing-frame.exp: func_loopfb print As in commit f677852bbda "[gdb/testsuite] Use function_range in gdb.dwarf2/dw2-abs-hi-pc.exp", the problem is that the CU and functions have an empty address range, due to using asm labels in global scope, which is a known source of problems, as explained in the comment of proc function_range in gdb/testsuite/lib/dwarf.exp. Hence fix this also by using function_range. Tested on x86_64-linux with gcc and clang.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp')
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp23
1 files changed, 17 insertions, 6 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
index 1b87144..e8d7c0f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
@@ -19,14 +19,25 @@ if {![dwarf2_support]} {
return 0
}
-standard_testfile .S
-set srcfuncfile ${testfile}-func.c
-set srcmainfile ${testfile}-main.c
+standard_testfile .S -func.c -main.c
+lassign [function_range func_nofb \
+ "${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}"] \
+ func_nofb_start func_nofb_len
+lassign [function_range func_loopfb \
+ "${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}"] \
+ func_loopfb_start func_loopfb_len
+
+set flags \
+ [list \
+ "debug" \
+ "additional_flags=\"-DFUNC_NOFB_START=$func_nofb_start\"" \
+ "additional_flags=\"-DFUNC_NOFB_END=$func_nofb_start + $func_nofb_len\"" \
+ "additional_flags=\"-DFUNC_LOOPFB_START=$func_loopfb_start\"" \
+ "additional_flags=\"-DFUNC_LOOPFB_END=$func_loopfb_start + $func_loopfb_len\""]
set executable ${testfile}
-if {[prepare_for_testing_full "failed to prepare" \
- [list $testfile {} $srcfile {} $srcfuncfile {} \
- $srcmainfile debug]]} {
+if {[prepare_for_testing "failed to prepare" $testfile \
+ [list $srcfile3 $srcfile $srcfile2] $flags] == -1} {
return -1
}