[2/2] gdb: don't try to style content in error calls

Message ID 7e6ee472a9d550bfdcb41da6962efdda0fbcda83.1703361278.git.aburgess@redhat.com
State New
Headers
Series Changes to error reporting from the expression parser |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Andrew Burgess Dec. 23, 2023, 7:56 p.m. UTC
  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(-)
  

Patch

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'