Default to enabling colored disassembly if output is to a terminal.

PR 29457
	* objdump.c (disassembler_color): Change type to an enum.
	(disassembler_extended_color): Remove.
	(usage): Update.
	(objdump_color_for_assembler_style): Update.
	(main): Update initialisation of disassembler_color.  If not
	initialised via a command line option, set based upon terminal
	output.
	* doc/binutils.texi: Update description of disassmbler-color
	option.
	* testsuite/binutils-all/arc/objdump.exp: Add
	--disassembler-color=off option when disassembling.
	* testsuite/binutils-all/arm/objdump.exp: Likewise.
This commit is contained in:
Nick Clifton
2022-08-09 14:57:48 +01:00
parent 80d3624849
commit a88c79b770
5 changed files with 71 additions and 19 deletions

View File

@ -56,7 +56,7 @@ proc check_assembly { testname objfile expected { disas_flags "" } } {
fail $testname
return
}
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble $disas_flags \
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --disassembler-color=off $disas_flags \
$objfile"]
if [regexp $expected $got] then {

View File

@ -41,7 +41,7 @@ if {![binutils_assemble $srcdir/$subdir/thumb2-cond.s tmpdir/thumb2-cond.o]} the
# Make sure that conditional instructions are correctly decoded.
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --start-address=6 $objfile"]
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble --disassembler-color=off --start-address=6 $objfile"]
set want "bcc.w\[ \t\]*e12.*bx\[ \t\]*lr"