File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -1638,8 +1638,12 @@ void BinaryContext::preprocessDWODebugInfo() {
16381638 sys::path::append (AbsolutePath, opts::CompDirOverride);
16391639 sys::path::append (AbsolutePath, DWOName);
16401640 } else if (!sys::fs::exists (DwarfUnit->getCompilationDir ()) &&
1641- sys::fs::exists (DWOName))
1641+ sys::fs::exists (DWOName)) {
1642+ this ->outs ()
1643+ << " BOLT-WARNING: Debug Fission: Debug Compilation Dir wrong for "
1644+ << DWOName << " . DWO Name will be directly used for retrieving.\n " ;
16421645 AbsolutePath = DWOName;
1646+ }
16431647 DWARFUnit *DWOCU =
16441648 DwarfUnit->getNonSkeletonUnitDIE (false , AbsolutePath).getDwarfUnit ();
16451649 if (!DWOCU->isDWOUnit ()) {
Original file line number Diff line number Diff line change @@ -1851,8 +1851,8 @@ void DWARFRewriter::writeDWOFiles(
18511851 CompDir = opts::DwarfOutputPath.c_str ();
18521852 else if (!opts::CompDirOverride.empty ())
18531853 CompDir = opts::CompDirOverride;
1854- else if (!sys::fs::exists (CompDir))
1855- CompDir = " . " ;
1854+ else if (!sys::fs::exists (CompDir) && sys::fs::exists (DWOName) )
1855+ CompDir = " " ;
18561856
18571857 SmallString<16 > AbsolutePath;
18581858 sys::path::append (AbsolutePath, CompDir);
Original file line number Diff line number Diff line change 1+ // This test checks retrieving dwo file diercetly with dwo name,
2+ // if the Debug Compilation Dir does not exist.
3+
4+ int main () { return 0 ; }
5+
6+ // RUN: rm -rf %t && mkdir -p %t && cd %t
7+ // RUN: %clang %cflags -g -gsplit-dwarf -fdebug-compilation-dir=/path/does/not/exist %s -o main.exe
8+ // RUN: llvm-bolt %t/main.exe -o %t/main.exe.bolt -update-debug-sections 2>&1 | FileCheck %s -check-prefix=NOT-EXIST
9+
10+ // NOT-EXIST: BOLT-WARNING: Debug Fission: Debug Compilation Dir wrong for
11+
12+ // RUN: rm -rf %t && mkdir -p %t && cd %t
13+ // RUN: %clang %cflags -g -gsplit-dwarf -fdebug-compilation-dir=/path/does/not/exist %s -o %t/main.exe
14+ // RUN: llvm-bolt %t/main.exe -o %t/main.exe.bolt -update-debug-sections 2>&1 | FileCheck %s -check-prefix=FOUND
15+
16+ // FOUND-NOT: Debug Fission: DWO debug information for
You can’t perform that action at this time.
0 commit comments