feat(inject): Use new exception handler with stacktraces
Adjust inject to utilize the new feature. This also requires including the dwarfstack.dll in all distribution packages.
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
exes += inject
|
||||
imps += dwarfstack
|
||||
|
||||
ldflags_inject := \
|
||||
-mconsole \
|
||||
-lpsapi \
|
||||
-ldbghelp \
|
||||
|
||||
libs_inject := \
|
||||
core \
|
||||
util \
|
||||
dwarfstack \
|
||||
|
||||
src_inject := \
|
||||
main.c \
|
||||
|
||||
@@ -13,9 +13,10 @@
|
||||
|
||||
#include "inject/debugger.h"
|
||||
|
||||
#include "util/debug.h"
|
||||
#include "util/log.h"
|
||||
#include "util/mem.h"
|
||||
#include "util/proc.h"
|
||||
#include "util/signal.h"
|
||||
#include "util/str.h"
|
||||
|
||||
#define MM_ALLOCATION_GRANULARITY 0x10000
|
||||
@@ -275,7 +276,7 @@ static uint32_t debugger_loop()
|
||||
"EXCEPTION_DEBUG_EVENT(pid %ld, tid %ld): x%s 0x%p",
|
||||
de.dwProcessId,
|
||||
de.dwThreadId,
|
||||
signal_exception_code_to_str(
|
||||
debug_exception_code_to_str(
|
||||
de.u.Exception.ExceptionRecord.ExceptionCode),
|
||||
de.u.Exception.ExceptionRecord.ExceptionAddress);
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#include "inject/version.h"
|
||||
|
||||
#include "util/cmdline.h"
|
||||
#include "util/debug.h"
|
||||
#include "util/log.h"
|
||||
#include "util/mem.h"
|
||||
#include "util/os.h"
|
||||
#include "util/signal.h"
|
||||
@@ -222,6 +224,7 @@ int main(int argc, char **argv)
|
||||
|
||||
os_version_log();
|
||||
|
||||
debug_init();
|
||||
signal_exception_handler_init();
|
||||
// Cleanup remote process on CTRL+C
|
||||
signal_register_shutdown_handler(signal_shutdown_handler);
|
||||
|
||||
Reference in New Issue
Block a user