diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-07-19 07:03:58 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-07-19 07:03:58 +0000 |
commit | 71d94f805514f28730bf39143ee227648d521d09 (patch) | |
tree | 2c1f82b94b4c75f9736128b9734872d03a9ec0fc /lib/DebugInfo/DWARFCompileUnit.cpp | |
parent | 72ea0c9ffaa1700730c8ce36e9b73aef4b914988 (diff) |
DebugInfo library: add support for fetching absolute paths to source files
(instead of basenames) from DWARF. Use this behavior in llvm-dwarfdump tool.
Reviewed by Benjamin Kramer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160496 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFCompileUnit.cpp')
-rw-r--r-- | lib/DebugInfo/DWARFCompileUnit.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/DebugInfo/DWARFCompileUnit.cpp b/lib/DebugInfo/DWARFCompileUnit.cpp index 6d4c7df8dc..b27d57bef1 100644 --- a/lib/DebugInfo/DWARFCompileUnit.cpp +++ b/lib/DebugInfo/DWARFCompileUnit.cpp @@ -97,6 +97,13 @@ void DWARFCompileUnit::dump(raw_ostream &OS) { getCompileUnitDIE(false)->dump(OS, this, -1U); } +const char *DWARFCompileUnit::getCompilationDir() { + extractDIEsIfNeeded(true); + if (DieArray.empty()) + return 0; + return DieArray[0].getAttributeValueAsString(this, DW_AT_comp_dir, 0); +} + void DWARFCompileUnit::setDIERelations() { if (DieArray.empty()) return; |