*
*/
Disassembler * createLLVMDisassembler(const std::string& filename, InformationManager* manager) {
+ log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("disassembler.LLVMDisassembler"));
if (filename == "")
return NULL;
- std::unique_ptr<Binary> o;
- o.reset(createBinary(filename).get());
- Binary * op = o.release();
+ auto retval = createBinary(filename);
+ if (error_code ec = retval.getError()) {
+ LOG4CXX_ERROR(logger, ec.message());
+ return NULL;
+ }
+
+ Binary * op = retval.get();
+
+ if (!op) {
+ LOG4CXX_ERROR(logger, "Could not open " << filename);
+ return NULL;
+ }
// ELFType<endian, maxalign, 64bit>
if (ELF32LEObjectFile * object = dyn_cast<ELF32LEObjectFile>(op)) {