From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id CF0D33858D37; Wed, 30 Nov 2022 14:36:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF0D33858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669818981; bh=5eVDfV8FPPpUtKz+AobgksGZx18YSGSUVo+48NDX08I=; h=From:To:Subject:Date:From; b=els98XRKFhece5gmb9l0i8CHR2Ce9JveWApyBvF9i+3jXCB4JhVxuSIaLDpbllBNj /utGapjamf0UuI3Bho8Pnfjp6YnGctjwWP2kGJ3EV7wtQ3hp5ax1aTXNrJijOT6f9K u4cjcMKchwahKW3OH463N47szprXtx0/KPdfLLJE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Rename fields of cli_interp_base::saved_output_files X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: aaa79cd62b873be672e3163eb267513c97ec4399 X-Git-Newrev: 35254615ab38c37cf934b28982691f458d4c9948 Message-Id: <20221130143621.CF0D33858D37@sourceware.org> Date: Wed, 30 Nov 2022 14:36:21 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D35254615ab38= c37cf934b28982691f458d4c9948 commit 35254615ab38c37cf934b28982691f458d4c9948 Author: Tom Tromey Date: Mon Nov 28 14:01:35 2022 -0700 Rename fields of cli_interp_base::saved_output_files =20 This renames the fields of cli_interp_base::saved_output_files, as requested by Simon. I tried to choose names that more obviously reflect what the field is used for. I also added a couple of comments. =20 Approved-By: Simon Marchi Diff: --- gdb/cli/cli-interp.c | 14 +++++++------- gdb/cli/cli-interp.h | 11 +++++++---- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index 3254efc3581..dbe46402c2b 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -387,7 +387,7 @@ cli_interp_base::set_logging (ui_file_up logfile, bool = logging_redirect, m_saved_output->targerr =3D gdb_stdtargerr; =20 ui_file *logfile_p =3D logfile.get (); - m_saved_output->file_to_delete =3D std::move (logfile); + m_saved_output->logfile_holder =3D std::move (logfile); =20 /* The new stdout and stderr only depend on whether logging redirection is being done. */ @@ -395,19 +395,19 @@ cli_interp_base::set_logging (ui_file_up logfile, boo= l logging_redirect, ui_file *new_stderr =3D logfile_p; if (!logging_redirect) { - m_saved_output->tee_to_delete.reset + m_saved_output->stdout_holder.reset (new tee_file (gdb_stdout, logfile_p)); - new_stdout =3D m_saved_output->tee_to_delete.get (); - m_saved_output->stderr_to_delete.reset + new_stdout =3D m_saved_output->stdout_holder.get (); + m_saved_output->stderr_holder.reset (new tee_file (gdb_stderr, logfile_p)); - new_stderr =3D m_saved_output->stderr_to_delete.get (); + new_stderr =3D m_saved_output->stderr_holder.get (); } =20 - m_saved_output->log_to_delete.reset + m_saved_output->stdlog_holder.reset (new timestamped_file (debug_redirect ? logfile_p : new_stderr)); =20 gdb_stdout =3D new_stdout; - gdb_stdlog =3D m_saved_output->log_to_delete.get (); + gdb_stdlog =3D m_saved_output->stdlog_holder.get (); gdb_stderr =3D new_stderr; gdb_stdtarg =3D new_stderr; gdb_stdtargerr =3D new_stderr; diff --git a/gdb/cli/cli-interp.h b/gdb/cli/cli-interp.h index 978e7f291e4..ad2167e0e1f 100644 --- a/gdb/cli/cli-interp.h +++ b/gdb/cli/cli-interp.h @@ -36,15 +36,18 @@ public: private: struct saved_output_files { + /* Saved gdb_stdout, gdb_stderr, etc. */ ui_file *out; ui_file *err; ui_file *log; ui_file *targ; ui_file *targerr; - ui_file_up tee_to_delete; - ui_file_up stderr_to_delete; - ui_file_up file_to_delete; - ui_file_up log_to_delete; + /* When redirecting, some or all of these may be non-null + depending on the logging mode. */ + ui_file_up stdout_holder; + ui_file_up stderr_holder; + ui_file_up stdlog_holder; + ui_file_up logfile_holder; }; =20 /* These hold the pushed copies of the gdb output files. If NULL