diff options
author | Zachary Turner <zturner@google.com> | 2016-03-02 22:05:52 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-03-02 22:05:52 +0000 |
commit | 74e08ca05cc9bcd67660ec60ae883de99c984afe (patch) | |
tree | 9880a0d30277c877ecac0506c8350cb419f3f29d /lldb/source/Host/common/FileSpec.cpp | |
parent | 6470f7615cf67423f4f719610ea128e886ce6195 (diff) | |
download | llvm-74e08ca05cc9bcd67660ec60ae883de99c984afe.zip llvm-74e08ca05cc9bcd67660ec60ae883de99c984afe.tar.gz llvm-74e08ca05cc9bcd67660ec60ae883de99c984afe.tar.bz2 |
Add support for reading line tables from PDB files.
PDB is Microsoft's debug information format, and although we
cannot yet generate it, we still must be able to consume it.
Reason for this is that debug information for system libraries
(e.g. kernel32, C Runtime Library, etc) only have debug info
in PDB format, so in order to be able to support debugging
of system code, we must support it.
Currently this code should compile on every platform, but on
non-Windows platforms the PDB plugin will return 0 capabilities,
meaning that for now PDB is only supported on Windows. This
may change in the future, but the API is designed in such a way
that this will require few (if any) changes on the LLDB side.
In the future we can just flip a switch and everything will
work.
This patch only adds support for line tables. It does not return
information about functions, types, global variables, or anything
else. This functionality will be added in a followup patch.
Differential Revision: http://reviews.llvm.org/D17363
Reviewed by: Greg Clayton
llvm-svn: 262528
Diffstat (limited to 'lldb/source/Host/common/FileSpec.cpp')
-rw-r--r-- | lldb/source/Host/common/FileSpec.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index 281a9df..b8d3548 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -390,19 +390,29 @@ FileSpec::operator!() const return !m_directory && !m_filename; } +bool +FileSpec::DirectoryEquals(const FileSpec &rhs) const +{ + const bool case_sensitive = IsCaseSensitive() || rhs.IsCaseSensitive(); + return ConstString::Equals(m_directory, rhs.m_directory, case_sensitive); +} + +bool +FileSpec::FileEquals(const FileSpec &rhs) const +{ + const bool case_sensitive = IsCaseSensitive() || rhs.IsCaseSensitive(); + return ConstString::Equals(m_filename, rhs.m_filename, case_sensitive); +} + //------------------------------------------------------------------ // Equal to operator //------------------------------------------------------------------ bool FileSpec::operator== (const FileSpec& rhs) const { - // case sensitivity of equality test - const bool case_sensitive = IsCaseSensitive() || rhs.IsCaseSensitive(); - - if (!ConstString::Equals(m_filename, rhs.m_filename, case_sensitive)) + if (!FileEquals(rhs)) return false; - - if (ConstString::Equals(m_directory, rhs.m_directory, case_sensitive)) + if (DirectoryEquals(rhs)) return true; // TODO: determine if we want to keep this code in here. @@ -451,7 +461,7 @@ FileSpec::operator== (const FileSpec& rhs) const // If we reach this point in the code we were able to resolve both paths // and since we only resolve the paths if the basenames are equal, then // we can just check if both directories are equal... - return ConstString::Equals(m_directory, rhs.m_directory, case_sensitive); + return DirectoryEquals(rhs); } //------------------------------------------------------------------ |