X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2FBinary.cxx;h=f4e00a3f33cff31bab55686594973a94e0590da3;hp=1d64b8445a0ef80bfcdfd3d87d1aa90302d8c6c5;hb=05fded85315e1977895450456f77d740770d2a9c;hpb=8dad2658cea308b46d461f54743d8603eaf3223d diff --git a/src/Binary.cxx b/src/Binary.cxx index 1d64b84..f4e00a3 100644 --- a/src/Binary.cxx +++ b/src/Binary.cxx @@ -56,8 +56,8 @@ namespace { std::map readSections(const ObjectFile& o) { error_code ec; std::map result; - section_iterator i(o.begin_sections()), e(o.end_sections()); - for (; i != e; i.increment(ec)) { + section_iterator i(o.section_begin()), e(o.section_end()); + for (; i != e; ++i) { StringRef name; if (error(i->getName(name))) break; @@ -69,8 +69,8 @@ namespace { std::map readSymbols(const ObjectFile& o) { error_code ec; std::map result; - symbol_iterator si(o.begin_symbols()), se(o.end_symbols()); - for (; si != se; si.increment(ec)) { + symbol_iterator si(o.symbol_begin()), se(o.symbol_end()); + for (; si != se; ++si) { StringRef name; if (error(si->getName(name))) break; @@ -88,13 +88,13 @@ namespace qtlldb { ::Disassembler d(filename); std::string error; - createBinary(filename, binary); - if (Archive *a = dyn_cast(binary.get())) { + binary = createBinary(filename).get(); + if (Archive *a = dyn_cast(binary)) { std::cerr << "Got an archive!" << std::endl; return; } - o = dyn_cast(binary.get()); + o = dyn_cast(binary); triple.setArch(Triple::ArchType(o->getArch())); std::string tripleName(triple.getTriple()); @@ -195,7 +195,7 @@ namespace qtlldb { if (symbols.end() != symbols.find(function)) { SymbolRef ref; - section_iterator sec(o->begin_sections()); + section_iterator sec(o->section_begin()); ref = symbols.at(function); if (error(ref.getSection(sec))) return; @@ -268,9 +268,9 @@ namespace qtlldb { void Binary::disassemble_functions() { error_code ec; - for (section_iterator i = o->begin_sections(), - e = o->end_sections(); - i != e; i.increment(ec)) { + for (section_iterator i = o->section_begin(), + e = o->section_end(); + i != e; ++i) { if (error(ec)) break; bool text; if (error(i->isText(text))) break; @@ -281,9 +281,9 @@ namespace qtlldb { // Make a list of all the symbols in this section. std::vector > Symbols; - for (symbol_iterator si = o->begin_symbols(), - se = o->end_symbols(); - si != se; si.increment(ec)) { + for (symbol_iterator si = o->symbol_begin(), + se = o->symbol_end(); + si != se; ++si) { bool contains; if (!error(i->containsSymbol(*si, contains)) && contains) { uint64_t Address; @@ -364,7 +364,7 @@ namespace qtlldb { outs() << '\n' << Symbols[si].second << ":\n"; #ifndef NDEBUG - raw_ostream &DebugOut = DebugFlag ? dbgs() : nulls(); + raw_ostream &DebugOut = nulls(); //DebugFlag ? dbgs() : nulls(); #else raw_ostream &DebugOut = nulls(); #endif