From patchwork Tue May 14 13:57:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 90120 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 19DDA3875431 for ; Tue, 14 May 2024 13:57:35 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by sourceware.org (Postfix) with ESMTPS id 3A5973870C37 for ; Tue, 14 May 2024 13:57:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A5973870C37 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3A5973870C37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d32 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715695033; cv=none; b=Oxx6KLucTDi9u9lLPeuikXOXpn0WVKfFbYGj/TcV6q+saic9cSaCvvJpCERAeSyWp2447wF0nPt1SWRPaXGghQbbkNp9aMsRYrRTrSJPzx4lOMs8gXBu1yivzB2AVukya243rCiPGqywIVFkfCMEXSHKwd9aP7ZUdgcZhGBZ9Ps= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715695033; c=relaxed/simple; bh=DuCCL3ujaX3QWlWbM9nunWDPy0lthY8S5H9VFQgXmjA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=h+RzIZtUj1v6gPpdYQJ7omK6WO29KWk0rF4kYNy8x2l1NpU4haIDI15/02wct53GiJL6bp0IjbHk3At1USRhhV9nEVtrAN4niGoWseZ5Lqigbt6HotSxIJZ90OB7tjvJFx5s425ybobyX+mqXOtXMPgv/vtn/hQgFRY3q3qMNb8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-7e201db9f47so12274939f.3 for ; Tue, 14 May 2024 06:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1715695030; x=1716299830; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=f56MGuQOvR3EwWJQ8Cfq/yKd8/qUki1VI/z33GqYqP0=; b=gHXM693NA8vAzc/+PTHl1wElJJftn/Km/VxPN+nKeYMrW3FyF2DjVlSYHRnV3y6Pdb WEz5dC8JcTcoPQ+4dPosOtt5hPBoYT21ASMPsXBmhYP6/WHKA9C4WQlNroAagSqiGJW/ LFbP1jd3w+WmhW3WFGxwzvnMpbG/jPuHj9tKXwsIBuKG0/laJMxtSUQ3Yz9yBYlDhFoh QqPDu9LSWs92zcILQA7YeZJevijpWf1z+UcZliGiJLy6MVqAWUM63YZ2qxoW53m7ze+p tHQXOiDPSYYluE/BdPMIlbKIuIV1knfiJxGbDieoXehJNef2a+mCUWVDaYAySP5D6Pw7 sASA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715695030; x=1716299830; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f56MGuQOvR3EwWJQ8Cfq/yKd8/qUki1VI/z33GqYqP0=; b=KM82RWqn5Bmcd2XV2/AgqKIz/WpceaoQY5Icqs5gxASpUm8cWuv6wcRp3y7v09RnR9 aFa+MU/372HfEyndqNUkp7nZlyhu8oHNBWhtvpubnWRVlF075cZWkFqY8ea35iFSyiro h+jWId930E17lcCheySwIwI5bmoU9QlZ6KUEmkVJ1tXm2Ve/xoCWQNtKAQIWd66Zmbw3 tamQ0i0FWZNOxhL3xnFQ9HwIB0BMeb64pv+avRZeLpEJeAvr5rPY7GCPls9QYT77Ez3E GwUcgRdgt4HVysHr3wqghgfI56BV+PVKhNcuiIO6iLSdROLBTBdzKXp/kQwaeviy8P/N ZePA== X-Gm-Message-State: AOJu0YwKPN6L6MiymkltvKjlmOfEwwJhDvhlO/4+1HNPJb6ceiQP1U4O sLD6UOMeR174GL6Vkpr7IeGjbsJMSHSfccCnyR8meHfFKHgGFCTtRPuB95VRygkoItyJZne3Fdc = X-Google-Smtp-Source: AGHT+IHf55MUkw9abUBDaEqRmEW6L3uaw045XNKXY4Y7CVd65qIE/0dC93r3OGBjhyFbFMtB63yHnA== X-Received: by 2002:a05:6e02:12ce:b0:36d:b36e:3c6d with SMTP id e9e14a558f8ab-36db36e4345mr6194615ab.10.1715695030149; Tue, 14 May 2024 06:57:10 -0700 (PDT) Received: from localhost.localdomain (75-166-134-4.hlrn.qwest.net. [75.166.134.4]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-36da7d75547sm5816435ab.70.2024.05.14.06.57.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 06:57:09 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Remove gdb_stdtargerr Date: Tue, 14 May 2024 07:57:00 -0600 Message-ID: <20240514135700.3737770-1-tromey@adacore.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org This patch removes gdb_stdtargerr. There doesn't seem to be a need for this -- it is always the same as stdtarg, and (I believe) has been for many years. --- gdb/cli/cli-interp.c | 3 --- gdb/cli/cli-interp.h | 1 - gdb/interps.c | 1 - gdb/main.c | 2 -- gdb/mi/mi-interp.c | 2 -- gdb/remote-fileio.c | 2 +- gdb/remote-sim.c | 4 ++-- gdb/top.c | 2 -- gdb/tui/tui-io.c | 2 -- gdb/ui-out.c | 3 --- gdb/ui-out.h | 1 - gdb/utils.h | 1 - 12 files changed, 3 insertions(+), 21 deletions(-) diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index 7cefc3902d8..a488c304fea 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -273,7 +273,6 @@ cli_interp_base::set_logging (ui_file_up logfile, bool logging_redirect, m_saved_output->err = gdb_stderr; m_saved_output->log = gdb_stdlog; m_saved_output->targ = gdb_stdtarg; - m_saved_output->targerr = gdb_stdtargerr; ui_file *logfile_p = logfile.get (); m_saved_output->logfile_holder = std::move (logfile); @@ -299,7 +298,6 @@ cli_interp_base::set_logging (ui_file_up logfile, bool logging_redirect, gdb_stdlog = m_saved_output->stdlog_holder.get (); gdb_stderr = new_stderr; gdb_stdtarg = new_stderr; - gdb_stdtargerr = new_stderr; } else { @@ -307,7 +305,6 @@ cli_interp_base::set_logging (ui_file_up logfile, bool logging_redirect, gdb_stderr = m_saved_output->err; gdb_stdlog = m_saved_output->log; gdb_stdtarg = m_saved_output->targ; - gdb_stdtargerr = m_saved_output->targerr; m_saved_output.reset (nullptr); } diff --git a/gdb/cli/cli-interp.h b/gdb/cli/cli-interp.h index 137eb466f6b..03b592fdf9c 100644 --- a/gdb/cli/cli-interp.h +++ b/gdb/cli/cli-interp.h @@ -50,7 +50,6 @@ class cli_interp_base : public interp ui_file *err; ui_file *log; ui_file *targ; - ui_file *targerr; /* When redirecting, some or all of these may be non-null depending on the logging mode. */ ui_file_up stdout_holder; diff --git a/gdb/interps.c b/gdb/interps.c index 94a982e97ab..76561a350c1 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -293,7 +293,6 @@ interpreter_exec_cmd (const char *args, int from_tty) scoped_restore save_stderr = make_scoped_restore (&gdb_stderr); scoped_restore save_stdlog = make_scoped_restore (&gdb_stdlog); scoped_restore save_stdtarg = make_scoped_restore (&gdb_stdtarg); - scoped_restore save_stdtargerr = make_scoped_restore (&gdb_stdtargerr); if (args == NULL) error_no_arg (_("interpreter-exec command")); diff --git a/gdb/main.c b/gdb/main.c index 8b81640e8d2..a79a59102e1 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -79,7 +79,6 @@ std::string python_libdir; /* Target IO streams. */ struct ui_file *gdb_stdtargin; struct ui_file *gdb_stdtarg; -struct ui_file *gdb_stdtargerr; /* True if --batch or --batch-silent was seen. */ int batch_flag = 0; @@ -679,7 +678,6 @@ captured_main_1 (struct captured_main_args *context) current_ui = main_ui; gdb_stdtarg = gdb_stderr; - gdb_stdtargerr = gdb_stderr; gdb_stdtargin = gdb_stdin; /* Put a CLI based uiout in place early. If the early initialization diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index 07e036f5ff9..168e6ed10b4 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -132,8 +132,6 @@ mi_interp::resume () gdb_stdlog = mi->log; /* Route target output through the MI. */ gdb_stdtarg = mi->targ; - /* Route target error through the MI as well. */ - gdb_stdtargerr = mi->targ; deprecated_show_load_progress = mi_load_progress; } diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index b15824637a9..11cf2bb16fa 100644 --- a/gdb/remote-fileio.c +++ b/gdb/remote-fileio.c @@ -641,7 +641,7 @@ remote_fileio_func_write (remote_target *remote, char *buf) return; case FIO_FD_CONSOLE_OUT: { - ui_file *file = target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr; + ui_file *file = gdb_stdtarg; file->write ((char *) buffer, length); file->flush (); ret = length; diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 38d7f5b7c0f..f92de619889 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -380,7 +380,7 @@ gdb_os_write_stderr (host_callback *p, const char *buf, int len) { b[0] = buf[i]; b[1] = 0; - gdb_stdtargerr->puts (b); + gdb_stdtarg->puts (b); } return len; } @@ -390,7 +390,7 @@ gdb_os_write_stderr (host_callback *p, const char *buf, int len) static void gdb_os_flush_stderr (host_callback *p) { - gdb_stdtargerr->flush (); + gdb_stdtarg->flush (); } /* GDB version of gdb_printf callback. */ diff --git a/gdb/top.c b/gdb/top.c index b93ef0a69b5..b5e77ef6b05 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -620,8 +620,6 @@ execute_fn_to_ui_file (struct ui_file *file, std::function fn) = make_scoped_restore (&gdb_stdlog, file); scoped_restore save_stdtarg = make_scoped_restore (&gdb_stdtarg, file); - scoped_restore save_stdtargerr - = make_scoped_restore (&gdb_stdtargerr, file); fn (); } diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 2673397cc46..285c781c25d 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -839,7 +839,6 @@ tui_setup_io (int mode) gdb_stderr = tui_stderr; gdb_stdlog = tui_stdlog; gdb_stdtarg = gdb_stderr; - gdb_stdtargerr = gdb_stderr; current_uiout = tui_out; /* Save tty for SIGCONT. */ @@ -852,7 +851,6 @@ tui_setup_io (int mode) gdb_stderr = tui_old_stderr; gdb_stdlog = tui_old_stdlog; gdb_stdtarg = gdb_stderr; - gdb_stdtargerr = gdb_stderr; current_uiout = tui_old_uiout; /* Restore readline. */ diff --git a/gdb/ui-out.c b/gdb/ui-out.c index b3a2fb7f4e5..a692f0a45fe 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -943,14 +943,12 @@ buffered_streams::buffered_streams (buffer_group *group, ui_out *uiout) m_buffered_stderr (group, gdb_stderr), m_buffered_stdlog (group, gdb_stdlog), m_buffered_stdtarg (group, gdb_stdtarg), - m_buffered_stdtargerr (group, gdb_stdtargerr), m_uiout (uiout) { gdb_stdout = &m_buffered_stdout; gdb_stderr = &m_buffered_stderr; gdb_stdlog = &m_buffered_stdlog; gdb_stdtarg = &m_buffered_stdtarg; - gdb_stdtargerr = &m_buffered_stdtargerr; ui_file *stream = current_uiout->current_stream (); if (stream != nullptr) @@ -983,7 +981,6 @@ buffered_streams::remove_buffers () gdb_stderr = m_buffered_stderr.stream (); gdb_stdlog = m_buffered_stdlog.stream (); gdb_stdtarg = m_buffered_stdtarg.stream (); - gdb_stdtargerr = m_buffered_stdtargerr.stream (); if (m_buffered_current_uiout.has_value ()) current_uiout->redirect (nullptr); diff --git a/gdb/ui-out.h b/gdb/ui-out.h index 5b6ddd55063..3d5e8e49ada 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -642,7 +642,6 @@ struct buffered_streams buffering_file m_buffered_stderr; buffering_file m_buffered_stdlog; buffering_file m_buffered_stdtarg; - buffering_file m_buffered_stdtargerr; /* Buffer for current_uiout's output stream. */ std::optional m_buffered_current_uiout; diff --git a/gdb/utils.h b/gdb/utils.h index f0189c7d723..66eec9621fd 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -194,7 +194,6 @@ extern void gdb_flush (struct ui_file *stream); /* Target output that should bypass the pager, if one is in use. */ extern struct ui_file *gdb_stdtarg; -extern struct ui_file *gdb_stdtargerr; extern struct ui_file *gdb_stdtargin; /* Set the screen dimensions to WIDTH and HEIGHT. */