[Lldb-commits] [lldb] r295025 - Before returning a pc value for a stack frame,

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 13 20:55:03 PST 2017


Author: jmolenda
Date: Mon Feb 13 22:55:03 2017
New Revision: 295025

URL: http://llvm.org/viewvc/llvm-project?rev=295025&view=rev
Log:
Before returning a pc value for a stack frame,
run it through the ABI's FixCodeAddress method.
<rdar://problem/29711506> 

Modified:
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=295025&r1=295024&r2=295025&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Mon Feb 13 22:55:03 2017
@@ -2015,7 +2015,18 @@ bool RegisterContextLLDB::GetStartPC(add
     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
     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;
   }




More information about the lldb-commits mailing list