mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
[llvm-objdump][MachO] Fix error reporting after r350848 and r350849
llvm-svn: 350851
This commit is contained in:
parent
9dbec100d3
commit
92f3fd2a98
@ -9,8 +9,7 @@ RUN: not llvm-objdump -macho -disassemble -g -dsym=%s %p/Inputs/bind.macho-x86_6
|
|||||||
UNKNOWN_FILE_TYPE_DSYM: {{.*}}llvm-objdump: error:
|
UNKNOWN_FILE_TYPE_DSYM: {{.*}}llvm-objdump: error:
|
||||||
|
|
||||||
RUN: not llvm-objdump -macho -disassemble -g -dsym=%p/missing-dsym %p/Inputs/bind.macho-x86_64 2>&1 | FileCheck %s -check-prefix=NO_SUCH_FILE_DSYM
|
RUN: not llvm-objdump -macho -disassemble -g -dsym=%p/missing-dsym %p/Inputs/bind.macho-x86_64 2>&1 | FileCheck %s -check-prefix=NO_SUCH_FILE_DSYM
|
||||||
NO_SUCH_FILE_DSYM: error: {{.*}}missing-dsym:
|
NO_SUCH_FILE_DSYM: error: '{{.*}}missing-dsym':
|
||||||
|
|
||||||
RUN: not llvm-objdump -macho -disassemble -g -dsym=%s %p/Inputs/bind.macho-x86_64 2>&1 | FileCheck %s -check-prefix=UNKNOWN_FILE_TYPE_DSYM_MSG
|
RUN: not llvm-objdump -macho -disassemble -g -dsym=%s %p/Inputs/bind.macho-x86_64 2>&1 | FileCheck %s -check-prefix=UNKNOWN_FILE_TYPE_DSYM_MSG
|
||||||
UNKNOWN_FILE_TYPE_DSYM_MSG: {{.*}}llvm-objdump: error:
|
UNKNOWN_FILE_TYPE_DSYM_MSG: error: '{{.*}}.test'
|
||||||
UNKNOWN_FILE_TYPE_DSYM_MSG-NOT: bind.macho-x86_64
|
|
||||||
|
@ -6970,15 +6970,17 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF,
|
|||||||
ErrorOr<std::unique_ptr<MemoryBuffer>> BufOrErr =
|
ErrorOr<std::unique_ptr<MemoryBuffer>> BufOrErr =
|
||||||
MemoryBuffer::getFileOrSTDIN(DSYMFile);
|
MemoryBuffer::getFileOrSTDIN(DSYMFile);
|
||||||
if (std::error_code EC = BufOrErr.getError()) {
|
if (std::error_code EC = BufOrErr.getError()) {
|
||||||
WithColor::error(errs(), "llvm-objdump")
|
report_error(DSYMFile, errorCodeToError(EC));
|
||||||
<< DSYMFile << ": " << EC.message() << '\n';
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Expected<std::unique_ptr<MachOObjectFile>> DbgObjCheck =
|
Expected<std::unique_ptr<MachOObjectFile>> DbgObjCheck =
|
||||||
ObjectFile::createMachOObjectFile(BufOrErr.get()->getMemBufferRef());
|
ObjectFile::createMachOObjectFile(BufOrErr.get()->getMemBufferRef());
|
||||||
|
|
||||||
if (Error E = DbgObjCheck.takeError())
|
if (Error E = DbgObjCheck.takeError()) {
|
||||||
report_error(DSYMFile, std::move(E));
|
report_error(DSYMFile, std::move(E));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DbgObj = DbgObjCheck.get().release();
|
DbgObj = DbgObjCheck.get().release();
|
||||||
// We need to keep the file alive, because we're replacing DbgObj with it.
|
// We need to keep the file alive, because we're replacing DbgObj with it.
|
||||||
|
Loading…
Reference in New Issue
Block a user