From df225764b7d5d96ead8787bc7d1667160d8bbffe Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Thu, 9 May 2019 20:39:34 +0000 Subject: 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 --- lldb/source/Core/Disassembler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lldb/source/Core/Disassembler.cpp') 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; } -- cgit v1.2.3