Skip to content

Commit c9f1e0d

Browse files
committed
gdb: don't try to style content in error calls
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 one place in GDB where we apparently try to apply styling within the error() output (in procfs.c). I suspect this error() call might not be tested. Rather than try to implement styling in the error() output, right now I'm proposing to just remove the attempt 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, I just wanted to fix this in passing. Approved-By: John Baldwin <[email protected]>
1 parent 06bfdc6 commit c9f1e0d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

gdb/procfs.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,10 +605,8 @@ static void
605605
proc_error (procinfo *pi, const char *func, int line)
606606
{
607607
int saved_errno = errno;
608-
error ("procfs: %s line %d, %ps: %s",
609-
func, line, styled_string (file_name_style.style (),
610-
pi->pathname),
611-
safe_strerror (saved_errno));
608+
error ("procfs: %s line %d, %s: %s",
609+
func, line, pi->pathname, safe_strerror (saved_errno));
612610
}
613611

614612
/* Updates the status struct in the procinfo. There is a 'valid'

0 commit comments

Comments
 (0)