]>
Commit | Line | Data |
---|---|---|
3a58abaf AM |
1 | 2005-01-25 Elena Zannoni <ezannoni@redhat.com> |
2 | ||
3 | * gdb.base/move-dir.exp: New test. | |
4 | * gdb.base/move-dir.c: Ditto. | |
5 | * gdb.base/move-dir.h: Ditto. | |
6 | ||
7 | Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c | |
8 | =================================================================== | |
9 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
10 | +++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c 2008-12-07 23:57:41.000000000 +0100 | |
11 | @@ -0,0 +1,10 @@ | |
12 | +#include <stdio.h> | |
13 | +#include <stdlib.h> | |
14 | +#include "move-dir.h" | |
15 | + | |
16 | +int main() { | |
17 | + const char* hw = "hello world."; | |
18 | + printf ("%s\n", hw);; | |
19 | + other(); | |
20 | +} | |
21 | + | |
22 | Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp | |
23 | =================================================================== | |
24 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
25 | +++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp 2008-12-07 10:13:01.000000000 +0100 | |
26 | @@ -0,0 +1,67 @@ | |
27 | +# Copyright 2005 | |
28 | +# Free Software Foundation, Inc. | |
29 | + | |
30 | +# This program is free software; you can redistribute it and/or modify | |
31 | +# it under the terms of the GNU General Public License as published by | |
32 | +# the Free Software Foundation; either version 2 of the License, or | |
33 | +# (at your option) any later version. | |
34 | +# | |
35 | +# This program is distributed in the hope that it will be useful, | |
36 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
37 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
38 | +# GNU General Public License for more details. | |
39 | +# | |
40 | +# You should have received a copy of the GNU General Public License | |
41 | +# along with this program; if not, write to the Free Software | |
42 | +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
43 | + | |
44 | +# Please email any bugs, comments, and/or additions to this file to: | |
45 | +# bug-gdb@prep.ai.mit.edu | |
46 | + | |
47 | +if $tracelevel then { | |
48 | + strace $tracelevel | |
49 | +} | |
50 | + | |
51 | +set prms_id 0 | |
52 | +set bug_id 0 | |
53 | + | |
54 | +set testfile "move-dir" | |
55 | +set srcfile ${testfile}.c | |
56 | +set incfile ${testfile}.h | |
57 | +set binfile ${objdir}/${subdir}/${testfile} | |
58 | + | |
59 | +set testdir "${objdir}/${subdir}/incdir" | |
60 | + | |
61 | +remote_exec build "mkdir $testdir" | |
62 | +remote_exec build "cp ${srcdir}/${subdir}/${srcfile} ${objdir}/${subdir}" | |
63 | +remote_exec build "cp ${srcdir}/${subdir}/${incfile} ${testdir}" | |
64 | + | |
65 | +set additional_flags "additional_flags=-I${subdir}/incdir" | |
66 | + | |
67 | +if { [gdb_compile "${objdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } { | |
68 | + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." | |
69 | +} | |
70 | + | |
71 | +# Create and source the file that provides information about the compiler | |
72 | +# used to compile the test case. | |
73 | + | |
74 | +if [get_compiler_info ${binfile}] { | |
75 | + return -1; | |
76 | +} | |
77 | + | |
78 | + | |
79 | +set oldtimeout $timeout | |
80 | +set timeout [expr "$timeout + 60"] | |
81 | + | |
82 | +# Start with a fresh gdb. | |
83 | + | |
84 | +gdb_exit | |
85 | +gdb_start | |
86 | +gdb_test "cd ../.." "" "" | |
87 | +gdb_load ${binfile} | |
88 | +gdb_test "list main" ".*hw.*other.*" "found main" | |
89 | +gdb_test "list other" ".*ostring.*" "found include file" | |
90 | + | |
91 | + | |
92 | +set timeout $oldtimeout | |
93 | +return 0 | |
94 | Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.h | |
95 | =================================================================== | |
96 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
97 | +++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.h 2008-12-07 10:13:01.000000000 +0100 | |
98 | @@ -0,0 +1,7 @@ | |
99 | +#include <stdlib.h> | |
100 | + | |
101 | +void other() { | |
102 | + const char* ostring = "other"; | |
103 | + printf ("%s\n", ostring);; | |
104 | +} | |
105 | + |