Closed Rtoax closed 3 months ago
In binutils (https://sourceware.org/git/binutils-gdb.git) commit 60a3da00bd5407f07d64dff82a4dae98230dfaac ("objdump/opcodes: add syntax highlighting to disassembler output")
--- a/include/dis-asm.h
+++ b/include/dis-asm.h
@@ -394,11 +470,13 @@ extern bool generic_symbol_is_valid
/* Method to initialize a disassemble_info struct. This should be
called by all applications creating such a struct. */
extern void init_disassemble_info (struct disassemble_info *dinfo, void *stream,
- fprintf_ftype fprintf_func);
+ fprintf_ftype fprintf_func,
+ fprintf_styled_ftype fprintf_styled_func);
/* For compatibility with existing code. */
-#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
- init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
+#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC, FPRINTF_STYLED_FUNC) \
+ init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC), \
+ (fprintf_styled_ftype) (FPRINTF_STYLED_FUNC))
#ifdef __cplusplus
}
whten compile
tests/disasm
, get: