From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by sourceware.org (Postfix) with ESMTPS id 31C42385842F for ; Wed, 3 Jan 2024 19:50:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31C42385842F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 31C42385842F Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=96.47.72.81 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1704311452; cv=pass; b=skFk3/itLzBSQadWzPct5MUsHtvvy1D1DqRVPM3+EErbA2S+jA+tGqdcbCeGsReKBksVj1DNKevLXCsOa0/JlDcpfW8TA/SXq7bcMmUz4rtKXaLUbE9NDykW3WF3qn97djLvsB/yBQ3ooXP8beBorsRV3iDm0gQTKdHZ5MjxgtQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1704311452; c=relaxed/simple; bh=OL16PHHihzjOAU4zj/9YwcdYpMha9vILy2WUv0l2ZZQ=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=DgpocoFhJ36VTLT5ozVOxS1IhlmccV/m7E0jq3u5KGTrs05ZOFivnM7LJA+vvi+JWFIkKFwEGhvVbfjtgDptPzeoCfmDw1G3JrxP26jintoaKPyHYcVVN9LT0J/lMfIlvllkLvSmnrZuVAObUUx1cvtgd+ze0/0FXA+djjYufSA= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4T50hB3jfqz3rL5; Wed, 3 Jan 2024 19:50:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T50hB24qpz4Jgl; Wed, 3 Jan 2024 19:50:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704311450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2j75LUhuMW1zxAmV3DGB5qENeCErJ8tmaaClBUOp0lo=; b=IFPJgesNcWCNWqHX8FiRjr41212QwDMghE4MYIm9DWl79LeXJfioYFRxX/jS9QbfG0h51c YHnqb+HS2avXaw/yOVzUPVvll9YLBkbven6XcXFQ77fbgPPbd66cwEi6VcZbEg3BuXe4Q7 r5dLvsyOL0qiF6z71mkrVFK3pIduZXFsQnqb6jX6nU29ccUYL/4+QB/UoyaA+3R74eWyCo KgY0wz/xdceTc/VauroY2hApxsDvzw2W7gdG/sXTLf8Hf/Z77k+5mEQCFVKmRQ/khP1Ld2 2mbqsAdbuc5f4V1xos42LUMOzU2yvU+2kHeIrZ5rqMQvQHstcPTn8XUSmRyWPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704311450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2j75LUhuMW1zxAmV3DGB5qENeCErJ8tmaaClBUOp0lo=; b=niumxl82dONo/hfxWM3OMzLpQhmfFIMphGtgG4M5vOdfk0slwJJhn9pWd7CGojKR7Us6sh aWM7ml124qobGNOic6mHF1oLQYYuZ+0dTu+f+vi81qZEPeT0nOfP7SdVLM9QYhGeBkGXuW WFC16AuDp2OZOt/gPTNsgph4/GBJQ8y1ZWgxMe+dkB/IxRVp7AJuxKM733gWwEPZEGO5Lq nDht6BfpieBCnJ31SVlN6SEyaIWLF9z16W95YkjkiD2eJMNy6TAaXoR3hq2f4lhcwM9bvu 92HWl3YXz/HWeFrRD6J2t+W+4+rgboE1rR1OvjeaSTcU+bOFvLbs38QN6TW2qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704311450; a=rsa-sha256; cv=none; b=luMB1fFuDGSOHM0YbqfULgZxCpCra4wgGZ3bP2b65MtnGCpI2pULUwITdkQ+f78sGvPVST bIHQF9Vs8whj6+MtV0wxYznvSk/7crg0TsWcKkNW723KVyiXnpeaMyAmuYRZ7rbb84iH9P /ZVd+MCKxcnxZeMoTpLYxN8G9IodrSnxRr2cDOeZJhosWrwZ3mOLAQ2bmxiZNcUSjYj/PR 1F8vzuP24268STAV3GkS2yU1/0K9s8DpYlcVTm/a5L5gzscCWezS8CD69B5gRj5Zkt7qbX WFz4pNdtu4UNFu/bE1389pbctzB48U2GINQZyWF0OVnkvDwIZzO/uXJnGbiKSA== Received: from [IPV6:2601:644:9381:f410:71db:fcca:3a29:6836] (unknown [IPv6:2601:644:9381:f410:71db:fcca:3a29:6836]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4T50h96Rp4z18By; Wed, 3 Jan 2024 19:50:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <5150e53d-acc3-4f8a-b8c0-2bc9d300c3d4@FreeBSD.org> Date: Wed, 3 Jan 2024 11:50:47 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCHv2 1/3] gdb: don't try to style content in error calls Content-Language: en-US To: Andrew Burgess , gdb-patches@sourceware.org References: From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,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 List-Id: On 1/2/24 6:43 AM, Andrew Burgess wrote: > 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' One nit: the log mentions two places in GDB, but the patch seems to only fix one such place? -- John Baldwin