public inbox for binutils-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] objdump: fix extended (256) disassembler colors
@ 2022-08-10 16:12 Andrew Burgess
  0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2022-08-10 16:12 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=daf2618a918f2fd338e2519b51d7599943ccb3e8

commit daf2618a918f2fd338e2519b51d7599943ccb3e8
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Wed Aug 10 12:42:35 2022 +0100

    objdump: fix extended (256) disassembler colors
    
    After commit:
    
      commit a88c79b77036e4778e70d62081c3cfd1044bb8e3
      Date:   Tue Aug 9 14:57:48 2022 +0100
    
          Default to enabling colored disassembly if output is to a terminal.
    
    The 256 extended-color support for --disassembler-color was broken.
    This is fixed in this commit.
    
            PR 29457
            * objdump (objdump_styled_sprintf): Check disassembler_color
            against an enum value, don't treat it as a bool.

Diff:
---
 binutils/objdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/binutils/objdump.c b/binutils/objdump.c
index 08c335476ff..9259c76c716 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -2247,7 +2247,7 @@ objdump_styled_sprintf (SFILE *f, enum disassembler_style style,
 	{
 	  size_t space = f->alloc - f->pos;
 
-	  if (disassembler_color)
+	  if (disassembler_color == on)
 	    n = snprintf (f->buffer + f->pos, space, "\033[%dm", color);
 	  else
 	    n = snprintf (f->buffer + f->pos, space, "\033[38;5;%dm", color);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-10 16:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10 16:12 [binutils-gdb] objdump: fix extended (256) disassembler colors Andrew Burgess

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).