aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llvm/test/tools/dsymutil/X86/empty_range.s4
-rw-r--r--llvm/tools/dsymutil/DwarfLinker.cpp4
2 files changed, 7 insertions, 1 deletions
diff --git a/llvm/test/tools/dsymutil/X86/empty_range.s b/llvm/test/tools/dsymutil/X86/empty_range.s
index 5c8ae6a..dfe734f 100644
--- a/llvm/test/tools/dsymutil/X86/empty_range.s
+++ b/llvm/test/tools/dsymutil/X86/empty_range.s
@@ -55,3 +55,7 @@ Ldebug_range:
# CHECK-NEXT: DW_AT_low_pc{{.*}}(0x0000000000010000)
# CHECK-NEXT: DW_AT_ranges{{.*}}(0x00000000)
+# There was a bug that would use the currently active object file when a
+# debug map object isn't found. Check that we only linked one file.
+# CHECK-NOT: DW_TAG_compile_unit
+
diff --git a/llvm/tools/dsymutil/DwarfLinker.cpp b/llvm/tools/dsymutil/DwarfLinker.cpp
index f3e48f5..ed06dba 100644
--- a/llvm/tools/dsymutil/DwarfLinker.cpp
+++ b/llvm/tools/dsymutil/DwarfLinker.cpp
@@ -2942,8 +2942,10 @@ DwarfLinker::loadObject(BinaryHolder &BinaryHolder, DebugMapObject &Obj,
const DebugMap &Map) {
auto ErrOrObjs =
BinaryHolder.GetObjectFiles(Obj.getObjectFilename(), Obj.getTimestamp());
- if (std::error_code EC = ErrOrObjs.getError())
+ if (std::error_code EC = ErrOrObjs.getError()) {
reportWarning(Twine(Obj.getObjectFilename()) + ": " + EC.message());
+ return EC;
+ }
auto ErrOrObj = BinaryHolder.Get(Map.getTriple());
if (std::error_code EC = ErrOrObj.getError())
reportWarning(Twine(Obj.getObjectFilename()) + ": " + EC.message());