[PATCH] D159224: [llvm-objdump] Add flags to force enable/disable color output

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 30 21:31:17 PDT 2023


MaskRay added a comment.

In D159224#4630057 <https://reviews.llvm.org/D159224#4630057>, @JDevlieghere wrote:

> In D159224#4630031 <https://reviews.llvm.org/D159224#4630031>, @MaskRay wrote:
>
>> GNU objdump from 2.39 onwards provides `--disassembler-color=on`. I wonder whether we want similar option names, but I can see that `--disassembler-color=on` is long and inconvenient..
>
> I expect this flag to be mostly used for writing tests so I'm not too worried about being verbose. FWIW I ended up going for the two separate flags because no other `objdump` options take a predefined set of options (there's a few ones that take arbitrary strings such as `--debug-vars=` or `--arch-name=`) but if we feel that something like `--disassembler-color={on, off, auto}` is the right thing to do, then I'm happy to go that route.

Sounds good. objdump uses `terminal` instead of `auto`.

  % objdump --help
  ...
        --disassembler-color=off       Disable disassembler color output. (default)
        --disassembler-color=terminal  Enable disassembler color output if displaying on a terminal.
        --disassembler-color=on        Enable disassembler color output.
        --disassembler-color=extended  Use 8-bit colors in disassembler output.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159224/new/

https://reviews.llvm.org/D159224



More information about the llvm-commits mailing list