From patchwork Sat Dec 23 19:56:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 82797 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 ED55038582AC for ; Sat, 23 Dec 2023 19:56:33 +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.133.124]) by sourceware.org (Postfix) with ESMTPS id C319E3858432 for ; Sat, 23 Dec 2023 19:56:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C319E3858432 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 C319E3858432 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703361376; cv=none; b=emwX0epm1tOzVaAz1mjWg5mDeZal8GYbn+AeKWH6T/UwIlhrOEEKg73ljlhdKsozZmzmUBkeEyGUx3K3p127lyguXITe6BNjv2nGy4zeVv8J2TU7t2xRFg4DH91rjpPrmqQp5+tSh/o5ESx0JbJgfCG1cNx99BXEXv3xG+AwWME= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703361376; c=relaxed/simple; bh=/iIqd2SVYnMrNbnxcqTciMjjI4gQFXvPDw/u6bbo+lc=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=C/Sm734xWDnw75aGGfdkfwAMMa7fjqF9kI/lmGFCdhNwKZM2xuUUGR0/Y9Hgz03v1dy1xespyeqkjNFPi8Ej1FFol9Z6KD9DarX+zAJRdes3qXObd+GQZl9qj+Gp0N82/lUlUAqg/7SqMZ/5g8EFeuvTqNVyRvTaP4vnqNgF4yA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703361374; 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=wIsfh9S+avzcbZR/B496BOq1derhgOOb16Sw6N69FPQ=; b=cI0qyrwQyXo8y2cF6xwPrUscCir5hF6Mu4p/tovFoLsIsgeymWfrIdGNEtlHmSvhukPCaN Mp8N5X7DcwmD9ozEMbiLXiHu6oHLRRvnwmkd+vSN/lk4PBiS9g+NGnqrO50J9OcnneIkLW zNLarpjCB7eN68q4u1TIx6+33Z34EYg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668-YnvyDl4zO3ics8ofz-uw_g-1; Sat, 23 Dec 2023 14:56:13 -0500 X-MC-Unique: YnvyDl4zO3ics8ofz-uw_g-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-40d17446f11so29681025e9.0 for ; Sat, 23 Dec 2023 11:56:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703361369; x=1703966169; 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=wIsfh9S+avzcbZR/B496BOq1derhgOOb16Sw6N69FPQ=; b=r50t9epsiZXGYq+9RM36tIj+1jqVTQFhOV2s3IKwJgQn+oilMlLSzVqdlRpYVKgVZk 6M/mBXj0gzKcsGCJQNwt6X1OG6YaNZFyGq497Sw2PQXC3ZOO1l1718jghF6fUmjQD0ct kSvrVFVD9TuhUM+sHLj/0f0Wx3iCR7nRK+pQpeGBpJoxnjzU6NRoCUR/Lk7NgYsT6kXD gAh2goZz3Y58+pslrTQPUW4Nw5m91twfmCO7skuQT9tZ3VoL2+ox1seG1kQsD8eyB5GP QcdWqXljjkwnfuEVWhX/f7omxS52/NebQoKjrKL+DYJP8lhTO8WwRZUcpvXWA/BF3+Xd 6XqA== X-Gm-Message-State: AOJu0Yw4XijODvmXBWzd+Ovfcee0OwqL70yTyH/aJ0UFGQcm/H3cCv6A CBOZxKUlzCc8WVhp90ac8NhFxaDFPompgEJjUQ+MOAcOvsF0a6vqy/LnIKjukbH5ca9/VWTUEp8 zrqrx7rtpj+Hdy7fwhFETQC+RTdJPGjNOz0/YStRyySjZM66e9tq9ZKfSglisWQwkeTorOHPVST Qdep+UjNYHexXlmQ== X-Received: by 2002:a05:600c:511d:b0:40b:36e9:bf4b with SMTP id o29-20020a05600c511d00b0040b36e9bf4bmr1560658wms.41.1703361369662; Sat, 23 Dec 2023 11:56:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEynRiG30AGluI0gaK3nlDvU30BJ+CSt2PssLyzzDr7cENaac/NXd5/uQyK6yc3a/sfhBC83A== X-Received: by 2002:a05:600c:511d:b0:40b:36e9:bf4b with SMTP id o29-20020a05600c511d00b0040b36e9bf4bmr1560654wms.41.1703361369303; Sat, 23 Dec 2023 11:56:09 -0800 (PST) Received: from localhost ([2a00:23c7:c696:e701:85a5:8a0c:1403:2dc]) by smtp.gmail.com with ESMTPSA id fl25-20020a05600c0b9900b0040b3e26872dsm19536757wmb.8.2023.12.23.11.56.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Dec 2023 11:56:09 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 2/2] gdb: don't try to style content in error calls Date: Sat, 23 Dec 2023 19:56:04 +0000 Message-Id: <7e6ee472a9d550bfdcb41da6962efdda0fbcda83.1703361278.git.aburgess@redhat.com> 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=-11.6 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_H3, 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 Working on the previous commit I realised that we can't style output in error calls. I took a look and found one place where we do currently try to style something within an error call, if this ever triggers then it's just going to print a pointer rather than the styled string. Fixed by removing the styling. --- 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'