llvm.org GIT mirror llvm / b40f52c
[llvm-objdump][MachO] Fix error reporting after r350848 and r350849 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350851 91177308-0d34-0410-b5e6-96231b3b80d8 Francis Visoiu Mistrih 7 months ago
2 changed file(s) with 7 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
88 UNKNOWN_FILE_TYPE_DSYM: {{.*}}llvm-objdump: error:
99
1010 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
11 NO_SUCH_FILE_DSYM: error: {{.*}}missing-dsym:
11 NO_SUCH_FILE_DSYM: error: '{{.*}}missing-dsym':
1212
1313 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
14 UNKNOWN_FILE_TYPE_DSYM_MSG: {{.*}}llvm-objdump: error:
15 UNKNOWN_FILE_TYPE_DSYM_MSG-NOT: bind.macho-x86_64
14 UNKNOWN_FILE_TYPE_DSYM_MSG: error: '{{.*}}.test'
69696969 ErrorOr> BufOrErr =
69706970 MemoryBuffer::getFileOrSTDIN(DSYMFile);
69716971 if (std::error_code EC = BufOrErr.getError()) {
6972 WithColor::error(errs(), "llvm-objdump")
6973 << DSYMFile << ": " << EC.message() << '\n';
6972 report_error(DSYMFile, errorCodeToError(EC));
69746973 return;
69756974 }
6975
69766976 Expected> DbgObjCheck =
69776977 ObjectFile::createMachOObjectFile(BufOrErr.get()->getMemBufferRef());
69786978
6979 if (Error E = DbgObjCheck.takeError())
6979 if (Error E = DbgObjCheck.takeError()) {
69806980 report_error(DSYMFile, std::move(E));
6981 return;
6982 }
69816983
69826984 DbgObj = DbgObjCheck.get().release();
69836985 // We need to keep the file alive, because we're replacing DbgObj with it.