From faf49e9485927985ee6ecff24eaf285fbab4b218 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 6 Jun 2026 00:20:41 +0200 Subject: minor fixes --- 3rdparty/winapi/common | 2 +- include/winapi/debug/module.hpp | 2 +- include/winapi/debug/post_mortem.hpp | 2 +- src/call_stack.cpp | 2 +- utils/addr2name.cpp | 2 +- utils/command_line.hpp | 5 +++-- utils/enum_symbols.cpp | 2 +- utils/name2addr.cpp | 2 +- utils/pdb_descr.hpp | 1 - 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/3rdparty/winapi/common b/3rdparty/winapi/common index 0cf7efe..baf3732 160000 --- a/3rdparty/winapi/common +++ b/3rdparty/winapi/common @@ -1 +1 @@ -Subproject commit 0cf7efefba6c3a23d7eecdf2790b55ab7cd0dc38 +Subproject commit baf3732247886f0e055708b580b6e8c2ab52af6d diff --git a/include/winapi/debug/module.hpp b/include/winapi/debug/module.hpp index 020219f..0437ddb 100644 --- a/include/winapi/debug/module.hpp +++ b/include/winapi/debug/module.hpp @@ -48,7 +48,7 @@ private: std::string invalid_offline_address(Address offline) const; std::string invalid_online_address(Address online) const; - const Address online_base; + Address online_base; }; } // namespace winapi diff --git a/include/winapi/debug/post_mortem.hpp b/include/winapi/debug/post_mortem.hpp index b031bbf..2b6e5e0 100644 --- a/include/winapi/debug/post_mortem.hpp +++ b/include/winapi/debug/post_mortem.hpp @@ -48,7 +48,7 @@ private: Address address_offline_to_online(Address) const; Address address_online_to_offline(Address) const; - const DbgHelp dbghelp{DbgHelp::post_mortem()}; + DbgHelp dbghelp{DbgHelp::post_mortem()}; std::unordered_set file_ids; std::map online_bases; diff --git a/src/call_stack.cpp b/src/call_stack.cpp index b79a32b..b74a9a0 100644 --- a/src/call_stack.cpp +++ b/src/call_stack.cpp @@ -106,7 +106,7 @@ std::string CallStack::pretty_print_address(const DbgHelp& dbghelp, Address addr void CallStack::dump(std::ostream& os, const DbgHelp& dbghelp) const { for_each_address([&](Address addr) { - os << address::format(addr) << ' ' << pretty_print_address(dbghelp, addr) << '\n'; + os << std::format("{} {}\n", address::format(addr), pretty_print_address(dbghelp, addr)); return true; }); } diff --git a/utils/addr2name.cpp b/utils/addr2name.cpp index 4f1f686..98b53b9 100644 --- a/utils/addr2name.cpp +++ b/utils/addr2name.cpp @@ -57,7 +57,7 @@ std::string format_line_info(const winapi::LineInfo& line_info) { } void dump_error(const std::exception& e) { - std::cerr << "error: " << e.what() << '\n'; + std::cerr << std::format("error: {}\n", e.what()); } void resolve_symbol(const winapi::PostMortem& analysis, diff --git a/utils/command_line.hpp b/utils/command_line.hpp index 8f4b949..ebed79e 100644 --- a/utils/command_line.hpp +++ b/utils/command_line.hpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -43,7 +44,7 @@ public: void usage() const { std::cout << *this; } void usage_error(const std::exception& e) const { - std::cerr << "usage error: " << e.what() << '\n'; + std::cerr << std::format("usage error: {}\n", e.what()); std::cerr << *this; } @@ -61,7 +62,7 @@ private: friend std::ostream& operator<<(std::ostream& os, const SettingsParser& parser) { const auto short_descr = parser.get_short_description(); - os << "usage: " << parser.prog_name << ' ' << short_descr << '\n'; + os << std::format("usage: {} {}\n", parser.prog_name, short_descr); os << parser.visible; return os; } diff --git a/utils/enum_symbols.cpp b/utils/enum_symbols.cpp index 4950a82..574f0d0 100644 --- a/utils/enum_symbols.cpp +++ b/utils/enum_symbols.cpp @@ -86,7 +86,7 @@ int main(int argc, char* argv[]) { }); } } catch (const std::exception& e) { - std::cerr << "error: " << e.what() << '\n'; + std::cerr << std::format("error: {}\n", e.what()); return 1; } return 0; diff --git a/utils/name2addr.cpp b/utils/name2addr.cpp index d17919b..d253aa9 100644 --- a/utils/name2addr.cpp +++ b/utils/name2addr.cpp @@ -40,7 +40,7 @@ public: }; void dump_error(const std::exception& e) { - std::cerr << "error: " << e.what() << '\n'; + std::cerr << std::format("error: {}\n", e.what()); } void resolve_symbol(const winapi::PostMortem& analysis, std::string_view name) { diff --git a/utils/pdb_descr.hpp b/utils/pdb_descr.hpp index e86135e..c2e720a 100644 --- a/utils/pdb_descr.hpp +++ b/utils/pdb_descr.hpp @@ -10,7 +10,6 @@ #include #include -#include #include struct PDB { -- cgit v1.3