Revert r257117 "Performance improvement: Change lldb so that it

puts a breakpoint" it is causing a regression in the TestStepNoDebug
test case on ubuntu 14.04 with gcc 4.9.2.  Thanks for the email
Siva.  I'll recommit when I've figured out the regression.

llvm-svn: 257138
This commit is contained in:
Jason Molenda
2016-01-08 02:26:03 +00:00
parent bfcff3856a
commit 7cb9d98cf9
8 changed files with 11 additions and 148 deletions

View File

@@ -18,7 +18,6 @@
#include "lldb/Core/ValueObjectConstResult.h"
#include "lldb/Symbol/Block.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/Type.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/Process.h"
@@ -45,8 +44,7 @@ ThreadPlanStepOut::ThreadPlanStepOut
Vote stop_vote,
Vote run_vote,
uint32_t frame_idx,
LazyBool step_out_avoids_code_without_debug_info,
bool continue_to_next_branch
LazyBool step_out_avoids_code_without_debug_info
) :
ThreadPlan (ThreadPlan::eKindStepOut, "Step out", thread, stop_vote, run_vote),
ThreadPlanShouldStopHere (this),
@@ -88,8 +86,7 @@ ThreadPlanStepOut::ThreadPlanStepOut
eVoteNoOpinion,
eVoteNoOpinion,
frame_idx - 1,
eLazyBoolNo,
continue_to_next_branch));
eLazyBoolNo));
static_cast<ThreadPlanStepOut *>(m_step_out_to_inline_plan_sp.get())->SetShouldStopHereCallbacks(nullptr, nullptr);
m_step_out_to_inline_plan_sp->SetPrivate(true);
}
@@ -104,35 +101,7 @@ ThreadPlanStepOut::ThreadPlanStepOut
// Find the return address and set a breakpoint there:
// FIXME - can we do this more securely if we know first_insn?
Address return_address (return_frame_sp->GetFrameCodeAddress());
if (continue_to_next_branch)
{
SymbolContext return_address_sc;
AddressRange range;
Address return_address_decr_pc = return_address;
if (return_address_decr_pc.GetOffset() > 0)
return_address_decr_pc.Slide (-1);
return_address_decr_pc.CalculateSymbolContext (&return_address_sc, lldb::eSymbolContextLineEntry | lldb::eSymbolContextFunction | lldb::eSymbolContextSymbol);
if (return_address_sc.line_entry.IsValid())
{
range = return_address_sc.line_entry.GetSameLineContiguousAddressRange();
}
else if (return_address_sc.function)
{
range = return_address_sc.function->GetAddressRange();
}
else if (return_address_sc.symbol && return_address_sc.symbol->GetByteSizeIsValid())
{
range.GetBaseAddress() = return_address_sc.symbol->GetAddress();
range.SetByteSize (return_address_sc.symbol->GetByteSize());
}
if (range.GetByteSize() > 0)
{
return_address = m_thread.GetProcess()->AdvanceAddressToNextBranchInstruction (return_address, range);
}
}
m_return_addr = return_address.GetLoadAddress(&m_thread.GetProcess()->GetTarget());
m_return_addr = return_frame_sp->GetFrameCodeAddress().GetLoadAddress(&m_thread.GetProcess()->GetTarget());
if (m_return_addr == LLDB_INVALID_ADDRESS)
return;