From patchwork Tue Jan 2 14:43:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 83146 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 2982C3858437 for ; Tue, 2 Jan 2024 14:43:54 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 398BE3858CDB for ; Tue, 2 Jan 2024 14:43:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 398BE3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 398BE3858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704206604; cv=none; b=JMJZExtG2bD4flbvIvJCc8AMmRvJJr9+V/0AYGUKpOzNLCh5+OUeMXDTftvRDwf1Ynd9z5DaSfEV7fSZcJNx5szx2j18NZRvGj3nby9rlFz0sHVjCQaGn8aqxmVaaLfVtc22A8ZzEbxpefHa64XPorSb4wU3wtlc8OjYL/Uo+IM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704206604; c=relaxed/simple; bh=/nyiyt9D7D3VNR5FNaM+fIgC5WFn2AGXrkbBAvf9fnY=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=tG2+upDDk/XArCsH+fpWecX50kgjSMw6Ud2oYT6nhZAXY09W4Bh52IY9hNmx85QVvjGpNDubLFoszl0Bk0VX4lOiN8/QF6CLKQey3dK5OU2d8iOzkuk5FvWpW2FGT2TD8DS4Px0GPRwpaedK7UC5Z9YkMccqZNpnTfHPx1dKj9Q= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704206602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9sBhik9sNaxnZqajcJHZu8yvFMlY+zbO4haFq2HA0So=; b=GZzNQo3oBcGk40ezpXNyfmD6gy3a0lWB9FoHGkq4mER47BA0LG96171sLxQ2Qj1U2FyEGN vgG1/P1Df3EmqQqBHhMyB5+E5DBmqMszNiwEt3KybU+xZPWx9EvvGVQcHw67FFYMKE8HkG PGYxw6nu/pSSPrGKruCs6cKL5d+XffA= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-455-eNoW20IaMmWX5s-Zga5jOw-1; Tue, 02 Jan 2024 09:43:21 -0500 X-MC-Unique: eNoW20IaMmWX5s-Zga5jOw-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-40d8586c709so22790025e9.1 for ; Tue, 02 Jan 2024 06:43:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704206600; x=1704811400; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9sBhik9sNaxnZqajcJHZu8yvFMlY+zbO4haFq2HA0So=; b=EPwrNNiRZOFiYQtzqO0crNE7+U1Sf5aSu9MIXervA6TgHcadOQBYYawIsNV6iS2yPt S7guIJvBnnjEeIyl3yrFU3xI3AUhKX//qaW2egDJhdDzwF4oFdKCLpWU+FD7s5rFzgC6 ZVu9ynII4gRW56QrdHlJYJjIwoKHeH5+BLACHxCkrzMM5T4Spj5WpCtaljuernkVAD7o dNzFqCaAtCuCY85WvdpzD4PsqAMp7OrAImag1yzWxblPUQeEubCQ0Io3nNQt5ZwiCLHM UGZ2jiZFc4w4nRx2ya2/b5yi+Cz3X5p2Sm6nAxCbTxCjrTEQDtk17g7B6NBhh1v+HCh7 lk7w== X-Gm-Message-State: AOJu0YyfR5UyP+grF6X5zMGjBWk/ZAqe06Gq82/KyH/ZaUS+zhvwsSrG ebzRfGqxyyxJ9QfvSdsuLpm9r+0Xxrx9SB7e0dp4ku5sRs4WM5Z639/0FjOGfLO3eZpmt/9xnEi ev9Of/6UNTHx7wZNksZAL5viv6/odTNALCWWd6hni17LDtrCkEe0ASFdd8vDqLEEQXIXKt+8FDF zIX2MwBA5gxyVkqQ== X-Received: by 2002:a05:600c:198a:b0:40d:5358:8d77 with SMTP id t10-20020a05600c198a00b0040d53588d77mr6745635wmq.80.1704206600132; Tue, 02 Jan 2024 06:43:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFW4rrUoQrFcFu8xmbjeDTCpjx+mrvmcnQJirUIGTaidcuBwGziWuDg1IOrMaxqSGu5Z80f7g== X-Received: by 2002:a05:600c:198a:b0:40d:5358:8d77 with SMTP id t10-20020a05600c198a00b0040d53588d77mr6745629wmq.80.1704206599721; Tue, 02 Jan 2024 06:43:19 -0800 (PST) Received: from localhost (185.223.159.143.dyn.plus.net. [143.159.223.185]) by smtp.gmail.com with ESMTPSA id fc16-20020a05600c525000b0040d4dc06f91sm37619350wmb.43.2024.01.02.06.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 06:43:19 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 1/3] gdb: don't try to style content in error calls Date: Tue, 2 Jan 2024 14:43:11 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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 While working on a later commit in this series I realised that the error() function doesn't support output styling. Due to the way that output from error() calls is passed around within the exception object and often combined with other output, it's not immediately obvious to me if we should be trying to support styling in this context or not. On inspection, I found two places in GDB where we apparently try to apply styling within the error() output, however, both of these places are in infrequently used (and likely untested) code. So, rather than try to implement styling in the error() output, right now I'm proposing to just remove these two attempts to style error() output. This doesn't mean that someone shouldn't add error() styling in the future, but right now, I'm not planning to do that, so I just wanted to fix these two mistakes as I saw them. --- gdb/procfs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gdb/procfs.c b/gdb/procfs.c index 1410bbc0d7d..0eafc2eddcc 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -605,10 +605,8 @@ static void proc_error (procinfo *pi, const char *func, int line) { int saved_errno = errno; - error ("procfs: %s line %d, %ps: %s", - func, line, styled_string (file_name_style.style (), - pi->pathname), - safe_strerror (saved_errno)); + error ("procfs: %s line %d, %s: %s", + func, line, pi->pathname, safe_strerror (saved_errno)); } /* Updates the status struct in the procinfo. There is a 'valid'