aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/dbghelp.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-01-15 19:20:50 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-01-16 01:21:32 +0300
commit3dc0b9a3ae90dcac2f1150e6b2dfb0a5a310355b (patch)
treefca7da94fdc0f4693a8b49b765738b9e842a1407 /src/dbghelp.cpp
parentlab_rat -> foobar (diff)
downloadwinapi-debug-3dc0b9a3ae90dcac2f1150e6b2dfb0a5a310355b.tar.gz
winapi-debug-3dc0b9a3ae90dcac2f1150e6b2dfb0a5a310355b.zip
add call stack collection support
Diffstat (limited to '')
-rw-r--r--src/dbghelp.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dbghelp.cpp b/src/dbghelp.cpp
index 399271e..0105682 100644
--- a/src/dbghelp.cpp
+++ b/src/dbghelp.cpp
@@ -23,10 +23,10 @@ void set_dbghelp_options() {
SymSetOptions(SymGetOptions() | SYMOPT_DEBUG | SYMOPT_LOAD_LINES | SYMOPT_UNDNAME);
}
-void initialize(HANDLE id) {
+void initialize(HANDLE id, bool invade_current_process) {
set_dbghelp_options();
- if (!SymInitialize(id, NULL, FALSE))
+ if (!SymInitialize(id, NULL, invade_current_process ? TRUE : FALSE))
throw error::windows(GetLastError());
}
@@ -87,8 +87,8 @@ void enum_symbols(HANDLE id,
} // namespace
-DbgHelp::DbgHelp() {
- initialize(id);
+DbgHelp::DbgHelp(bool invade_current_process) {
+ initialize(id, invade_current_process);
}
DbgHelp::~DbgHelp() {
@@ -132,6 +132,10 @@ void DbgHelp::enum_modules(const OnModule& callback) const {
throw error::windows(GetLastError());
}
+ModuleInfo DbgHelp::resolve_module(Address offline) const {
+ return get_module_info(id, offline);
+}
+
void DbgHelp::enum_symbols(const ModuleInfo& module,
const std::string& mask,
const OnSymbol& callback) const {