]>
git.siccegge.de Git - frida/frida.git/blob - src/disassembler.old/Target.cxx
5 Target::Target(llvm::object::Binary
* binary
)
6 : _logger(log4cxx::Logger::getLogger("disassembler.Target"))
7 , triple("unknown-unknown-unknown")
10 llvm::object::ObjectFile
* o
= llvm::dyn_cast
<llvm::object::ObjectFile
>(binary
);
12 triple
.setArch(llvm::Triple::ArchType(o
->getArch()));
13 std::string
tripleName(triple
.getTriple());
14 LOG4CXX_INFO(_logger
, "Detected triple " << tripleName
);
16 target
= llvm::TargetRegistry::lookupTarget("", triple
, error
);
18 LOG4CXX_ERROR(_logger
, "Couldn't create Target: " << error
);
21 LOG4CXX_INFO(_logger
, "Target: " << target
->getName());
23 STI
.reset(target
->createMCSubtargetInfo(tripleName
, "", ""));
25 LOG4CXX_ERROR(_logger
, "No subtarget for target " << tripleName
);