diff options
| author | Jim Ingham <jingham@apple.com> | 2019-12-16 17:38:13 -0800 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2019-12-16 17:45:21 -0800 |
| commit | 434905b97d961531286d4b49c7ee1969f7cbea0e (patch) | |
| tree | e56180fd34ddd0d7316f26a5fffd9b4d2005a9c5 /lldb/include | |
| parent | 53bcd1e1413c878d2d988df80142a430a9abf24a (diff) | |
| download | bcm5719-llvm-434905b97d961531286d4b49c7ee1969f7cbea0e.tar.gz bcm5719-llvm-434905b97d961531286d4b49c7ee1969f7cbea0e.zip | |
Run all threads when extending a next range over a call.
If you don't do this you end up running arbitrary code with
only one thread allowed to run, which can cause deadlocks.
<rdar://problem/56422478>
Differential Revision: https://reviews.llvm.org/D71440
Diffstat (limited to 'lldb/include')
| -rw-r--r-- | lldb/include/lldb/Core/Disassembler.h | 7 | ||||
| -rw-r--r-- | lldb/include/lldb/Target/ThreadPlanStepRange.h | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lldb/include/lldb/Core/Disassembler.h b/lldb/include/lldb/Core/Disassembler.h index ba9ca87832f..7ece0eeb708 100644 --- a/lldb/include/lldb/Core/Disassembler.h +++ b/lldb/include/lldb/Core/Disassembler.h @@ -287,6 +287,10 @@ public: /// a function call (a branch that calls and returns to the next /// instruction). If false, find the instruction index of any /// branch in the list. + /// + /// @param[out] found_calls + /// If non-null, this will be set to true if any calls were found in + /// extending the range. /// /// @return /// The instruction index of the first branch that is at or past @@ -295,7 +299,8 @@ public: //------------------------------------------------------------------ uint32_t GetIndexOfNextBranchInstruction(uint32_t start, Target &target, - bool ignore_calls) const; + bool ignore_calls, + bool *found_calls) const; uint32_t GetIndexOfInstructionAtLoadAddress(lldb::addr_t load_addr, Target &target); diff --git a/lldb/include/lldb/Target/ThreadPlanStepRange.h b/lldb/include/lldb/Target/ThreadPlanStepRange.h index 93d54ad7dfd..28209623a1e 100644 --- a/lldb/include/lldb/Target/ThreadPlanStepRange.h +++ b/lldb/include/lldb/Target/ThreadPlanStepRange.h @@ -76,6 +76,12 @@ protected: lldb::BreakpointSP m_next_branch_bp_sp; bool m_use_fast_step; bool m_given_ranges_only; + bool m_found_calls = false; // When we set the next branch breakpoint for + // step over, we now extend them past call insns + // that directly return. But if we do that we + // need to run all threads, or we might cause + // deadlocks. This tells us whether we found + // any calls in setting the next branch breakpoint. private: std::vector<lldb::DisassemblerSP> m_instruction_ranges; |

