本文整理汇总了C++中rose::binaryanalysis::partitioner2::Engine::parse方法的典型用法代码示例。如果您正苦于以下问题:C++ Engine::parse方法的具体用法?C++ Engine::parse怎么用?C++ Engine::parse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rose::binaryanalysis::partitioner2::Engine
的用法示例。
在下文中一共展示了Engine::parse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runtime_error
int
main(int argc, char *argv[]) {
Diagnostics::initialize();
mlog = Sawyer::Message::Facility("tool");
Diagnostics::mfacilities.insertAndAdjust(mlog);
// Parse command-line
P2::Engine engine;
Settings settings;
std::vector<std::string> specimenNames = parseCommandLine(argc, argv, settings).unreachedArgs();
if (specimenNames.size() != 1)
throw std::runtime_error("exactly one binary specimen file should be specified; see --help");
std::string specimenName = boost::starts_with(specimenNames[0], "run:") ? specimenNames[0].substr(4) : specimenNames[0];
Stream info(mlog[INFO]);
// Parse, map, link, and/or relocate
info <<"performing parse, map, and optional link steps";
engine.parse(specimenNames);
Sawyer::Stopwatch loadTimer;
if (settings.performLink) {
BinaryLoader *loader = engine.obtainLoader();
ASSERT_not_null(loader);
loader->set_perform_dynamic_linking(true);
#if 0 // [Robb P. Matzke 2014-10-09]: not always working, but maybe not needed for this analysis
loader->set_perform_relocations(true);
#endif
BOOST_FOREACH (const std::string &paths, settings.libDirs) {
BOOST_FOREACH (const std::string &path, split(':', paths)) {
loader->add_directory(path);
}
}
}