aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/enum_symbols.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/utils/enum_symbols.cpp b/utils/enum_symbols.cpp
index 87cc56a..d7f4c37 100644
--- a/utils/enum_symbols.cpp
+++ b/utils/enum_symbols.cpp
@@ -27,10 +27,12 @@ public:
"functions",
po::value<pdb::symbol::Tag>(&tag)->implicit_value(function_tag)->zero_tokens(),
"only list functions");
+ visible.add_options()(
+ "mask", po::value<std::string>(&symbol_mask)->value_name("MASK"), "symbol mask");
}
const char* get_short_description() const override {
- return "[-h|--help] [--pdb PATH]... [--functions]";
+ return "[-h|--help] [--pdb PATH]... [--functions] [--mask MASK]";
}
std::vector<std::string> pdbs;
@@ -39,11 +41,14 @@ public:
pdb::Symbol::Type get_type() const { return static_cast<pdb::Symbol::Type>(tag); }
+ std::string get_mask() const { return symbol_mask; }
+
private:
static constexpr auto reserved_tag = static_cast<pdb::symbol::Tag>(pdb::Symbol::Type::RESERVED);
static constexpr auto function_tag = static_cast<pdb::symbol::Tag>(pdb::Symbol::Type::Function);
pdb::symbol::Tag tag = reserved_tag;
+ std::string symbol_mask{pdb::DbgHelp::all_symbols};
};
constexpr pdb::symbol::Tag EnumSymbols::reserved_tag;
@@ -72,7 +77,7 @@ int main(int argc, char* argv[]) {
for (const auto& pdb : settings.pdbs) {
const auto id = dbghelp.load_pdb(pdb);
- dbghelp.enum_symbols(id, [&](const pdb::SymbolInfo& symbol) {
+ dbghelp.enum_symbols(id, settings.get_mask(), [&](const pdb::SymbolInfo& symbol) {
if (!settings.type_specified() || settings.get_type() == symbol.get_type())
std::cout << symbol.get_name() << '\n';
});