diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2023-09-01 14:20:08 -0700 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2023-09-01 14:47:45 -0700 |
| commit | a69f78b080ef7efd2854ba199248713d956ea40c (patch) | |
| tree | fd4a4e1361d47a1bb6947309bcff8f367f727d2b /lldb/test/API/python_api | |
| parent | a168135487107c0af5908c69129a78bc3403b64d (diff) | |
| download | llvm-a69f78b080ef7efd2854ba199248713d956ea40c.zip llvm-a69f78b080ef7efd2854ba199248713d956ea40c.tar.gz llvm-a69f78b080ef7efd2854ba199248713d956ea40c.tar.bz2 | |
[lldb] Add syntax color highlighting for disassembly
Add support for syntax color highlighting disassembly in LLDB. This
patch relies on 77d1032516e7, 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
Diffstat (limited to 'lldb/test/API/python_api')
| -rw-r--r-- | lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py b/lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py index 2c44dd4..4ec2753 100644 --- a/lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py +++ b/lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py @@ -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") |
