URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/gnu-old/gdb-6.8/gdb/testsuite/gdb.server
- from Rev 157 to Rev 816
- ↔ Reverse comparison
Rev 157 → Rev 816
/Makefile.in
0,0 → 1,24
VPATH = @srcdir@ |
srcdir = @srcdir@ |
|
EXECUTABLES = |
|
MISCELLANEOUS = |
|
all info install-info dvi install uninstall installcheck check: |
@echo "Nothing to be done for $@..." |
|
clean mostlyclean: |
-find . -name '*.o' -print | xargs rm -f |
-find . -name '*.ali' -print | xargs rm -f |
-find . -name 'b~*.ad[sb]' -print | xargs rm -f |
-rm -f *~ a.out xgdb *.x *.ci *.tmp |
-rm -f *~ *.o a.out xgdb *.x *.ci *.tmp |
-rm -f core core.coremaker coremaker.core corefile $(EXECUTABLES) |
-rm -f $(MISCELLANEOUS) twice-tmp.c |
|
distclean maintainer-clean realclean: clean |
-rm -f *~ core |
-rm -f Makefile config.status config.log |
-rm -f *-init.exp |
-rm -fr *.log summary detail *.plog *.sum *.psum site.* |
/transfer.txt
0,0 → 1,12
This text file is a test input for GDB's file transfer commands. It |
contains some characters which need to be escaped in remote protocol |
packets, like "*" and "}" and "$" and "#". Actually, it contains |
a good sampling of printable characters: |
|
!"#$%&'()*+,-./0123456789:;<=>?@ |
ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` |
abcdefghijklmnopqrstuvwxyz{|}~ |
|
!"#$%&'()*+,-./0123456789:;<=>?@ |
ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` |
abcdefghijklmnopqrstuvwxyz{|}~ |
transfer.txt
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ext-attach.c
===================================================================
--- ext-attach.c (nonexistent)
+++ ext-attach.c (revision 816)
@@ -0,0 +1,31 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2007 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see . */
+
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. It loops for a while, but not forever. */
+
+#include
+
+int main ()
+{
+ int i;
+
+ for (i = 0; i < 120; i++)
+ sleep (1);
+
+ return 0;
+}
ext-attach.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: server-run.exp
===================================================================
--- server-run.exp (nonexistent)
+++ server-run.exp (revision 816)
@@ -0,0 +1,49 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2005, 2007, 2008 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+# Test the basic functionality of gdbserver.
+
+load_lib gdbserver-support.exp
+
+set testfile "server"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [skip_gdbserver_tests] } {
+ return 0
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_load $binfile
+
+gdbserver_run ""
+gdb_reinitialize_dir $srcdir/$subdir
+
+# We are now stopped at the program's entry point. On targets which use
+# SVR4 dynamic linking, we should have automatically loaded symbols for
+# the dynamic linker.
+if { [istarget *-*-linux*] } {
+ gdb_test "info shared" "From.*To.*" "loaded dynamic linker"
+}
+
+gdb_breakpoint main
+gdb_test "continue" "Breakpoint.* main .*" "continue to main"
Index: server.c
===================================================================
--- server.c (nonexistent)
+++ server.c (revision 816)
@@ -0,0 +1,22 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2005, 2007, 2008 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see . */
+
+int
+main (int argc, char **argv)
+{
+ return 0;
+}
server.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: server-mon.exp
===================================================================
--- server-mon.exp (nonexistent)
+++ server-mon.exp (revision 816)
@@ -0,0 +1,55 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2007, 2008 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+# Test gdbserver monitor commands.
+
+load_lib gdbserver-support.exp
+
+set testfile "server"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [skip_gdbserver_tests] } {
+ return 0
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_load $binfile
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdbserver_run ""
+
+gdb_test_multiple "monitor help" "" {
+ -re "Unknown monitor command.*$gdb_prompt $" {
+ fail "monitor help"
+ }
+ -re "The following monitor commands.*$gdb_prompt $" {
+ pass "monitor help"
+ }
+}
+
+gdb_test "monitor" "Unknown monitor command.*Protocol error.*"
+
+gdb_test "monitor set debug 1" "Debug output enabled\\."
+gdb_test "monitor set debug 0" "Debug output disabled\\."
+gdb_test "monitor set remote-debug 1" "Protocol debug output enabled\\."
+gdb_test "monitor set remote-debug 0" "Protocol debug output disabled\\."
Index: file-transfer.exp
===================================================================
--- file-transfer.exp (nonexistent)
+++ file-transfer.exp (revision 816)
@@ -0,0 +1,80 @@
+# This testcase is part of GDB, the GNU debugger.
+# Copyright 2007, 2008 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+# Test gdbserver monitor commands.
+
+load_lib gdbserver-support.exp
+
+set testfile "server"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [skip_gdbserver_tests] } {
+ return 0
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested file-transfer.exp
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_load $binfile
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdbserver_run ""
+
+proc test_file_transfer { filename description } {
+ gdb_test "remote put \"$filename\" down-server" \
+ "Successfully sent .*" "put $description"
+ gdb_test "remote get down-server up-server" \
+ "Successfully fetched .*" "get $description"
+
+ if { ![is_remote target] } {
+ # If we can check the target copy of the file, do that too.
+ # This should catch symmetric errors in upload and download.
+ set result [remote_exec host "cmp -s $filename down-server"]
+ if { [lindex $result 0] == 0 } {
+ pass "compare intermediate $description"
+ } else {
+ fail "compare intermediate $description"
+ }
+ }
+
+ set result [remote_exec host "cmp -s $filename up-server"]
+ if { [lindex $result 0] == 0 } {
+ pass "compare $description"
+ } else {
+ fail "compare $description"
+ }
+
+ gdb_test "remote delete down-server" \
+ "Successfully deleted .*" "deleted $description"
+
+ if { ![is_remote target] } {
+ if { ! [remote_file target exists down-server] } {
+ pass "verified deleted $description"
+ } else {
+ fail "verified deleted $description"
+ }
+ }
+
+ catch { file delete up-server }
+}
+
+test_file_transfer "$binfile" "binary file"
+test_file_transfer "$srcdir/$subdir/transfer.txt" "text file"
Index: ext-attach.exp
===================================================================
--- ext-attach.exp (nonexistent)
+++ ext-attach.exp (revision 816)
@@ -0,0 +1,77 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+# Test attaching to already-running programs using extended-remote.
+
+load_lib gdbserver-support.exp
+
+set testfile "ext-attach"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [skip_gdbserver_tests] } {
+ return 0
+}
+
+# On SPU, this test currently fails because "sleep" is not supported.
+if { [istarget "spu*-*-*"] } {
+ return 0
+}
+
+# We need to use TCL's exec to get the pid.
+if [is_remote target] then {
+ return 0
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested ext-attach.exp
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_load $binfile
+gdb_reinitialize_dir $srcdir/$subdir
+
+set target_exec [gdbserver_download]
+gdbserver_start_extended
+
+gdb_test "set remote exec-file $target_exec" "" "set remote exec-file"
+
+# Start the program running and then wait for a bit, to be sure
+# that it can be attached to.
+set testpid [eval exec $binfile &]
+exec sleep 2
+if { [istarget "*-*-cygwin*"] } {
+ # testpid is the Cygwin PID, GDB uses the Windows PID, which might be
+ # different due to the way fork/exec works.
+ set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
+}
+
+gdb_test "attach $testpid" "Attached to.*" \
+ "attach to remote program 1"
+gdb_test "backtrace" ".*main.*" "backtrace 1"
+
+gdb_test "detach" "Detached from remote process\\."
+gdb_test "backtrace" "No stack\\." "backtrace with no program"
+
+gdb_test "attach $testpid" "Attached to.*" \
+ "attach to remote program 2"
+gdb_test "backtrace" ".*main.*" "backtrace 2"
+
+gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
+gdb_test "monitor exit" ""
Index: ext-run.exp
===================================================================
--- ext-run.exp (nonexistent)
+++ ext-run.exp (revision 816)
@@ -0,0 +1,48 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+# Test running programs using extended-remote.
+
+load_lib gdbserver-support.exp
+
+set testfile "server"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [skip_gdbserver_tests] } {
+ return 0
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_load $binfile
+gdb_reinitialize_dir $srcdir/$subdir
+
+set target_exec [gdbserver_download]
+gdbserver_start_extended
+
+gdb_test "set remote exec-file $target_exec" "" "set remote exec-file"
+
+gdb_breakpoint main
+gdb_test "run" "Breakpoint.* main .*" "continue to main"
+
+gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
+gdb_test "monitor exit" ""