]>
Commit | Line | Data |
---|---|---|
3a58abaf AM |
1 | gdb/testsuite/gdb.base/fileio.c: |
2 | gdb/testsuite/gdb.base/fileio.exp: | |
3 | 2007-12-08 Jan Kratochvil <jan.kratochvil@redhat.com> | |
4 | ||
5 | * gdb.base/fileio.c (ROOTSUBDIR): New macro. | |
6 | (main): CHDIR into ROOTSUBDIR. CHOWN ROOTSUBDIR and CHDIR into | |
7 | ROOTSUBDIR if we are being run as root. | |
8 | * gdb.base/fileio.exp: Change the startup and finish cleanup. | |
9 | Change the test file reference to be into the `fileio.dir' directory. | |
10 | ||
11 | ||
12 | sources/gdb/testsuite/gdb.base/dump.exp: | |
13 | Found on RHEL-5.s390x. | |
14 | ||
15 | ||
16 | gdb-6.8.50.20090209/gdb/testsuite/gdb.base/auxv.exp: | |
17 | random FAIL: gdb.base/auxv.exp: matching auxv data from live and gcore | |
18 | ||
19 | ||
20 | gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp: | |
21 | frames-invalid can happen asynchronously. | |
22 | ||
23 | --- ./gdb/testsuite/gdb.base/fileio.c 13 Jun 2006 08:55:22 -0000 1.10 | |
24 | +++ ./gdb/testsuite/gdb.base/fileio.c 8 Dec 2007 16:04:10 -0000 | |
25 | @@ -58,6 +58,8 @@ system (const char * string); | |
26 | 1) Invalid string/command. - returns 127. */ | |
27 | static const char *strerrno (int err); | |
28 | ||
29 | +#define ROOTSUBDIR "fileio.dir" | |
30 | + | |
31 | #define FILENAME "foo.fileio.test" | |
32 | #define RENAMED "bar.fileio.test" | |
33 | #define NONEXISTANT "nofoo.fileio.test" | |
34 | @@ -542,6 +544,37 @@ strerrno (int err) | |
35 | int | |
36 | main () | |
37 | { | |
38 | + /* ROOTSUBDIR is already prepared by fileio.exp. We use it for easy cleanup | |
39 | + (by fileio.exp) if we are run by multiple users in the same directory. */ | |
40 | + | |
41 | + if (chdir (ROOTSUBDIR) != 0) | |
42 | + { | |
43 | + printf ("chdir " ROOTSUBDIR ": %s\n", strerror (errno)); | |
44 | + exit (1); | |
45 | + } | |
46 | + | |
47 | + /* These tests | |
48 | + Open for write but no write permission returns EACCES | |
49 | + Unlinking a file in a directory w/o write access returns EACCES | |
50 | + fail if we are being run as root - drop the privileges here. */ | |
51 | + | |
52 | + if (geteuid () == 0) | |
53 | + { | |
54 | + uid_t uid = 99; | |
55 | + | |
56 | + if (chown (".", uid, uid) != 0) | |
57 | + { | |
58 | + printf ("chown %d.%d " ROOTSUBDIR ": %s\n", (int) uid, (int) uid, | |
59 | + strerror (errno)); | |
60 | + exit (1); | |
61 | + } | |
62 | + if (setuid (uid) || geteuid () == 0) | |
63 | + { | |
64 | + printf ("setuid %d: %s\n", (int) uid, strerror (errno)); | |
65 | + exit (1); | |
66 | + } | |
67 | + } | |
68 | + | |
69 | /* Don't change the order of the calls. They partly depend on each other */ | |
70 | test_open (); | |
71 | test_write (); | |
72 | --- ./gdb/testsuite/gdb.base/fileio.exp 23 Aug 2007 18:14:16 -0000 1.12 | |
73 | +++ ./gdb/testsuite/gdb.base/fileio.exp 8 Dec 2007 16:04:10 -0000 | |
74 | @@ -46,8 +46,8 @@ if [get_compiler_info ${binfile}] { | |
75 | return -1; | |
76 | } | |
77 | ||
78 | -remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test} | |
79 | -remote_exec build {sh -xc rm\ -rf\ *.fileio.test} | |
80 | +remote_exec build {sh -xc rm\ -rf\ fileio.dir} | |
81 | +remote_exec build {sh -xc mkdir\ -m777\ fileio.dir} | |
82 | ||
83 | set oldtimeout $timeout | |
84 | set timeout [expr "$timeout + 60"] | |
85 | @@ -88,7 +88,7 @@ gdb_test continue \ | |
86 | "Opening nonexistant file returns ENOENT" | |
87 | ||
88 | send_gdb "continue\n" ; gdb_expect -re "$gdb_prompt $" | |
89 | -catch "system \"chmod -f -w nowrt.fileio.test\"" | |
90 | +catch "system \"chmod -f -w fileio.dir/nowrt.fileio.test\"" | |
91 | ||
92 | gdb_test continue \ | |
93 | "Continuing\\..*open 5:.*EACCES$stop_msg" \ | |
94 | @@ -252,8 +252,8 @@ gdb_test continue \ | |
95 | send_gdb "quit\n" | |
96 | send_gdb "y\n" | |
97 | ||
98 | -remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test} | |
99 | -remote_exec build {sh -xc rm\ -rf\ *.fileio.test} | |
100 | +remote_exec build {sh -xc test\ -r\ fileio.dir/dir2.fileio.test\ &&\ chmod\ -f\ +w\ fileio.dir/dir2.fileio.test} | |
101 | +remote_exec build {sh -xc rm\ -rf\ fileio.dir} | |
102 | ||
103 | set timeout $oldtimeout | |
104 | return 0 | |
105 | --- sources/gdb/testsuite/gdb.base/dump.exp-orig 2008-08-28 11:44:40.000000000 +0200 | |
106 | +++ sources/gdb/testsuite/gdb.base/dump.exp 2008-08-28 11:44:49.000000000 +0200 | |
107 | @@ -493,8 +493,10 @@ if ![string compare $is64bitonly "no"] t | |
108 | gdb_test "print zero_all ()" "" "" | |
109 | ||
110 | # restore with expressions | |
111 | + # Address may fit in int32 but its negative result would be 0xffffxxxx for | |
112 | + # 64-bit LONGEST addresses. | |
113 | test_restore_saved_value \ | |
114 | - "intarr3.srec ${array2_start}-${array_start} &intarray\[3\] &intarray\[4\]" \ | |
115 | + "intarr3.srec (long)${array2_start}-${array_start} &intarray\[3\] &intarray\[4\]" \ | |
116 | "array partial with expressions" 4 "intarray2\[3\]" | |
117 | ||
118 | gdb_test "print intarray2\[2\] == 0" " = 1" "element 2 not changed, == 4" | |
119 | --- gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp-orig 2009-02-09 16:31:11.000000000 +0100 | |
120 | +++ gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp 2009-02-09 21:27:38.000000000 +0100 | |
121 | @@ -286,7 +286,7 @@ if [target_info exists gdb,nosignals] { | |
122 | } else { | |
123 | send_gdb "signal SIGUSR1\n" | |
124 | gdb_expect { | |
125 | - -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${escapedsrcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ | |
126 | + -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n(\r\n\032\032frames-invalid\r\n)*\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${escapedsrcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ | |
127 | { pass "send SIGUSR1" } | |
128 | -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ | |
129 | { setup_xfail "*-*-*" 1270 | |
130 | --- ./gdb/testsuite/gdb.base/auxv.exp 2009-02-11 00:54:54.000000000 +0100 | |
131 | +++ ./gdb/testsuite/gdb.base/auxv.exp 2009-02-11 00:51:30.000000000 +0100 | |
132 | @@ -78,8 +78,10 @@ proc fetch_auxv {test} { | |
133 | ||
134 | set auxv_lines {} | |
135 | set bad -1 | |
136 | + # Former trailing `\[\r\n\]+' may eat just \r leaving \n in the buffer | |
137 | + # corrupting the next matches. | |
138 | if {[gdb_test_multiple "info auxv" $test { | |
139 | - -re "info auxv\[\r\n\]+" { | |
140 | + -re "info auxv\r\n" { | |
141 | exp_continue | |
142 | } | |
143 | -ex "The program has no auxiliary information now" { | |
144 | @@ -94,20 +96,20 @@ proc fetch_auxv {test} { | |
145 | set bad 1 | |
146 | exp_continue | |
147 | } | |
148 | - -re "^\[0-9\]+\[ \t\]+(AT_\[^ \t\]+)\[^\r\n\]+\[\r\n\]+" { | |
149 | + -re "^\[0-9\]+\[ \t\]+(AT_\[^ \t\]+)\[^\r\n\]+\r\n" { | |
150 | lappend auxv_lines $expect_out(0,string) | |
151 | exp_continue | |
152 | } | |
153 | - -re "^\[0-9\]+\[ \t\]+\\?\\?\\?\[^\r\n\]+\[\r\n\]+" { | |
154 | + -re "^\[0-9\]+\[ \t\]+\\?\\?\\?\[^\r\n\]+\r\n" { | |
155 | warning "Unrecognized tag value: $expect_out(0,string)" | |
156 | set bad 1 | |
157 | lappend auxv_lines $expect_out(0,string) | |
158 | exp_continue | |
159 | } | |
160 | - -re ".*$gdb_prompt $" { | |
161 | + -re "$gdb_prompt $" { | |
162 | incr bad | |
163 | } | |
164 | - -re "^\[^\r\n\]+\[\r\n\]+" { | |
165 | + -re "^\[^\r\n\]+\r\n" { | |
166 | if {!$bad} { | |
167 | warning "Unrecognized output: $expect_out(0,string)" | |
168 | set bad 1 | |
169 | --- ./gdb/testsuite/gdb.base/callfuncs.exp 2009-01-03 06:58:03.000000000 +0100 | |
170 | +++ ./gdb/testsuite/gdb.base/callfuncs.exp 2009-02-11 00:51:42.000000000 +0100 | |
171 | @@ -249,15 +249,17 @@ proc fetch_all_registers {test} { | |
172 | ||
173 | set all_registers_lines {} | |
174 | set bad -1 | |
175 | + # Former trailing `\[\r\n\]+' may eat just \r leaving \n in the buffer | |
176 | + # corrupting the next matches. | |
177 | if {[gdb_test_multiple "info all-registers" $test { | |
178 | - -re "info all-registers\[\r\n\]+" { | |
179 | + -re "info all-registers\r\n" { | |
180 | exp_continue | |
181 | } | |
182 | -ex "The program has no registers now" { | |
183 | set bad 1 | |
184 | exp_continue | |
185 | } | |
186 | - -re "^bspstore\[ \t\]+\[^\r\n\]+\[\r\n\]+" { | |
187 | + -re "^bspstore\[ \t\]+\[^\r\n\]+\r\n" { | |
188 | if [istarget "ia64-*-*"] { | |
189 | # Filter out bspstore which is specially tied to bsp, | |
190 | # giving spurious differences. | |
191 | @@ -266,14 +268,14 @@ proc fetch_all_registers {test} { | |
192 | } | |
193 | exp_continue | |
194 | } | |
195 | - -re "^\[^ \t\]+\[ \t\]+\[^\r\n\]+\[\r\n\]+" { | |
196 | + -re "^\[^ \t\]+\[ \t\]+\[^\r\n\]+\r\n" { | |
197 | lappend all_registers_lines $expect_out(0,string) | |
198 | exp_continue | |
199 | } | |
200 | - -re ".*$gdb_prompt $" { | |
201 | + -re "$gdb_prompt $" { | |
202 | incr bad | |
203 | } | |
204 | - -re "^\[^\r\n\]+\[\r\n\]+" { | |
205 | + -re "^\[^\r\n\]+\r\n" { | |
206 | if {!$bad} { | |
207 | warning "Unrecognized output: $expect_out(0,string)" | |
208 | set bad 1 |