This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v2 01/17] fix up log-file toggling
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Fri, 18 Oct 2013 14:49:18 -0600
- Subject: [PATCH v2 01/17] fix up log-file toggling
- Authentication-results: sourceware.org; auth=none
- References: <1382129374-18344-1-git-send-email-tromey at redhat dot com>
Currently a proc in gdb.exp toggles the expect (and thus dejagnu)
logging. This is not a super idea, but it is there to avoid putting
some preprocessor output into the log.
In the right circumstances, this can result in the log file being
mysteriously truncated. I think this happens because it doesn't
necessarily write to the correct log file again.
The fix is to use "log_file -info" to save the previous log file.
* lib/gdb.exp (get_compiler_info): Use log_file -info and
restore from that.
---
gdb/testsuite/lib/gdb.exp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 44786ec..fbb9f71 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2406,6 +2406,7 @@ proc get_compiler_info {{arg ""}} {
# Run $ifile through the right preprocessor.
# Toggle gdb.log to keep the compiler output out of the log.
+ set saved_log [log_file -info]
log_file
if [is_remote host] {
# We have to use -E and -o together, despite the comments
@@ -2418,7 +2419,7 @@ proc get_compiler_info {{arg ""}} {
} else {
set cppout [ gdb_compile "${ifile}" "" preprocess [list "$arg" quiet] ]
}
- log_file -a "$outdir/$tool.log"
+ eval log_file $saved_log
# Eval the output.
set unknown 0
--
1.8.1.4