llvm.org GIT mirror llvm / c54f433
[llvm-objdump][MachO] Correctly handle the llvm::Error when -dsym has errors In an assert build, the Error gets destroyed and we get "Program aborted due to an unhandled Error:". In release, we get an empty message. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350848 91177308-0d34-0410-b5e6-96231b3b80d8 Francis Visoiu Mistrih 7 months ago
2 changed file(s) with 6 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
33
44 RUN: not llvm-objdump -t %s 2>&1 | FileCheck %s -check-prefix=UNKNOWN_FILE_TYPE
55 UNKNOWN_FILE_TYPE: '{{.*}}invalid-input.test': The file was not recognized as a valid object file
6
7 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
8 UNKNOWN_FILE_TYPE_DSYM: {{.*}}llvm-objdump: error:
69766976 Expected> DbgObjCheck =
69776977 ObjectFile::createMachOObjectFile(BufOrErr.get()->getMemBufferRef());
69786978
6979 if (DbgObjCheck.takeError())
6980 report_error(MachOOF->getFileName(), DbgObjCheck.takeError());
6979 if (Error E = DbgObjCheck.takeError())
6980 report_error(MachOOF->getFileName(), std::move(E));
6981
69816982 DbgObj = DbgObjCheck.get().release();
69826983 // We need to keep the file alive, because we're replacing DbgObj with it.
69836984 DSYMBuf = std::move(BufOrErr.get());