This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix gdb_spawn_with_cmdline_opts with non-empty GDBFLAGS


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0bbeccb1eea844c2124eeb1e8d8d4a6cf7092d7a

commit 0bbeccb1eea844c2124eeb1e8d8d4a6cf7092d7a
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Mar 30 18:00:28 2015 +0100

    Fix gdb_spawn_with_cmdline_opts with non-empty GDBFLAGS
    
    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.

Diff:
---
 gdb/testsuite/ChangeLog   | 5 +++++
 gdb/testsuite/lib/gdb.exp | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 1153733..9fb8307 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -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".
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 6b42997..1a576c0 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -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]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]