This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Add SBInstruction::GetControlFlowKind()
ClosedPublic

Authored by jj10306 on Aug 2 2022, 11:39 AM.

Details

Summary

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

Diff Detail

Event Timeline

jj10306 created this revision.Aug 2 2022, 11:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2022, 11:39 AM
jj10306 requested review of this revision.Aug 2 2022, 11:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2022, 11:39 AM
wallace accepted this revision.Aug 2 2022, 12:36 PM

great!

lldb/source/API/SBInstruction.cpp
176

this might be potentially expensive. If this slows traversals down, eventually we can create an unsafe version of this method that avoids mutexes but is faster.

This revision is now accepted and ready to land.Aug 2 2022, 12:36 PM
persona0220 accepted this revision.Aug 2 2022, 1:02 PM
This revision was automatically updated to reflect the committed changes.
jj10306 marked an inline comment as done.