get formatter in a discrete step for easier debugging

This commit is contained in:
Zachary Cutlip 2021-01-29 10:58:18 -08:00
parent 88b6816909
commit 7030c7f486
1 changed files with 4 additions and 3 deletions

View File

@ -50,9 +50,10 @@ class DisasmView(TerminalView):
try: try:
host = 'capstone' if self.args.use_capstone else res.host host = 'capstone' if self.args.use_capstone else res.host
lexer = get_lexer_by_name('{}_{}'.format(host, res.flavor)) lexer = get_lexer_by_name('{}_{}'.format(host, res.flavor))
disasm = pygments.highlight(disasm, lexer, pygments.formatters.get_formatter_by_name( formatter = pygments.formatters.get_formatter_by_name(
self.config.format.pygments_formatter, self.config.format.pygments_formatter,
style=self.config.format.pygments_style)) style=self.config.format.pygments_style)
disasm = pygments.highlight(disasm, lexer, formatter)
except Exception as e: except Exception as e:
log.warning('Failed to highlight disasm: ' + str(e)) log.warning('Failed to highlight disasm: ' + str(e))
log.info(self.config.format) log.info(self.config.format)