diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-05-19 05:31:58 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-05-19 05:31:58 +0300 |
commit | a8d767a99e4c09975503e092ee4674962b27c3ce (patch) | |
tree | 0d341e027a980981e8d719133f785d1eb5dbd702 /utils/addr2name.cpp | |
parent | add displacement to symbols (diff) | |
download | winapi-debug-a8d767a99e4c09975503e092ee4674962b27c3ce.tar.gz winapi-debug-a8d767a99e4c09975503e092ee4674962b27c3ce.zip |
refactoring
Diffstat (limited to 'utils/addr2name.cpp')
-rw-r--r-- | utils/addr2name.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/utils/addr2name.cpp b/utils/addr2name.cpp index 9719b60..a564e42 100644 --- a/utils/addr2name.cpp +++ b/utils/addr2name.cpp @@ -12,6 +12,7 @@ #include <exception> #include <iostream> +#include <sstream> #include <string> #include <vector> @@ -65,20 +66,13 @@ namespace bool help_flag = false; }; - std::string format_address(pdb::Address address) - { - std::ostringstream oss; - oss << std::showbase << std::hex << address; - 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); + oss << '+' << pdb::format_address(displacement); return oss.str(); } @@ -96,7 +90,7 @@ namespace catch (const std::exception& e) { dump_error(e); - std::cout << format_address(address) << '\n'; + std::cout << pdb::format_address(address) << '\n'; } } } |