summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanStepRange.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2013-07-31 02:19:15 +0000
committerJim Ingham <jingham@apple.com>2013-07-31 02:19:15 +0000
commit56d404281f8f94dd2d1915b91111e8db8e90e857 (patch)
tree672f744f93e4a61bf5d5028bfc5a335231454fe1 /lldb/source/Target/ThreadPlanStepRange.cpp
parent75a5ba7ed046d0c69db712406e646ef11b9e52a3 (diff)
downloadbcm5719-llvm-56d404281f8f94dd2d1915b91111e8db8e90e857.tar.gz
bcm5719-llvm-56d404281f8f94dd2d1915b91111e8db8e90e857.zip
The DisassemblerLLVMC has a retain cycle - the InstructionLLVMC's contained in its instruction
list have a shared pointer back to their DisassemblerLLVMC. This checkin force clears the InstructionList in all the places we use the DisassemblerSP to stop the leaking for now. I'll go back and fix this for real when I have time to do so. <rdar://problem/14581918> llvm-svn: 187473
Diffstat (limited to 'lldb/source/Target/ThreadPlanStepRange.cpp')
-rw-r--r--lldb/source/Target/ThreadPlanStepRange.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lldb/source/Target/ThreadPlanStepRange.cpp b/lldb/source/Target/ThreadPlanStepRange.cpp
index e2820790e71..da25348c2dd 100644
--- a/lldb/source/Target/ThreadPlanStepRange.cpp
+++ b/lldb/source/Target/ThreadPlanStepRange.cpp
@@ -66,6 +66,16 @@ ThreadPlanStepRange::ThreadPlanStepRange (ThreadPlanKind kind,
ThreadPlanStepRange::~ThreadPlanStepRange ()
{
ClearNextBranchBreakpoint();
+
+ size_t num_instruction_ranges = m_instruction_ranges.size();
+
+ // FIXME: The DisassemblerLLVMC has a reference cycle and won't go away if it has any active instructions.
+ // I'll fix that but for now, just clear the list and it will go away nicely.
+ for (size_t i = 0; i < num_instruction_ranges; i++)
+ {
+ if (m_instruction_ranges[i])
+ m_instruction_ranges[i]->GetInstructionList().Clear();
+ }
}
void
@@ -99,6 +109,9 @@ ThreadPlanStepRange::AddRange(const AddressRange &new_range)
// condense the ranges if they overlap, though I don't think it is likely
// to be very important.
m_address_ranges.push_back (new_range);
+
+ // Fill the slot for this address range with an empty DisassemblerSP in the instruction ranges. I want the
+ // indices to match, but I don't want to do the work to disassemble this range if I don't step into it.
m_instruction_ranges.push_back (DisassemblerSP());
}
OpenPOWER on IntegriCloud