llvm.org GIT mirror llvm / 74733b9
[llvm-objdump][MachO] Use the -dsym file name when reporting errors Instead of using the binary filename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350849 91177308-0d34-0410-b5e6-96231b3b80d8 Francis Visoiu Mistrih 7 months ago
2 changed file(s) with 9 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
66
77 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
88 UNKNOWN_FILE_TYPE_DSYM: {{.*}}llvm-objdump: error:
9
10 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:
12
13 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
69706970 MemoryBuffer::getFileOrSTDIN(DSYMFile);
69716971 if (std::error_code EC = BufOrErr.getError()) {
69726972 WithColor::error(errs(), "llvm-objdump")
6973 << Filename << ": " << EC.message() << '\n';
6973 << DSYMFile << ": " << EC.message() << '\n';
69746974 return;
69756975 }
69766976 Expected> DbgObjCheck =
69776977 ObjectFile::createMachOObjectFile(BufOrErr.get()->getMemBufferRef());
69786978
69796979 if (Error E = DbgObjCheck.takeError())
6980 report_error(MachOOF->getFileName(), std::move(E));
6980 report_error(DSYMFile, std::move(E));
69816981
69826982 DbgObj = DbgObjCheck.get().release();
69836983 // We need to keep the file alive, because we're replacing DbgObj with it.