diff options
author | Greg Clayton <gclayton@apple.com> | 2012-03-19 22:22:41 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-03-19 22:22:41 +0000 |
commit | f9be693369134de1307db75310e71476fb76a017 (patch) | |
tree | e9f258106197426e41d0d8ea47a851d7cc5ce7f6 /lldb/source/Target/PathMappingList.cpp | |
parent | c4aa60ffe954780976e3cef233a97446659029ba (diff) | |
download | bcm5719-llvm-f9be693369134de1307db75310e71476fb76a017.tar.gz bcm5719-llvm-f9be693369134de1307db75310e71476fb76a017.zip |
<rdar://problem/11072382>
Fixed a case where the source path remappings on the module were too expensive to
use when we try to verify (stat the file system) that the remapped path points to
a valid file. Now we will use the lldb_private::Module path remappings (if any) when
parsing the debug info without verifying that the paths exist so we don't slow down
line table parsing speeds.
llvm-svn: 153059
Diffstat (limited to 'lldb/source/Target/PathMappingList.cpp')
-rw-r--r-- | lldb/source/Target/PathMappingList.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lldb/source/Target/PathMappingList.cpp b/lldb/source/Target/PathMappingList.cpp index 6acd8bfe46d..345bbed3b14 100644 --- a/lldb/source/Target/PathMappingList.cpp +++ b/lldb/source/Target/PathMappingList.cpp @@ -174,6 +174,27 @@ PathMappingList::RemapPath (const ConstString &path, ConstString &new_path) cons } bool +PathMappingList::RemapPath (const char *path, std::string &new_path) const +{ + if (!m_pairs.empty() || path == NULL || path[0] == '\0') + return false; + + const_iterator pos, end = m_pairs.end(); + for (pos = m_pairs.begin(); pos != end; ++pos) + { + const size_t prefix_len = pos->first.GetLength(); + + if (::strncmp (pos->first.GetCString(), path, prefix_len) == 0) + { + new_path = pos->second.GetCString(); + new_path.append(path + prefix_len); + return true; + } + } + return false; +} + +bool PathMappingList::FindFile (const FileSpec &orig_spec, FileSpec &new_spec) const { if (!m_pairs.empty()) |