diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-05-19 05:02:06 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-05-19 05:02:06 +0300 |
commit | 8e646ba31d9023db342ec0deae59abfc5683b4ef (patch) | |
tree | 560fd0c3ed88216134cbf5b1ec0b6c6ccbd8ce6a /utils | |
parent | initial commit (diff) | |
download | winapi-debug-8e646ba31d9023db342ec0deae59abfc5683b4ef.tar.gz winapi-debug-8e646ba31d9023db342ec0deae59abfc5683b4ef.zip |
add displacement to symbols
Diffstat (limited to '')
-rw-r--r-- | utils/addr2name.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/utils/addr2name.cpp b/utils/addr2name.cpp index a01f61e..9719b60 100644 --- a/utils/addr2name.cpp +++ b/utils/addr2name.cpp @@ -72,6 +72,16 @@ namespace return oss.str(); } + std::string format_symbol(const pdb::Symbol& symbol) + { + std::ostringstream oss; + oss << symbol.get_name(); + const auto displacement = symbol.get_displacement(); + if (displacement) + oss << '+' << format_address(displacement); + return oss.str(); + } + void dump_error(const std::exception& e) { std::cerr << "error: " << e.what() << '\n'; @@ -81,7 +91,7 @@ namespace { try { - std::cout << repo.resolve_symbol(address).get_name() << '\n'; + std::cout << format_symbol(repo.resolve_symbol(address)) << '\n'; } catch (const std::exception& e) { |