2005-04-08 12:57:00 +00:00
|
|
|
# This testcase is part of GDB, the GNU debugger.
|
|
|
|
|
2014-01-01 03:54:24 +00:00
|
|
|
# Copyright 2005-2014 Free Software Foundation, Inc.
|
2005-04-08 12:57:00 +00:00
|
|
|
|
|
|
|
# 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
|
2007-08-23 18:14:19 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
2005-04-08 12:57:00 +00:00
|
|
|
# (at your option) any later version.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
2005-04-08 12:57:00 +00:00
|
|
|
# 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.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
2005-04-08 12:57:00 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 18:14:19 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2005-04-08 12:57:00 +00:00
|
|
|
|
|
|
|
# Test the basic functionality of gdbserver.
|
|
|
|
|
|
|
|
load_lib gdbserver-support.exp
|
|
|
|
|
2012-06-25 19:46:26 +00:00
|
|
|
standard_testfile server.c
|
2005-04-08 12:57:00 +00:00
|
|
|
|
|
|
|
if { [skip_gdbserver_tests] } {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2012-06-25 19:46:26 +00:00
|
|
|
if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
|
2005-04-08 12:57:00 +00:00
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
gdb_start
|
2007-03-27 17:59:38 +00:00
|
|
|
gdb_load $binfile
|
2005-04-08 12:57:00 +00:00
|
|
|
|
2012-02-15 12:51:17 +00:00
|
|
|
# Make sure we're disconnected, in case we're testing with an
|
|
|
|
# extended-remote board, therefore already connected.
|
|
|
|
gdb_test "disconnect" ".*"
|
|
|
|
|
2007-03-27 17:59:38 +00:00
|
|
|
gdbserver_run ""
|
2005-04-08 12:57:00 +00:00
|
|
|
gdb_reinitialize_dir $srcdir/$subdir
|
|
|
|
|
2007-10-09 17:59:01 +00:00
|
|
|
# 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"
|
|
|
|
}
|
|
|
|
|
2005-04-08 12:57:00 +00:00
|
|
|
gdb_breakpoint main
|
|
|
|
gdb_test "continue" "Breakpoint.* main .*" "continue to main"
|