aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/utils
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-05-29 01:24:29 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-05-29 01:27:53 +0300
commite162f2a21632e3f7b1c7ab9dd7b530beb1f2d4a8 (patch)
tree65199bce3779ff1800821c6b1c6bc0bc4592e66c /utils
parentnamespace pdb -> namespace winapi (diff)
downloadwinapi-debug-e162f2a21632e3f7b1c7ab9dd7b530beb1f2d4a8.tar.gz
winapi-debug-e162f2a21632e3f7b1c7ab9dd7b530beb1f2d4a8.zip
rename class Repo to PostMortem
Diffstat (limited to '')
-rw-r--r--utils/addr2name.cpp16
-rw-r--r--utils/name2addr.cpp10
2 files changed, 14 insertions, 12 deletions
diff --git a/utils/addr2name.cpp b/utils/addr2name.cpp
index 611e02b..5a8cbc3 100644
--- a/utils/addr2name.cpp
+++ b/utils/addr2name.cpp
@@ -62,17 +62,19 @@ void dump_error(const std::exception& e) {
std::cerr << "error: " << e.what() << '\n';
}
-void resolve_symbol(const winapi::Repo& repo, winapi::Address address, bool lines = false) {
+void resolve_symbol(const winapi::PostMortem& analysis,
+ winapi::Address address,
+ bool lines = false) {
try {
- const auto symbol = repo.resolve_symbol(address);
- const auto& module = repo.module_with_offline_base(symbol.get_offline_base());
+ const auto symbol = analysis.resolve_symbol(address);
+ const auto& module = analysis.module_with_offline_base(symbol.get_offline_base());
std::ostringstream msg;
msg << format_symbol(module, symbol);
if (lines) {
try {
- const auto line_info = repo.resolve_line(address);
+ const auto line_info = analysis.resolve_line(address);
msg << ' ' << format_line_info(line_info);
} catch (const std::exception& e) {
dump_error(e);
@@ -104,13 +106,13 @@ int main(int argc, char* argv[]) {
return 0;
}
- winapi::Repo repo;
+ winapi::PostMortem analysis;
for (const auto& pdb : settings.pdbs)
- repo.add_pdb(pdb.online_base, pdb.path);
+ analysis.add_pdb(pdb.online_base, pdb.path);
for (const auto& address : settings.addresses)
- resolve_symbol(repo, address, settings.lines);
+ resolve_symbol(analysis, address, settings.lines);
} catch (const std::exception& e) {
dump_error(e);
return 1;
diff --git a/utils/name2addr.cpp b/utils/name2addr.cpp
index db07c3a..c113a9a 100644
--- a/utils/name2addr.cpp
+++ b/utils/name2addr.cpp
@@ -42,9 +42,9 @@ void dump_error(const std::exception& e) {
std::cerr << "error: " << e.what() << '\n';
}
-void resolve_symbol(const winapi::Repo& repo, const std::string& name) {
+void resolve_symbol(const winapi::PostMortem& analysis, const std::string& name) {
try {
- const auto address = repo.resolve_symbol(name).get_online_address();
+ const auto address = analysis.resolve_symbol(name).get_online_address();
std::cout << winapi::format_address(address) << '\n';
} catch (const std::exception& e) {
dump_error(e);
@@ -70,13 +70,13 @@ int main(int argc, char* argv[]) {
return 0;
}
- winapi::Repo repo;
+ winapi::PostMortem analysis;
for (const auto& pdb : settings.pdbs)
- repo.add_pdb(pdb.online_base, pdb.path);
+ analysis.add_pdb(pdb.online_base, pdb.path);
for (const auto& name : settings.names)
- resolve_symbol(repo, name);
+ resolve_symbol(analysis, name);
} catch (const std::exception& e) {
dump_error(e);
return 1;