1*b725ae77Skettenis#   Copyright 1997, 1999 Free Software Foundation, Inc.
2*b725ae77Skettenis
3*b725ae77Skettenis# This program is free software; you can redistribute it and/or modify
4*b725ae77Skettenis# it under the terms of the GNU General Public License as published by
5*b725ae77Skettenis# the Free Software Foundation; either version 2 of the License, or
6*b725ae77Skettenis# (at your option) any later version.
7*b725ae77Skettenis#
8*b725ae77Skettenis# This program is distributed in the hope that it will be useful,
9*b725ae77Skettenis# but WITHOUT ANY WARRANTY; without even the implied warranty of
10*b725ae77Skettenis# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11*b725ae77Skettenis# GNU General Public License for more details.
12*b725ae77Skettenis#
13*b725ae77Skettenis# You should have received a copy of the GNU General Public License
14*b725ae77Skettenis# along with this program; if not, write to the Free Software
15*b725ae77Skettenis# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16*b725ae77Skettenis
17*b725ae77Skettenis# Please email any bugs, comments, and/or additions to this file to:
18*b725ae77Skettenis# bug-gdb@prep.ai.mit.edu
19*b725ae77Skettenis
20e93f7393Sniklasif $tracelevel then {
21e93f7393Sniklas	strace $tracelevel
22e93f7393Sniklas}
23e93f7393Sniklas
24e93f7393Sniklasset prms_id 0
25e93f7393Sniklasset bug_id 0
26e93f7393Sniklas
27e93f7393Sniklasset testfile twice-tmp
28e93f7393Sniklasset srcfile ${testfile}.c
29e93f7393Sniklasset binfile ${objdir}/${subdir}/${testfile}
30*b725ae77Skettenisset options debug
31*b725ae77Skettenislappend options "additional_flags=-I."
32e93f7393Sniklas
33*b725ae77Skettenisset fileid [open ${objdir}/${subdir}/${srcfile} w];
34*b725ae77Skettenisputs $fileid "#include \"twice.c\"";
35*b725ae77Skettenisclose $fileid;
36*b725ae77Skettenis
37*b725ae77Skettenisremote_download host ${srcdir}/${subdir}/twice.c twice.c
38*b725ae77Skettenis
39*b725ae77Skettenisif  { [gdb_compile "${objdir}/${subdir}/${srcfile}" "${binfile}" executable $options] != "" } {
40*b725ae77Skettenis     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
41e93f7393Sniklas}
42e93f7393Sniklas
43e93f7393Sniklas# Start with a fresh gdb.
44e93f7393Sniklas
45e93f7393Sniklasgdb_exit
46e93f7393Sniklasgdb_start
47e93f7393Sniklasgdb_reinitialize_dir $srcdir/$subdir
48e93f7393Sniklasgdb_load $binfile
49e93f7393Sniklas
50e93f7393Sniklasif [runto_main] then {
51e93f7393Sniklas    # Test that GDB can still detect whether we have line numbers
52e93f7393Sniklas    # even if we're executing code in an include file.
53e93f7393Sniklas
54e93f7393Sniklas    # The bug was fixed by
55e93f7393Sniklas    #Tue Jun 29 11:02:58 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
56e93f7393Sniklas    #
57e93f7393Sniklas    #	* infrun.c (wait_for_inferior): Use find_pc_line not
58e93f7393Sniklas    #	find_pc_symtab to check whether there is line number
59e93f7393Sniklas    #	information.
60e93f7393Sniklas
61e93f7393Sniklas    gdb_test "step" "nothing \\(\\) at.*"
62e93f7393Sniklas}
63*b725ae77Skettenisremote_exec build "rm -f twice.c"
64e93f7393Sniklasreturn 0
65