aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog22
-rw-r--r--gdb/testsuite/gdb.base/commands.exp2
-rw-r--r--gdb/testsuite/gdb.c++/derivation.exp15
-rw-r--r--gdb/testsuite/lib/compiler.c31
-rw-r--r--gdb/testsuite/lib/compiler.cc34
-rw-r--r--gdb/testsuite/lib/gdb.exp33
6 files changed, 117 insertions, 20 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ea28098..872aa7b 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,25 @@
+1999-11-12 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/dollar.exp: Remove, now in gdb.hp.
+
+1999-11-10 Jimmy Guo <guo@cup.hp.com>
+
+ * gdb.exp (get_compiler_info): pick up compiler.c and compiler.cc
+ from $srcdir/lib/.
+ * lib/compiler.c, lib/compiler.cc: New files, moved from gdb.base/
+ and gdb.c++/.
+
+ * gdb.c++/derivation.exp: remove redundant get compiler info code.
+
+ * gdb.base/commands.exp: add '$gdb_prompt $' anchor to
+ 'continue with watch' test point.
+
+1999-11-08 Jim Blandy <jimb@zenia.red-bean.com>
+
+ Merged from p2linux-990323-branch:
+
+ * lib/gdb.exp (gdb_continue_to_breakpoint): New function.
+
Mon Nov 8 23:07:09 1999 Andrew Cagney <cagney@amy.cygnus.com>
* gdb.base/remote.exp: Test ``set remote memory-write-packet-sized
diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp
index c9cea08..71491db 100644
--- a/gdb/testsuite/gdb.base/commands.exp
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -320,7 +320,7 @@ proc watchpoint_command_test {} {
}
send_gdb "continue\n"
gdb_expect {
- -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:57.*"\
+ -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:57.*$gdb_prompt $"\
{pass "continue with watch"}
-re "$gdb_prompt $"\
{fail "continue with watch"}
diff --git a/gdb/testsuite/gdb.c++/derivation.exp b/gdb/testsuite/gdb.c++/derivation.exp
index 031985a..3a4a307 100644
--- a/gdb/testsuite/gdb.c++/derivation.exp
+++ b/gdb/testsuite/gdb.c++/derivation.exp
@@ -60,21 +60,6 @@ gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
-remote_file build delete ${binfile}.ci
- if {![istarget "hppa*-*-hpux*"]} {
- if { [gdb_compile "${srcdir}/${subdir}/compiler.cc" "${binfile}.ci" preprocess ""] != ""
-} {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will auto
-matically fail."
- }
- } else {
- if { [gdb_preprocess "${srcdir}/${subdir}/compiler.cc" "${binfile}.ci" "c++"] != "" } {
- perror "Couldn't make ${binfile}.ci file"
- return 1;
- }
- }
-
-source ${binfile}.ci
#
# set it up at a breakpoint so we can play with the variable values
diff --git a/gdb/testsuite/lib/compiler.c b/gdb/testsuite/lib/compiler.c
new file mode 100644
index 0000000..8eb0d47
--- /dev/null
+++ b/gdb/testsuite/lib/compiler.c
@@ -0,0 +1,31 @@
+/* Often the behavior of any particular test depends upon what compiler was
+ used to compile the test. As each test is compiled, this file is
+ preprocessed by the same compiler used to compile that specific test
+ (different tests might be compiled by different compilers, particularly
+ if compiled at different times), and used to generate a *.ci (compiler
+ info) file for that test.
+
+ I.E., when callfuncs is compiled, a callfuncs.ci file will be generated,
+ which can then be sourced by callfuncs.exp to give callfuncs.exp access
+ to information about the compilation environment.
+
+ TODO: It might be a good idea to add expect code that tests each
+ definition made with 'set" to see if one already exists, and if so
+ warn about conflicts if it is being set to something else. */
+
+/* This needs to be kept in sync with whatis.c and gdb.exp(get_compiler_info).
+ If this ends up being hairy, we could use a common header file. */
+
+#if defined (__STDC__) || defined (_AIX)
+set signed_keyword_not_used 0
+#else
+set signed_keyword_not_used 1
+#endif
+
+#if defined (__GNUC__)
+set gcc_compiled __GNUC__
+#else
+set gcc_compiled 0
+#endif
+
+return 0
diff --git a/gdb/testsuite/lib/compiler.cc b/gdb/testsuite/lib/compiler.cc
new file mode 100644
index 0000000..aa35c75
--- /dev/null
+++ b/gdb/testsuite/lib/compiler.cc
@@ -0,0 +1,34 @@
+/* Often the behavior of any particular test depends upon what compiler was
+ used to compile the test. As each test is compiled, this file is
+ preprocessed by the same compiler used to compile that specific test
+ (different tests might be compiled by different compilers, particularly
+ if compiled at different times), and used to generate a *.ci (compiler
+ info) file for that test.
+
+ I.E., when callfuncs is compiled, a callfuncs.ci file will be generated,
+ which can then be sourced by callfuncs.exp to give callfuncs.exp access
+ to information about the compilation environment.
+
+ TODO: It might be a good idea to add expect code that tests each
+ definition made with 'set" to see if one already exists, and if so
+ warn about conflicts if it is being set to something else. */
+
+#if defined(__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 6
+set supports_template_debugging 1
+#else
+set supports_template_debugging 0
+#endif
+
+#if defined(__cplusplus)
+set supports_template_debugging 1
+#else
+set supports_template_debugging 0
+#endif
+
+#if defined (__GNUC__)
+set gcc_compiled __GNUC__
+#else
+set gcc_compiled 0
+#endif
+
+return 0
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 64ccaa9..a1a839a 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -335,6 +335,31 @@ proc runto_main { } {
}
+### Continue, and expect to hit a breakpoint.
+### Report a pass or fail, depending on whether it seems to have
+### worked. Use NAME as part of the test name; each call to
+### continue_to_breakpoint should use a NAME which is unique within
+### that test file.
+proc gdb_continue_to_breakpoint {name} {
+ global gdb_prompt
+ set full_name "continue to breakpoint: $name"
+
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Breakpoint .* at .*\r\n$gdb_prompt $" {
+ pass $full_name
+ }
+ -re ".*$gdb_prompt $" {
+ fail $full_name
+ }
+ timeout {
+ fail "$full_name (timeout)"
+ }
+ }
+}
+
+
+
# gdb_test COMMAND PATTERN MESSAGE -- send a command to gdb; test the result.
#
# COMMAND is the command to execute, send to GDB with send_gdb. If
@@ -901,13 +926,13 @@ proc get_compiler_info {binfile args} {
if {![istarget "hppa*-*-hpux*"]} {
if { [llength $args] > 0 } {
if {$args == "c++"} {
- if { [gdb_compile "${srcdir}/${subdir}/compiler.cc" "${binfile}.ci" preprocess {}] != "" } {
+ if { [gdb_compile "${srcdir}/lib/compiler.cc" "${binfile}.ci" preprocess {}] != "" } {
perror "Couldn't make ${binfile}.ci file"
return 1;
}
}
} else {
- if { [gdb_compile "${srcdir}/${subdir}/compiler.c" "${binfile}.ci" preprocess {}] != "" } {
+ if { [gdb_compile "${srcdir}/lib/compiler.c" "${binfile}.ci" preprocess {}] != "" } {
perror "Couldn't make ${binfile}.ci file"
return 1;
}
@@ -916,7 +941,7 @@ proc get_compiler_info {binfile args} {
if { [llength $args] > 0 } {
if {$args == "c++"} {
if { [eval gdb_preprocess \
- [list "${srcdir}/${subdir}/compiler.cc" "${binfile}.ci"] \
+ [list "${srcdir}/lib/compiler.cc" "${binfile}.ci"] \
$args] != "" } {
perror "Couldn't make ${binfile}.ci file"
return 1;
@@ -924,7 +949,7 @@ proc get_compiler_info {binfile args} {
}
} elseif { $args != "f77" } {
if { [eval gdb_preprocess \
- [list "${srcdir}/${subdir}/compiler.c" "${binfile}.ci"] \
+ [list "${srcdir}/lib/compiler.c" "${binfile}.ci"] \
$args] != "" } {
perror "Couldn't make ${binfile}.ci file"
return 1;