[dsymutil] Not finding any debug info is not a fatal error
authorFrederic Riss <friss@apple.com>
Tue, 25 Aug 2015 18:19:43 +0000 (18:19 +0000)
committerFrederic Riss <friss@apple.com>
Tue, 25 Aug 2015 18:19:43 +0000 (18:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245959 91177308-0d34-0410-b5e6-96231b3b80d8

test/tools/dsymutil/ARM/empty-map.test [new file with mode: 0644]
tools/dsymutil/DwarfLinker.cpp
tools/dsymutil/dsymutil.cpp

diff --git a/test/tools/dsymutil/ARM/empty-map.test b/test/tools/dsymutil/ARM/empty-map.test
new file mode 100644 (file)
index 0000000..4cc0e5f
--- /dev/null
@@ -0,0 +1,8 @@
+# REQUIRES: object-emission
+# RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - 2>&1 | FileCheck %s
+
+---
+triple:          'thumbv7-apple-darwin'
+...
+
+# CHECK: warning: no debug symbols in executable (-arch thumbv7)
index b37e260e916b566ca276c888123fa6ad73f93a89..e2ece42d30c9c0a4c04141ac5e3e1792cde2c52e 100644 (file)
@@ -3034,11 +3034,6 @@ DwarfLinker::loadObject(BinaryHolder &BinaryHolder, DebugMapObject &Obj,
 
 bool DwarfLinker::link(const DebugMap &Map) {
 
-  if (Map.begin() == Map.end()) {
-    errs() << "Empty debug map.\n";
-    return false;
-  }
-
   if (!createStreamer(Map.getTriple(), OutputFilename))
     return false;
 
index 1b89ddcec20cfae7e62fff9a8ff134d6b3ddccb3..3d9851eca7ef491b274ef5cd8ffa9adadcaf2b37 100644 (file)
@@ -299,6 +299,10 @@ int main(int argc, char **argv) {
       if (DumpDebugMap)
         continue;
 
+      if (Map->begin() == Map->end())
+        llvm::errs() << "warning: no debug symbols in executable (-arch "
+                     << Map->getTriple().getArchName() << ")\n";
+
       std::string OutputFile = getOutputFileName(InputFile, NeedsTempFiles);
       if (OutputFile.empty() || !linkDwarf(OutputFile, *Map, Options))
         exitDsymutil(1);