diff options
author | Doug Evans <dje@google.com> | 2008-11-11 01:23:34 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2008-11-11 01:23:34 +0000 |
commit | 6b8ce727297b1e40738e50f83a75881b290fe6a6 (patch) | |
tree | 41313f0b7c6916be25b8650a7e723e61adbf820d /gdb/testsuite/lib | |
parent | 7bae73321367a72738afc2428faf4304222860c9 (diff) | |
download | gdb-6b8ce727297b1e40738e50f83a75881b290fe6a6.zip gdb-6b8ce727297b1e40738e50f83a75881b290fe6a6.tar.gz gdb-6b8ce727297b1e40738e50f83a75881b290fe6a6.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 28 | ||||
-rw-r--r-- | gdb/testsuite/lib/mi-support.exp | 10 |
2 files changed, 23 insertions, 15 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 0a87668..72448cd 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -42,12 +42,20 @@ if ![info exists GDB] { } 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 @@ -94,22 +102,22 @@ set octal "\[0-7\]+" # 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" } } @@ -1010,7 +1018,7 @@ proc gdb_reinitialize_dir { subdir } { # proc default_gdb_exit {} { global GDB - global GDBFLAGS + global INTERNAL_GDBFLAGS GDBFLAGS global verbose global gdb_spawn_id; @@ -1020,7 +1028,7 @@ proc default_gdb_exit {} { return; } - verbose "Quitting $GDB $GDBFLAGS" + verbose "Quitting $GDB $INTERNAL_GDBFLAGS $GDBFLAGS" if { [is_remote host] && [board_info host exists fileid] } { send_gdb "quit\n"; @@ -1150,14 +1158,14 @@ proc gdb_file_cmd { arg } { 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; @@ -1169,7 +1177,7 @@ proc default_gdb_start { } { 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; diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 9ef9df9..39a2982 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -39,7 +39,7 @@ proc mi_gdb_exit {} { proc mi_uncatched_gdb_exit {} { global GDB - global GDBFLAGS + global INTERNAL_GDBFLAGS GDBFLAGS global verbose global gdb_spawn_id; global gdb_prompt @@ -56,7 +56,7 @@ proc mi_uncatched_gdb_exit {} { 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"; @@ -94,7 +94,7 @@ proc mi_uncatched_gdb_exit {} { 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 @@ -116,7 +116,7 @@ proc default_mi_gdb_start { args } { sid_start } - verbose "Spawning $GDB -nw $GDBFLAGS $MIFLAGS" + verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS" if [info exists gdb_spawn_id] { return 0; @@ -138,7 +138,7 @@ proc default_mi_gdb_start { args } { 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; |