public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCH 2/2] gdb: don't try to style content in error calls
Date: Sat, 23 Dec 2023 19:56:04 +0000	[thread overview]
Message-ID: <7e6ee472a9d550bfdcb41da6962efdda0fbcda83.1703361278.git.aburgess@redhat.com> (raw)
In-Reply-To: <cover.1703361278.git.aburgess@redhat.com>

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'
-- 
2.25.4


  parent reply	other threads:[~2023-12-23 19:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-23 19:56 [PATCH 0/2] Changes to error reporting from the expression parser Andrew Burgess
2023-12-23 19:56 ` [PATCH 1/2] gdb: improve error reporting from " Andrew Burgess
2023-12-28 19:12   ` John Baldwin
2023-12-23 19:56 ` Andrew Burgess [this message]
2024-01-02 14:43 ` [PATCHv2 0/3] Changes to error reporting from the " Andrew Burgess
2024-01-02 14:43   ` [PATCHv2 1/3] gdb: don't try to style content in error calls Andrew Burgess
2024-01-03 19:50     ` John Baldwin
2024-01-02 14:43   ` [PATCHv2 2/3] gdb: merge error handling from different expression parsers Andrew Burgess
2024-01-02 15:01     ` Lancelot SIX
2024-01-03  9:39       ` Andrew Burgess
2024-01-02 14:43   ` [PATCHv2 3/3] gdb: improve error reporting from expression parser Andrew Burgess
2024-01-03 19:52   ` [PATCHv2 0/3] Changes to error reporting from the " John Baldwin
2024-01-04  9:43     ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7e6ee472a9d550bfdcb41da6962efdda0fbcda83.1703361278.git.aburgess@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).