]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/testsuite: avoid creating files in gdb/testsuite directory
authorAndrew Burgess <aburgess@redhat.com>
Sun, 2 Oct 2022 14:18:15 +0000 (15:18 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 19 Oct 2022 11:15:08 +0000 (12:15 +0100)
I spotted that the test gdb.dwarf2/dw2-using-debug-str.exp was
creating an output file called debug_str_section in the root
build/gdb/testsuite directory instead of using the
build/gdb/testsuite/output/gdb.dwarf2/dw2-using-debug-str/ directory.

This appears to be caused by a missing '$' character.  We setup a
variable debug_str_section which contains a path within the output
directory, but then when we build the objcopy command we use
'debug_str_section' without a '$' prefix, as a result, we create the
debug_str_section file.

This commit adds the missing '$', the file is now created in the
output directory.

gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp

index d27554f2f8991aed02134bb693f72f202aa25b0e..4d1c49044d59582412a0498841ebb612be597d63 100644 (file)
@@ -105,7 +105,7 @@ gdb_test "p global_var" " = \\{aa = 0, bb = 0, cc = 0\\}"
 # cc-with-dwz-m.exp and cc-with-gnu-debuglink.exp.  Handle this by
 # skipping the remainder of the test-case.
 set debug_str_section "${binfile}-debug-str"
-set args "--dump-section .debug_str=debug_str_section $binfile"
+set args "--dump-section .debug_str=${debug_str_section} $binfile"
 set result [remote_exec host "[gdb_find_objcopy] $args"]
 set status [lindex $result 0]
 set output [lindex $result 1]