summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Disassembler.cpp
diff options
context:
space:
mode:
authorGreg Clayton <clayborg@gmail.com>2019-05-09 20:39:34 +0000
committerGreg Clayton <clayborg@gmail.com>2019-05-09 20:39:34 +0000
commitdf225764b7d5d96ead8787bc7d1667160d8bbffe (patch)
treed93b3567970f804e30754abebce314b64794ee14 /lldb/source/Core/Disassembler.cpp
parentdee161fb3848a23e5de5393c916301a50ecae903 (diff)
downloadbcm5719-llvm-df225764b7d5d96ead8787bc7d1667160d8bbffe.tar.gz
bcm5719-llvm-df225764b7d5d96ead8787bc7d1667160d8bbffe.zip
Improve step over performance by not stopping at branches that are function calls and stepping into and them out of each one
Currently when we single step over a source line, we run and stop at every branch in the source line range. We can reduce the number of times we stop when stepping over by figuring out if any of these branches are function calls, and if so, ignore these branches. Since we are stepping over we can safely ignore these calls since they will return to the next instruction. Currently the step logic would stop at those branches (1st stop), single step into the branch (2nd stop), and then set a breakpoint at the return address (3rd stop), and then continue. Differential Revision: https://reviews.llvm.org/D58678 llvm-svn: 360375
Diffstat (limited to 'lldb/source/Core/Disassembler.cpp')
-rw-r--r--lldb/source/Core/Disassembler.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp
index 74f66b5d479..af7cf82d470 100644
--- a/lldb/source/Core/Disassembler.cpp
+++ b/lldb/source/Core/Disassembler.cpp
@@ -1087,13 +1087,16 @@ void InstructionList::Append(lldb::InstructionSP &inst_sp) {
uint32_t
InstructionList::GetIndexOfNextBranchInstruction(uint32_t start,
- Target &target) const {
+ Target &target,
+ bool ignore_calls) const {
size_t num_instructions = m_instructions.size();
uint32_t next_branch = UINT32_MAX;
size_t i;
for (i = start; i < num_instructions; i++) {
if (m_instructions[i]->DoesBranch()) {
+ if (ignore_calls && m_instructions[i]->IsCall())
+ continue;
next_branch = i;
break;
}
OpenPOWER on IntegriCloud