2012-01-04 09:17:56 +01:00
|
|
|
# Copyright 2005, 2007-2012 Free Software Foundation, Inc.
|
2005-02-09 20:58:23 +01: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 20:14:19 +02:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
2005-02-09 20:58:23 +01:00
|
|
|
# (at your option) any later version.
|
2007-08-23 20:14:19 +02:00
|
|
|
#
|
2005-02-09 20:58:23 +01: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 20:14:19 +02:00
|
|
|
#
|
2005-02-09 20:58:23 +01:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 20:14:19 +02:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2005-02-09 20:58:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
set testfile start
|
|
|
|
set srcfile ${testfile}.c
|
|
|
|
set binfile ${objdir}/${subdir}/${testfile}
|
|
|
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
|
|
|
untested "Couldn't compile test program"
|
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Get things started.
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
gdb_start
|
|
|
|
gdb_reinitialize_dir $srcdir/$subdir
|
|
|
|
gdb_load ${binfile}
|
|
|
|
|
2008-11-26 06:25:56 +01:00
|
|
|
# This is a testcase specifically for the `start' GDB command. For regular
|
|
|
|
# stop-in-main goal in the testcases consider using `runto_main' instead.
|
|
|
|
|
2005-02-09 20:58:23 +01:00
|
|
|
# For C programs, "start" should stop in main().
|
2007-03-27 19:59:38 +02:00
|
|
|
if { [gdb_start_cmd] < 0 } {
|
|
|
|
untested start
|
|
|
|
return -1
|
|
|
|
}
|
2005-02-09 20:58:23 +01:00
|
|
|
|
2007-03-27 19:59:38 +02:00
|
|
|
gdb_test "" \
|
2005-02-09 20:58:23 +01:00
|
|
|
"main \\(\\) at .*start.c.*" \
|
|
|
|
"start"
|