mirror of
https://github.com/intel/llvm.git
synced 2026-01-30 14:07:28 +08:00
[lldb] Add syntax color highlighting for disassembly
Add support for syntax color highlighting disassembly in LLDB. This
patch relies on 77d1032516, which introduces support for syntax
highlighting in MC.
Currently only AArch64 and X86 have color support, but other interested
backends can adopt WithColor in their respective MCInstPrinter.
Differential revision: https://reviews.llvm.org/D159164
This commit is contained in:
@@ -59,9 +59,19 @@ class DisassembleRawDataTestCase(TestBase):
|
||||
elif arch in ("aarch64", "arm64"):
|
||||
self.assertEqual(inst.GetMnemonic(target), "mov")
|
||||
self.assertEqual(inst.GetOperands(target), "w0, #0x63")
|
||||
self.assertEqual(inst.GetComment(target), "=99 ")
|
||||
self.assertEqual(
|
||||
inst.GetControlFlowKind(target), lldb.eInstructionControlFlowKindUnknown
|
||||
)
|
||||
# Make sure that using colors doesn't affect the output here.
|
||||
res = lldb.SBCommandReturnObject()
|
||||
ci = self.dbg.GetCommandInterpreter()
|
||||
ci.HandleCommand("settings set use-color true", res)
|
||||
self.assertEqual(inst.GetOperands(target), "w0, #0x63")
|
||||
self.assertEqual(inst.GetMnemonic(target), "mov")
|
||||
self.assertEqual(inst.GetComment(target), "=99 ")
|
||||
ci.HandleCommand("settings set use-color false", res)
|
||||
|
||||
elif arch == "arm":
|
||||
self.assertEqual(inst.GetMnemonic(target), "mov")
|
||||
self.assertEqual(inst.GetOperands(target), "r3, #99")
|
||||
|
||||
Reference in New Issue
Block a user