# This test can only be run on targets which support DWARF-2 and use gas.
require dwarf2_support 1
-standard_testfile .c -dw.S
+standard_testfile .c
with_shared_gdb {
set func_info_vars \
set ldw64 $_ldw64
set string_form $_string_form
+ standard_testfile .c [prefix_id]-dw.S
+
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
declare_labels Llines
}
}
- if { [prepare_for_testing "failed to prepare" ${testfile} \
+ if { [prepare_for_testing "failed to prepare" ${testfile}.[prefix_id] \
[list $srcfile $asm_file] {nodebug}] } {
return -1
}
proc $name $arguments [list with_test_prefix $name $body]
}
+# Return an id corresponding to the test prefix stored in $pf_prefix, which
+# is more suitable for use in a file name.
+# F.i., for a pf_prefix:
+# gdb.dwarf2/dw2-lines.exp: \
+# cv=5: cdw=64: lv=5: ldw=64: string_form=line_strp:
+# return an id:
+# cv-5-cdw-32-lv-5-ldw-64-string_form-line_strp
+
+proc prefix_id {} {
+ global pf_prefix
+ set id $pf_prefix
+
+ # Strip ".exp: " prefix.
+ set id [regsub {.*\.exp: } $id {}]
+
+ # Strip colon suffix.
+ set id [regsub {:$} $id {}]
+
+ # Strip spaces.
+ set id [regsub -all { } $id {}]
+
+ # Replace colons, equal signs.
+ set id [regsub -all \[:=\] $id -]
+
+ return $id
+}
# Run BODY in the context of the caller. After BODY is run, the variables
# listed in VARS will be reset to the values they had before BODY was run.