[gdb/testsuite] Fix incorrect string concat in jit-elf.exp
authorTom de Vries <tdevries@suse.de>
Tue, 12 May 2020 12:59:01 +0000 (14:59 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 12 May 2020 12:59:01 +0000 (14:59 +0200)
When running test-case gdb.base/jit-elf.exp with target board
cc-with-gdb-index, we get:
...
spawn -ignore SIGHUP gdb/contrib/cc-with-tweaks.sh -i gcc \
  -fno-stack-protector src/gdb/testsuite/gdb.base/jit-elf-main.c \
  -fdiagnostics-color=never -DATTACH=1 -DLOAD_ADDRESS=0x7000000 \
  -DLOAD_INCREMENT=0x1000000 -g -lm \
  -o outputs/gdb.base/jit-elf/jit-elf-main"-attach"^M
outputs/gdb.base/jit-elf/.tmp/jit-elf-main-attach: \
  No such file or directory.^M
output is:
outputs/gdb.base/jit-elf/.tmp/jit-elf-main-attach: \
  No such file or directory.^M

gdb compile failed, outputs/gdb.base/jit-elf/.tmp/jit-elf-main-attach: \
  No such file or directory.
UNTESTED: gdb.base/jit-elf.exp: failed to compile jit-elf-main"-attach"
...

The problem is a string concat in jit-elf.exp:
...
  ${main_binfile}"-attach"
...
which is intended to generate string 'jit-elf-main-attach' but instead
generates string 'jit-elf-main"-attach"'.

Fix this by using "${main_binfile}-attach" instead.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-05-12  Tom de Vries  <tdevries@suse.de>

* gdb.base/jit-elf.exp: Fix string concat.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/jit-elf.exp

index 8e7af0bb47e7e58a9995fc46a0d0760d523f11a9..cd8440d35e0c40798eaa53729772aa88371f8bfb 100644 (file)
@@ -1,3 +1,7 @@
+2020-05-12  Tom de Vries  <tdevries@suse.de>
+
+       * gdb.base/jit-elf.exp: Fix string concat.
+
 2020-05-12  Tom de Vries  <tdevries@suse.de>
 
        * lib/jit-elf-helpers.exp: Don't use undefined variables in untested
index 68196a0a88afa4cb75fa1f486e3323a130ecfa42..78a19c2c9ab5a932bd9788522896f07e867cedee 100644 (file)
@@ -147,7 +147,7 @@ if { [compile_jit_main ${main_srcfile} ${main_binfile} {}] == 0 } {
 # registered.  We reuse the normal test, and detach/reattach at
 # specific interesting points.
 if {[can_spawn_for_attach]} {
-    if { [compile_jit_main ${main_srcfile} ${main_binfile}"-attach" \
+    if { [compile_jit_main ${main_srcfile} "${main_binfile}-attach" \
            {additional_flags=-DATTACH=1}] == 0 } {
        with_test_prefix attach {
            one_jit_test $jit_solibs_target "${hex}  jit_function_0001\[\r\n\]+${hex}  jit_function_0002" 1
@@ -155,7 +155,8 @@ if {[can_spawn_for_attach]} {
     }
 }
 
-if { [compile_jit_main ${main_srcfile} ${main_binfile}"-pie" {additional_flags=-fPIE ldflags=-pie}] == 0 } {
+if { [compile_jit_main ${main_srcfile} "${main_binfile}-pie" \
+         {additional_flags=-fPIE ldflags=-pie}] == 0 } {
     with_test_prefix PIE {
        one_jit_test [lindex $jit_solibs_target 0] "${hex}  jit_function_0001" 0
     }