* lib/gdb.exp (get_compiler_info): Use -E -o in remote-host case.

This commit is contained in:
Joseph Myers 2009-04-22 19:46:19 +00:00
parent 167bdac1e9
commit e7f86de9ac
2 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2009-04-22 Joseph Myers <joseph@codesourcery.com>
* lib/gdb.exp (get_compiler_info): Use -E -o in remote-host case.
2009-04-15 Tom Tromey <tromey@redhat.com>
* gdb.base/charset.exp: Add regression test.

View File

@ -1539,7 +1539,17 @@ proc get_compiler_info {binfile args} {
# Run $ifile through the right preprocessor.
# Toggle gdb.log to keep the compiler output out of the log.
log_file
set cppout [ gdb_compile "${ifile}" "" preprocess [list "$args" quiet] ]
if [is_remote host] {
# We have to use -E and -o together, despite the comments
# above, because of how DejaGnu handles remote host testing.
set ppout "$outdir/compiler.i"
gdb_compile "${ifile}" "$ppout" preprocess [list "$args" quiet]
set file [open $ppout r]
set cppout [read $file]
close $file
} else {
set cppout [ gdb_compile "${ifile}" "" preprocess [list "$args" quiet] ]
}
log_file -a "$outdir/$tool.log"
# Eval the output.