diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-15 11:50:12 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-15 11:54:58 +0300 |
commit | 3fe8fe7f326bf1a5e5fa9caedabe2fe79f7ac10c (patch) | |
tree | 5ddb6a96bbe447eaed2dcd9667490dcbdbe51bdf /utils/enum_symbols.cpp | |
parent | DbgHelp: add more enum_* methods (diff) | |
download | winapi-debug-3fe8fe7f326bf1a5e5fa9caedabe2fe79f7ac10c.tar.gz winapi-debug-3fe8fe7f326bf1a5e5fa9caedabe2fe79f7ac10c.zip |
enum_symbols: use DbgHelp instead of Repo
Diffstat (limited to '')
-rw-r--r-- | utils/enum_symbols.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/utils/enum_symbols.cpp b/utils/enum_symbols.cpp index dad5300..87cc56a 100644 --- a/utils/enum_symbols.cpp +++ b/utils/enum_symbols.cpp @@ -5,7 +5,6 @@ #include "command_line.hpp" #include "pdb/all.hpp" -#include "pdb_descr.hpp" #include <boost/program_options.hpp> @@ -21,8 +20,9 @@ public: explicit EnumSymbols(const std::string& argv0) : SettingsParser{argv0} { namespace po = boost::program_options; - visible.add_options()( - "pdb", po::value<std::vector<PDB>>(&pdbs)->value_name("ADDR,PATH"), "load a PDB file"); + visible.add_options()("pdb", + po::value<std::vector<std::string>>(&pdbs)->value_name("PATH"), + "load a PDB file"); visible.add_options()( "functions", po::value<pdb::symbol::Tag>(&tag)->implicit_value(function_tag)->zero_tokens(), @@ -30,10 +30,10 @@ public: } const char* get_short_description() const override { - return "[-h|--help] [--pdb ADDR,PATH]... [--functions]"; + return "[-h|--help] [--pdb PATH]... [--functions]"; } - std::vector<PDB> pdbs; + std::vector<std::string> pdbs; bool type_specified() const { return tag != reserved_tag; } @@ -67,12 +67,12 @@ int main(int argc, char* argv[]) { return 0; } - pdb::Repo repo; + pdb::DbgHelp dbghelp; for (const auto& pdb : settings.pdbs) { - const auto id = repo.add_pdb(pdb.online_base, pdb.path); + const auto id = dbghelp.load_pdb(pdb); - repo.enum_symbols(id, [&](const pdb::Symbol& symbol) { + dbghelp.enum_symbols(id, [&](const pdb::SymbolInfo& symbol) { if (!settings.type_specified() || settings.get_type() == symbol.get_type()) std::cout << symbol.get_name() << '\n'; }); |