Before returning a pc value for a stack frame,

run it through the ABI's FixCodeAddress method.
<rdar://problem/29711506> 

llvm-svn: 295025
This commit is contained in:
Jason Molenda 2017-02-14 04:55:03 +00:00
parent 4c82b4f6fa
commit be227955e2
1 changed files with 21 additions and 3 deletions

View File

@ -2015,7 +2015,18 @@ bool RegisterContextLLDB::GetStartPC(addr_t &start_pc) {
return false;
if (!m_start_pc.IsValid()) {
return ReadPC(start_pc);
bool read_successfully = ReadPC (start_pc);
if (read_successfully)
{
ProcessSP process_sp (m_thread.GetProcess());
if (process_sp)
{
ABI *abi = process_sp->GetABI().get();
if (abi)
start_pc = abi->FixCodeAddress(start_pc);
}
}
return read_successfully;
}
start_pc = m_start_pc.GetLoadAddress(CalculateTarget().get());
return true;
@ -2044,9 +2055,16 @@ bool RegisterContextLLDB::ReadPC(addr_t &pc) {
if (m_all_registers_available == false && above_trap_handler == false &&
(pc == 0 || pc == 1)) {
return false;
} else {
return true;
}
ProcessSP process_sp (m_thread.GetProcess());
if (process_sp)
{
ABI *abi = process_sp->GetABI().get();
if (abi)
pc = abi->FixCodeAddress(pc);
}
return true;
} else {
return false;
}