(INTERNAL_GDBFLAGS): ... to here. Move -nw to here as well.
(default_gdb_version): Add $INTERNAL_GDBFLAGS to gdb invocations.
(default_gdb_start,default_gdb_exit): Ditto.
* lib/mi-support.exp (default_mi_gdb_start): Ditto.
(mi_uncatched_gdb_exit): Add $INTERNAL_GDBFLAGS to log message.
* gdb.base/corefile.exp: Add $INTERNAL_GDBFLAGS to gdb invocations.
* gdb.base/dbx.exp (dbx_gdb_start): Ditto.
* gdb.base/args.exp (GDBFLAGS): Don't overwrite, append.
* gdb.base/remotetimeout.exp (GDBFLAGS): Ditto.
+2008-11-10 Doug Evans <dje@google.com>
+
+ * lib/gdb.exp (GDBFLAGS): Move -nx ...
+ (INTERNAL_GDBFLAGS): ... to here. Move -nw to here as well.
+ (default_gdb_version): Add $INTERNAL_GDBFLAGS to gdb invocations.
+ (default_gdb_start,default_gdb_exit): Ditto.
+ * lib/mi-support.exp (default_mi_gdb_start): Ditto.
+ (mi_uncatched_gdb_exit): Add $INTERNAL_GDBFLAGS to log message.
+ * gdb.base/corefile.exp: Add $INTERNAL_GDBFLAGS to gdb invocations.
+ * gdb.base/dbx.exp (dbx_gdb_start): Ditto.
+ * gdb.base/args.exp (GDBFLAGS): Don't overwrite, append.
+ * gdb.base/remotetimeout.exp (GDBFLAGS): Ditto.
+
2008-11-03 Andreas Schwab <schwab@suse.de>
* gdb.base/hashline2.exp: Fix typo.
# Test that the --args are processed correctly.
#
set old_gdbflags $GDBFLAGS
-set GDBFLAGS "-nx --args $binfile 1 3"
+
+set GDBFLAGS "$old_gdbflags --args $binfile 1 3"
args_test basic {{1} {3}}
#
# The syntax needed is a little peculiar; DejaGNU treats the arguments as a
# list and expands them itself, since no shell redirection is involved.
#
-set GDBFLAGS "-nx --args $binfile 1 {} 3"
+set GDBFLAGS "$old_gdbflags --args $binfile 1 {} 3"
args_test "one empty" {{1} {} {3}}
#
# try with 2 empty args
#
-set GDBFLAGS "-nx --args $binfile 1 {} {} 3"
+set GDBFLAGS "$old_gdbflags --args $binfile 1 {} {} 3"
args_test "two empty" {{1} {} {} 3}
# Try with arguments containing literal single quotes.
-set GDBFLAGS "-nx --args $binfile 1 '' 3"
+set GDBFLAGS "$old_gdbflags --args $binfile 1 '' 3"
args_test "one empty (with single quotes)" {{1} {''} {3}}
-set GDBFLAGS "-nx --args $binfile 1 '' '' 3"
+set GDBFLAGS "$old_gdbflags --args $binfile 1 '' '' 3"
args_test "two empty (with single quotes)" {{1} {''} {''} {3}}
# try with arguments containing literal newlines.
# To do this, we must shutdown the currently running gdb and restart
# with the -core args. We can't use gdb_start because it looks for
# the first gdb prompt, and the message we are looking for occurs
-# before the first prompt. Also, we can't include GDBFLAGS because
-# if it is empty, this confuses gdb with an empty argument that it
-# grumbles about (said grumbling currently being ignored in gdb_start).
-# **FIXME**
+# before the first prompt.
#
# Another problem is that on some systems (solaris for example), there
# is apparently a limit on the length of a fully specified path to
gdb_exit
if $verbose>1 then {
- send_user "Spawning $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile\n"
+ send_user "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS -core=$objdir/$subdir/corefile\n"
}
set oldtimeout $timeout
set timeout [expr "$timeout + 60"]
verbose "Timeout is now $timeout seconds" 2
-eval "spawn $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile"
+eval "spawn $GDB $INTERNAL_GDBFLAGS $GDBFLAGS -core=$objdir/$subdir/corefile"
expect {
-re "Couldn't find .* registers in core file.*$gdb_prompt $" {
fail "args: -core=corefile (couldn't find regs)"
close;
if $verbose>1 then {
- send_user "Spawning $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile\n"
+ send_user "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=$objdir/$subdir/corefile\n"
}
-eval "spawn $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile";
+eval "spawn $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=$objdir/$subdir/corefile";
expect {
-re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
pass "args: execfile -core=corefile"
proc dbx_gdb_start { } {
global verbose
global GDB
- global GDBFLAGS
+ global INTERNAL_GDBFLAGS GDBFLAGS
global prompt
global spawn_id
global timeout
- verbose "Spawning $GDB -nw $GDBFLAGS"
+ verbose "Spawning $GDB -dbx $INTERNAL_GDBFLAGS $GDBFLAGS"
if { [which $GDB] == 0 } then {
perror "$GDB does not exist."
set oldtimeout $timeout
set timeout [expr "$timeout + 60"]
- eval "spawn $GDB -nw -dbx $GDBFLAGS"
+ eval "spawn $GDB -dbx $INTERNAL_GDBFLAGS $GDBFLAGS"
gdb_expect {
-re ".*\r\n$gdb_prompt $" {
verbose "GDB initialized."
# Test that -l is processed correctly.
#
set old_gdbflags $GDBFLAGS
-set GDBFLAGS "-l 42"
+set GDBFLAGS "$GDBFLAGS -l 42"
gdb_exit
gdb_start
gdb_test "show remotetimeout" \
}
verbose "using GDB = $GDB" 2
+# GDBFLAGS is available for the user to set on the command line.
+# E.g. make check RUNTESTFLAGS=GDBFLAGS=mumble
+# Testcases may use it to add additional flags, but they must:
+# - append new flags, not overwrite
+# - restore the original value when done
global GDBFLAGS
if ![info exists GDBFLAGS] {
- set GDBFLAGS "-nx"
+ set GDBFLAGS ""
}
verbose "using GDBFLAGS = $GDBFLAGS" 2
+# INTERNAL_GDBFLAGS contains flags that the testsuite requires.
+set INTERNAL_GDBFLAGS "-nw -nx"
+
# The variable gdb_prompt is a regexp which matches the gdb prompt.
# Set it if it is not already set.
global gdb_prompt
#
proc default_gdb_version {} {
global GDB
- global GDBFLAGS
+ global INTERNAL_GDBFLAGS GDBFLAGS
global gdb_prompt
set fileid [open "gdb_cmd" w];
puts $fileid "q";
close $fileid;
set cmdfile [remote_download host "gdb_cmd"];
- set output [remote_exec host "$GDB -nw --command $cmdfile"]
+ set output [remote_exec host "$GDB $INTERNAL_GDBFLAGS --command $cmdfile"]
remote_file build delete "gdb_cmd";
remote_file host delete "$cmdfile";
set tmp [lindex $output 1];
set version ""
regexp " \[0-9\]\[^ \t\n\r\]+" "$tmp" version
if ![is_remote host] {
- clone_output "[which $GDB] version $version $GDBFLAGS\n"
+ clone_output "[which $GDB] version $version $INTERNAL_GDBFLAGS $GDBFLAGS\n"
} else {
- clone_output "$GDB on remote host version $version $GDBFLAGS\n"
+ clone_output "$GDB on remote host version $version $INTERNAL_GDBFLAGS $GDBFLAGS\n"
}
}
#
proc default_gdb_exit {} {
global GDB
- global GDBFLAGS
+ global INTERNAL_GDBFLAGS GDBFLAGS
global verbose
global gdb_spawn_id;
return;
}
- verbose "Quitting $GDB $GDBFLAGS"
+ verbose "Quitting $GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
if { [is_remote host] && [board_info host exists fileid] } {
send_gdb "quit\n";
proc default_gdb_start { } {
global verbose
global GDB
- global GDBFLAGS
+ global INTERNAL_GDBFLAGS GDBFLAGS
global gdb_prompt
global timeout
global gdb_spawn_id;
gdb_stop_suppressing_tests;
- verbose "Spawning $GDB -nw $GDBFLAGS"
+ verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
if [info exists gdb_spawn_id] {
return 0;
exit 1
}
}
- set res [remote_spawn host "$GDB -nw $GDBFLAGS [host_info gdb_opts]"];
+ set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]"];
if { $res < 0 || $res == "" } {
perror "Spawning $GDB failed."
return 1;
proc mi_uncatched_gdb_exit {} {
global GDB
- global GDBFLAGS
+ global INTERNAL_GDBFLAGS GDBFLAGS
global verbose
global gdb_spawn_id;
global gdb_prompt
return;
}
- verbose "Quitting $GDB $GDBFLAGS $MIFLAGS"
+ verbose "Quitting $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS"
if { [is_remote host] && [board_info host exists fileid] } {
send_gdb "999-gdb-exit\n";
proc default_mi_gdb_start { args } {
global verbose
global GDB
- global GDBFLAGS
+ global INTERNAL_GDBFLAGS GDBFLAGS
global gdb_prompt
global mi_gdb_prompt
global timeout
sid_start
}
- verbose "Spawning $GDB -nw $GDBFLAGS $MIFLAGS"
+ verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS"
if [info exists gdb_spawn_id] {
return 0;
set mi_inferior_tty_name $spawn_out(slave,name)
}
- set res [remote_spawn host "$GDB -nw $GDBFLAGS $MIFLAGS [host_info gdb_opts]"];
+ set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS [host_info gdb_opts]"];
if { $res < 0 || $res == "" } {
perror "Spawning $GDB failed."
return 1;