diff options
| author | Jason Molenda <jmolenda@apple.com> | 2010-12-22 02:02:45 +0000 | 
|---|---|---|
| committer | Jason Molenda <jmolenda@apple.com> | 2010-12-22 02:02:45 +0000 | 
| commit | f830e481c26245baba836fb379f54bafe530f974 (patch) | |
| tree | 0d76271fd9dd5bdc6d3a17e2b6753ad280770a6b | |
| parent | ff2cd2ea6c907d264f185868afb3c1b90e20e793 (diff) | |
| download | bcm5719-llvm-f830e481c26245baba836fb379f54bafe530f974.tar.gz bcm5719-llvm-f830e481c26245baba836fb379f54bafe530f974.zip  | |
RegisterContextLLDB.cpp (InitializeNonZerothFrame): If we get a
0 mid-stack, stop backtracing.
SectionLoadList.cpp (ResolveLoadAddress): Don't assert on an
out-of-range address, just return an invalid Address object.
The unwinder may be passing in invalid addresses on the final
stack frame and the assert is a problem.
llvm-svn: 122386
| -rw-r--r-- | lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp | 6 | ||||
| -rw-r--r-- | lldb/source/Target/SectionLoadList.cpp | 14 | 
2 files changed, 14 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp index cbb79a2178c..cdaeba86734 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp @@ -210,6 +210,12 @@ RegisterContextLLDB::InitializeNonZerothFrame()          m_frame_type = eNotAValidFrame;          return;      } +    // A pc value of 0 up on the stack indicates we've hit the end of the stack +    if (pc == 0) +    { +        m_frame_type = eNotAValidFrame; +        return; +    }      m_thread.GetProcess().GetTarget().GetSectionLoadList().ResolveLoadAddress (pc, m_current_pc);      // If we don't have a Module for some reason, we're not going to find symbol/function information - just diff --git a/lldb/source/Target/SectionLoadList.cpp b/lldb/source/Target/SectionLoadList.cpp index f900d9697d5..ac9f8180c48 100644 --- a/lldb/source/Target/SectionLoadList.cpp +++ b/lldb/source/Target/SectionLoadList.cpp @@ -164,13 +164,15 @@ SectionLoadList::ResolveLoadAddress (addr_t load_addr, Address &so_addr) const      {          if (load_addr != pos->first && pos != m_collection.begin())              --pos; -        assert (load_addr >= pos->first); -        addr_t offset = load_addr - pos->first; -        if (offset < pos->second->GetByteSize()) +        if (load_addr >= pos->first)          { -            // We have found the top level section, now we need to find the -            // deepest child section. -            return pos->second->ResolveContainedAddress (offset, so_addr); +            addr_t offset = load_addr - pos->first; +            if (offset < pos->second->GetByteSize()) +            { +                // We have found the top level section, now we need to find the +                // deepest child section. +                return pos->second->ResolveContainedAddress (offset, so_addr); +            }          }      }      so_addr.Clear();  | 

