1 Test GCORE on 32bit inferiors on 64bit platforms.
3 UNSUPPORTED results are valid for `-m64' on 32bit targets.
6 Index: gdb-6.8/gdb/testsuite/gdb.base/gcore.exp
7 ===================================================================
8 --- gdb-6.8.orig/gdb/testsuite/gdb.base/gcore.exp 2008-01-01 23:53:19.000000000 +0100
9 +++ gdb-6.8/gdb/testsuite/gdb.base/gcore.exp 2008-07-14 10:28:05.000000000 +0200
10 @@ -30,9 +30,14 @@ set testfile "gcore"
11 set srcfile ${testfile}.c
12 set binfile ${objdir}/${subdir}/${testfile}
14 -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
17 +# `-static-libgcc' to avoid dependency on `libgcc.{i386,ppc}'.
18 +foreach additional_flags {{} {-m32 -static-libgcc} {-m64 -static-libgcc}} {
20 +set prefix "arch{$additional_flags}:"
22 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=$additional_flags]] != "" } {
23 + unsupported "${prefix} gcore.exp"
27 # Start with a fresh gdb.
28 @@ -47,23 +52,23 @@ send_gdb "help gcore\n"
30 -re "Undefined command: .gcore.*$gdb_prompt $" {
31 # gcore command not supported -- nothing to test here.
32 - unsupported "gdb does not support gcore on this target"
34 + unsupported "${prefix} gdb does not support gcore on this target"
37 -re "Save a core file .*$gdb_prompt $" {
39 + pass "${prefix} help gcore"
41 -re ".*$gdb_prompt $" {
43 + fail "${prefix} help gcore"
46 - fail "help gcore (timeout)"
47 + fail "${prefix} help gcore (timeout)"
51 if { ! [ runto_main ] } then {
54 + untested "${prefix} gcore.exp"
58 proc capture_command_output { command prefix } {
59 @@ -77,7 +82,7 @@ proc capture_command_output { command pr
60 set output_string $expect_out(1,string)
63 - fail "capture_command_output failed on $command."
64 + fail "${prefix} capture_command_output failed on $command."
68 @@ -109,22 +114,22 @@ set escapedfilename [string_to_regexp ${
71 gdb_test_multiple "gcore ${objdir}/${subdir}/gcore.test" \
73 + "${prefix} save a corefile" \
75 -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
76 - pass "save a corefile"
77 + pass "${prefix} save a corefile"
81 -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
82 - unsupported "save a corefile"
83 + unsupported "${prefix} save a corefile"
89 if {!$core_supported} {
94 # Now restart gdb and load the corefile.
95 @@ -136,31 +141,31 @@ gdb_load ${binfile}
96 send_gdb "core ${objdir}/${subdir}/gcore.test\n"
98 -re ".* is not a core dump:.*$gdb_prompt $" {
99 - fail "re-load generated corefile (bad file format)"
100 + fail "${prefix} re-load generated corefile (bad file format)"
101 # No use proceeding from here.
105 -re ".*: No such file or directory.*$gdb_prompt $" {
106 - fail "re-load generated corefile (file not found)"
107 + fail "${prefix} re-load generated corefile (file not found)"
108 # No use proceeding from here.
112 -re ".*Couldn't find .* registers in core file.*$gdb_prompt $" {
113 - fail "re-load generated corefile (incomplete note section)"
114 + fail "${prefix} re-load generated corefile (incomplete note section)"
116 -re "Core was generated by .*$gdb_prompt $" {
117 - pass "re-load generated corefile"
118 + pass "${prefix} re-load generated corefile"
120 -re ".*$gdb_prompt $" {
121 - fail "re-load generated corefile"
122 + fail "${prefix} re-load generated corefile"
125 - fail "re-load generated corefile (timeout)"
126 + fail "${prefix} re-load generated corefile (timeout)"
131 -gdb_expect_list "where in corefile" ".*$gdb_prompt $" {
132 +gdb_expect_list "${prefix} where in corefile" ".*$gdb_prompt $" {
133 ".*\[\r\n\]+#0 .* terminal_func \\(\\) at "
134 ".*\[\r\n\]+#1 .* array_func \\(\\) at "
135 ".*\[\r\n\]+#2 .* factorial_func \\(value=1\\) at "
136 @@ -174,61 +179,64 @@ gdb_expect_list "where in corefile" ".*$
138 set post_corefile_regs [capture_command_output "info registers" ""]
139 if ![string compare $pre_corefile_regs $post_corefile_regs] then {
140 - pass "corefile restored general registers"
141 + pass "${prefix} corefile restored general registers"
143 - fail "corefile restored general registers"
144 + fail "${prefix} corefile restored general registers"
147 set post_corefile_allregs [capture_command_output "info all-reg" ""]
148 if ![string compare $pre_corefile_allregs $post_corefile_allregs] then {
149 - pass "corefile restored all registers"
150 + pass "${prefix} corefile restored all registers"
152 - fail "corefile restored all registers"
153 + fail "${prefix} corefile restored all registers"
156 set post_corefile_extern_array \
157 [capture_command_output "print extern_array" "$print_prefix"]
158 if ![string compare $pre_corefile_extern_array $post_corefile_extern_array] {
159 - pass "corefile restored extern array"
160 + pass "${prefix} corefile restored extern array"
162 - fail "corefile restored extern array"
163 + fail "${prefix} corefile restored extern array"
166 set post_corefile_static_array \
167 [capture_command_output "print static_array" "$print_prefix"]
168 if ![string compare $pre_corefile_static_array $post_corefile_static_array] {
169 - pass "corefile restored static array"
170 + pass "${prefix} corefile restored static array"
172 - fail "corefile restored static array"
173 + fail "${prefix} corefile restored static array"
176 set post_corefile_uninit_array \
177 [capture_command_output "print un_initialized_array" "$print_prefix"]
178 if ![string compare $pre_corefile_uninit_array $post_corefile_uninit_array] {
179 - pass "corefile restored un-initialized array"
180 + pass "${prefix} corefile restored un-initialized array"
182 - fail "corefile restored un-initialized array"
183 + fail "${prefix} corefile restored un-initialized array"
186 set post_corefile_heap_string \
187 [capture_command_output "print heap_string" "$print_prefix"]
188 if ![string compare $pre_corefile_heap_string $post_corefile_heap_string] {
189 - pass "corefile restored heap array"
190 + pass "${prefix} corefile restored heap array"
192 - fail "corefile restored heap array"
193 + fail "${prefix} corefile restored heap array"
196 set post_corefile_local_array \
197 [capture_command_output "print array_func::local_array" "$print_prefix"]
198 if ![string compare $pre_corefile_local_array $post_corefile_local_array] {
199 - pass "corefile restored stack array"
200 + pass "${prefix} corefile restored stack array"
202 - fail "corefile restored stack array"
203 + fail "${prefix} corefile restored stack array"
206 set post_corefile_backtrace [capture_command_output "backtrace" ""]
207 if ![string compare $pre_corefile_backtrace $post_corefile_backtrace] {
208 - pass "corefile restored backtrace"
209 + pass "${prefix} corefile restored backtrace"
211 - fail "corefile restored backtrace"
212 + fail "${prefix} corefile restored backtrace"
215 +# $additional_flags: