From f3bac940189c50e7fc2bdb8743a6524e5afa74fd Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 20 May 2017 19:35:37 +0300 Subject: addr2name: include module names --- utils/addr2name.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'utils') diff --git a/utils/addr2name.cpp b/utils/addr2name.cpp index 5342705..d611bac 100644 --- a/utils/addr2name.cpp +++ b/utils/addr2name.cpp @@ -65,10 +65,10 @@ namespace bool help_flag = false; }; - std::string format_symbol(const pdb::Symbol& symbol) + std::string format_symbol(const pdb::Module& module, const pdb::Symbol& symbol) { std::ostringstream oss; - oss << symbol.get_name(); + oss << module.get_name() << '!' << symbol.get_name(); const auto displacement = symbol.get_displacement(); if (displacement) oss << '+' << pdb::format_address(displacement); @@ -84,7 +84,9 @@ namespace { try { - std::cout << format_symbol(repo.resolve_symbol(address)) << '\n'; + const auto symbol = repo.resolve_symbol(address); + const auto& module = repo.module_with_offline_base(symbol.get_offline_base()); + std::cout << format_symbol(module, symbol) << '\n'; } catch (const std::exception& e) { -- cgit v1.2.3