[PATCH] D51365: [llvm-objdump] Keep the memory buffer from the dSYM alive when using -g -dsym
Francis Visoiu Mistrih via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 31 06:13:34 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL341209: [llvm-objdump] Keep the memory buffer from the dSYM alive when using -g -dsym (authored by thegameg, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D51365?vs=163381&id=163518#toc
Repository:
rL LLVM
https://reviews.llvm.org/D51365
Files:
llvm/trunk/test/tools/llvm-objdump/X86/macho-disassembly-g-dsym.test
llvm/trunk/tools/llvm-objdump/MachODump.cpp
Index: llvm/trunk/test/tools/llvm-objdump/X86/macho-disassembly-g-dsym.test
===================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/macho-disassembly-g-dsym.test
+++ llvm/trunk/test/tools/llvm-objdump/X86/macho-disassembly-g-dsym.test
@@ -0,0 +1,4 @@
+// RUN: dsymutil -f -oso-prepend-path=%p/../../dsymutil/ %p/../../dsymutil/Inputs/basic.macho.x86_64 -o %t1.dSYM
+// RUN: llvm-objdump -d -g -dsym=%t1.dSYM %p/../../dsymutil/Inputs/basic.macho.x86_64 | FileCheck %s
+
+CHECK: Disassembly of section __TEXT,__text:
Index: llvm/trunk/tools/llvm-objdump/MachODump.cpp
===================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp
@@ -6947,6 +6947,7 @@
std::unique_ptr<DIContext> diContext;
ObjectFile *DbgObj = MachOOF;
+ std::unique_ptr<MemoryBuffer> DSYMBuf;
// Try to find debug info and set up the DIContext for it.
if (UseDbg) {
// A separate DSym file path was specified, parse it as a macho file,
@@ -6964,6 +6965,8 @@
if (DbgObjCheck.takeError())
report_error(MachOOF->getFileName(), DbgObjCheck.takeError());
DbgObj = DbgObjCheck.get().release();
+ // We need to keep the file alive, because we're replacing DbgObj with it.
+ DSYMBuf = std::move(BufOrErr.get());
}
// Setup the DIContext
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51365.163518.patch
Type: text/x-patch
Size: 1417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180831/5b1255c9/attachment.bin>
More information about the llvm-commits
mailing list