aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api
diff options
context:
space:
mode:
authorJakob Johnson <johnsonjakob99@gmail.com>2022-08-02 11:26:24 -0700
committerJakob Johnson <johnsonjakob99@gmail.com>2022-08-02 15:42:45 -0700
commit6cbc6e9a6d5f0ef9c406f718dd0c3e6dd6dffeef (patch)
tree8de23232d9268e5c168dd7068392a2bcc041c8cd /lldb/test/API/python_api
parent4f0262c1640531dd431cf205f4b802b1fabb6489 (diff)
downloadllvm-6cbc6e9a6d5f0ef9c406f718dd0c3e6dd6dffeef.zip
llvm-6cbc6e9a6d5f0ef9c406f718dd0c3e6dd6dffeef.tar.gz
llvm-6cbc6e9a6d5f0ef9c406f718dd0c3e6dd6dffeef.tar.bz2
[LLDB] Add SBInstruction::GetControlFlowKind()
D128477 adds the control flow kind for `Instruction` and displays this in the `thread trace dump instruction -k` command. This diff exposes the control flow kind via the new `SBInstruction::GetControlFlowKind` method. I've expanded `TestDisassembleRawData` to test this method, but please let me know if there are any other unittests that should also be updated. Test Plan: `./bin/lldb-dotest -p TestDisassembleRawData` Differential Revision: https://reviews.llvm.org/D131005
Diffstat (limited to 'lldb/test/API/python_api')
-rw-r--r--lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py10
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 677559c..4186e6b 100644
--- a/lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ b/lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -52,16 +52,26 @@ class DisassembleRawDataTestCase(TestBase):
self.assertEqual(inst.GetMnemonic(target), "move")
self.assertEqual(inst.GetOperands(target),
'$' + "fp, " + '$' + "sp")
+ self.assertEqual(inst.GetControlFlowKind(target),
+ lldb.eInstructionControlFlowKindUnknown)
elif re.match("powerpc64le", arch):
self.assertEqual(inst.GetMnemonic(target), "li")
self.assertEqual(inst.GetOperands(target), "4, 0")
+ self.assertEqual(inst.GetControlFlowKind(target),
+ lldb.eInstructionControlFlowKindUnknown)
elif arch in ("aarch64", "arm64"):
self.assertEqual(inst.GetMnemonic(target), "mov")
self.assertEqual(inst.GetOperands(target), "w0, #0x63")
+ self.assertEqual(inst.GetControlFlowKind(target),
+ lldb.eInstructionControlFlowKindUnknown)
elif arch == "arm":
self.assertEqual(inst.GetMnemonic(target), "mov")
self.assertEqual(inst.GetOperands(target), "r3, #99")
+ self.assertEqual(inst.GetControlFlowKind(target),
+ lldb.eInstructionControlFlowKindUnknown)
else:
self.assertEqual(inst.GetMnemonic(target), "movq")
self.assertEqual(inst.GetOperands(target),
'%' + "rsp, " + '%' + "rbp")
+ self.assertEqual(inst.GetControlFlowKind(target),
+ lldb.eInstructionControlFlowKindOther)