aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/break-entry.exp11
-rw-r--r--gdb/testsuite/gdb.base/default.exp6
-rw-r--r--gdb/testsuite/gdb.base/display.exp2
-rw-r--r--gdb/testsuite/gdb.base/ending-run.exp2
-rw-r--r--gdb/testsuite/gdb.base/list.exp4
-rw-r--r--gdb/testsuite/gdb.base/setshow.exp2
-rw-r--r--gdb/testsuite/gdb.base/valgrind-db-attach.exp5
7 files changed, 19 insertions, 13 deletions
diff --git a/gdb/testsuite/gdb.base/break-entry.exp b/gdb/testsuite/gdb.base/break-entry.exp
index 9e1a14c..d748ad2 100644
--- a/gdb/testsuite/gdb.base/break-entry.exp
+++ b/gdb/testsuite/gdb.base/break-entry.exp
@@ -16,11 +16,6 @@
# Test inferior can stop at its very first instruction, usually "_start".
# Dynamic executables have first instruction in ld.so.
-set testfile break-entry
-if { [prepare_for_testing ${testfile}.exp ${testfile} start.c {additional_flags=-static}] } {
- return -1
-}
-
# If we're using a stub, we'll already be debugging a live program and
# stopped at the entry point when we connect, and so the runto below
# will issue a "continue", which always skips any breakpoint at PC.
@@ -30,11 +25,17 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} start.c {additional_flags=
# continues the process with the equivalent of "jump *$PC", which
# triggers any breakpoint at $PC. The latter is what we want to test.
+set testfile break-entry
+
if [target_info exists use_gdb_stub] {
untested ${testfile}.exp
return
}
+if { [prepare_for_testing ${testfile}.exp ${testfile} start.c {additional_flags=-static}] } {
+ return -1
+}
+
set test "info files"
set entry ""
gdb_test_multiple $test $test {
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 4b7a8f5..e23ac21 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -39,7 +39,7 @@ gdb_test "append value" "Missing filename\."
gdb_test "append binary memory" "Missing filename\."
gdb_test "append binary value" "Missing filename\."
-if ![target_info exists use_gdb_stub] {
+if !$use_gdb_stub {
setup_xfail "mips-idt-*"
gdb_test_multiple "attach" "attach" {
-re "Argument required .(process-id|program) to attach.*$gdb_prompt $"\
@@ -420,7 +420,7 @@ gdb_test "ptype" "The history is empty." "ptype"
gdb_test "pwd" "Working directory .*" "pwd"
#test run "r" abbreviation
-if [target_info exists use_gdb_stub] {
+if $use_gdb_stub {
# Only extended-remote supports "run".
} elseif [istarget "*-*-vxworks*"] then {
gdb_test "set args" ".*" ""
@@ -448,7 +448,7 @@ You must specify a function name to run, and arguments if any"\
}
#test run
-if [target_info exists use_gdb_stub] {
+if $use_gdb_stub {
# Only extended-remote supports "run".
} elseif [istarget "*-*-vxworks*"] then {
gdb_test "set args" ".*" ""
diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp
index fcf8511..fc3c47e 100644
--- a/gdb/testsuite/gdb.base/display.exp
+++ b/gdb/testsuite/gdb.base/display.exp
@@ -51,7 +51,7 @@ gdb_load ${binfile}
# Some coverage stuff
#
-if ![target_info exists use_gdb_stub] {
+if !$use_gdb_stub {
gdb_test "kill" ".*The program is not being run.*"
gdb_test "detach" ".*"
gdb_test "run" ".*"
diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
index 0098f04..1de1ed0 100644
--- a/gdb/testsuite/gdb.base/ending-run.exp
+++ b/gdb/testsuite/gdb.base/ending-run.exp
@@ -208,7 +208,7 @@ gdb_test_multiple "next" "step out of main" {
set program_exited_normally 0
set program_not_exited 0
set program_in_exit 0
-if {! [target_info exists use_gdb_stub]
+if {!$use_gdb_stub
&& (! [target_info exists use_cygmon] || ! [target_info use_cygmon])} {
global program_exited;
if {[eval expr $program_exited == 0]} {
diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
index 5b9fe15..d967dd2 100644
--- a/gdb/testsuite/gdb.base/list.exp
+++ b/gdb/testsuite/gdb.base/list.exp
@@ -81,7 +81,7 @@ proc set_listsize { arg } {
#
proc test_listsize {} {
- global gdb_prompt
+ global gdb_prompt use_gdb_stub
global hp_cc_compiler
global hp_aCC_compiler
@@ -94,7 +94,7 @@ proc test_listsize {} {
# list the lines there instead of main, so we skip this test for remote targets.
# The second case is for optimized code, it is still correct.
- if [target_info exists use_gdb_stub] {
+ if $use_gdb_stub {
runto_main;
unsupported "list default lines around main";
} else {
diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp
index ef32f1c..c360993 100644
--- a/gdb/testsuite/gdb.base/setshow.exp
+++ b/gdb/testsuite/gdb.base/setshow.exp
@@ -97,7 +97,7 @@ gdb_test_no_output "set args foo bar blup baz bubble" "set args"
gdb_test "show args" "Argument list to give program being debugged when it is started is \"foo bar blup baz bubble\"..*" "show args"
# Don't test if we can't pass args or if we're using a stub.
-if { ![target_info exists use_gdb_stub] && ![target_info exists noargs] } {
+if { !$use_gdb_stub && ![target_info exists noargs] } {
#test passing args
gdb_test "cont" "Continuing.*" "continuing"
delete_breakpoints
diff --git a/gdb/testsuite/gdb.base/valgrind-db-attach.exp b/gdb/testsuite/gdb.base/valgrind-db-attach.exp
index 98cc07a..e3199b2 100644
--- a/gdb/testsuite/gdb.base/valgrind-db-attach.exp
+++ b/gdb/testsuite/gdb.base/valgrind-db-attach.exp
@@ -41,6 +41,11 @@ pass $test
# Declare GDB now as running.
set gdb_spawn_id -1
+# GDB spawned by `valgrind --db-attach=yes' stops already after the startup is
+# executed, like with non-extended gdbserver. It is also not correct to
+# run/attach the inferior.
+set use_gdb_stub 1
+
set test "valgrind started"
# The trailing '.' differs for different memcheck versions.
gdb_test_multiple "" $test {