Fix gdb_spawn_with_cmdline_opts with non-empty GDBFLAGS
authorPedro Alves <palves@redhat.com>
Mon, 30 Mar 2015 17:00:28 +0000 (18:00 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 1 Apr 2015 14:25:21 +0000 (15:25 +0100)
Running attach.exp with a DejaGnu board that sets GDBFLAGS, like
e.g.,:

  set GDBFLAGS "-ex \"set displaced off\""

fails with (line breaks added for clarity):

 (gdb) PASS: gdb.base/attach.exp: starting with --pid
 Executing on build: kill -9 3537    (timeout = 300)
 spawn -ignore SIGHUP kill -9 3537
 spawn of build/gdb/gdb -nw -nx \
  -data-directory build/gdb/testsuite/../data-directory  \
  -ex "set displaced off"-iex "set height 0" -iex "set width 0" \
                     ^^^^^^^^
  --pid=4468 -ex "start"  failed
 ERROR: Spawning build/gdb/gdb failed.
 UNRESOLVED: gdb.base/attach.exp: cmdline attach run: run to prompt

gdb/testsuite/ChangeLog:
2015-04-01  Pedro Alves  <palves@redhat.com>

* lib/gdb.exp (gdb_spawn_with_cmdline_opts): Append space to
GDBFLAGS if not empty.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp

index 11537330cf3fb8c4b395a12e3331752ee5d1b268..9fb8307acdca27ff0c9ee23e1520313e670c75ef 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-01  Pedro Alves  <palves@redhat.com>
+
+       * lib/gdb.exp (gdb_spawn_with_cmdline_opts): Append space to
+       GDBFLAGS if not empty.
+
 2015-04-01  Pierre-Marie de Rodat  <derodat@adacore.com>
 
        * gdb.ada/complete.exp: Remove "multi_line".
index 6b42997274af584dee9bfb0f770b85abc6f6e117..1a576c02c4bf6c014a126abfc1c4e36870f81eb2 100644 (file)
@@ -3423,6 +3423,9 @@ proc gdb_spawn_with_cmdline_opts { cmdline_flags } {
 
     set saved_gdbflags $GDBFLAGS
 
+    if {$GDBFLAGS != ""} {
+       append GDBFLAGS " "
+    }
     append GDBFLAGS $cmdline_flags
 
     set res [gdb_spawn]
This page took 0.03287 seconds and 4 git commands to generate.