[PATCH] D38078: [dsymutil] Don't resolve DIE reference to NULL DIE.

Frederic Riss via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 08:27:51 PDT 2017


friss added inline comments.


================
Comment at: test/tools/dsymutil/X86/null-die.s:10
+#   llvm-mc -triple x86_64-apple-darwin -filetype=obj -o null_die.o null_die.s
+#   ld -arch x86_64 -macosx_version_min 10.13.0 -lSystem null_die.o -o null_die
+
----------------
Do you need the final binary file? My guess is that you only need the .o file and a debug map which can be YAML. You can use 'llvm-dsymutil -dump-debug-map' on null_die to extract it.


================
Comment at: tools/dsymutil/DwarfLinker.cpp:1499
     if (const auto RefDie = RefCU->getOrigUnit().getDIEForOffset(RefOffset))
-      return RefDie;
+      if(!RefDie.isNULL())
+        return RefDie;
----------------
I would add a comment here. There is no valid reason for the DIE to be NULL. Something along the lines of "In a file with broken references, an attribute might point to a NULL DIE".


Repository:
  rL LLVM

https://reviews.llvm.org/D38078





More information about the llvm-commits mailing list