From 247b513059592cbfe9ec3012aa9bc461b9899c7f Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Mon, 22 Oct 2018 15:07:00 -0400 Subject: src,win: informative stack traces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refresh `Win32SymbolDebuggingContext::LookupSymbol` to use more APIs PR-URL: https://github.com/nodejs/node/pull/23822 Refs: https://docs.microsoft.com/en-us/windows/desktop/Debug/retrieving-symbol-information-by-address Refs: https://docs.microsoft.com/en-us/windows/desktop/Debug/retrieving-undecorated-symbol-names Reviewed-By: Tobias Nießen --- src/debug_utils.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/debug_utils.h') diff --git a/src/debug_utils.h b/src/debug_utils.h index 2fd9e7dab7f..c6c8e03b51f 100644 --- a/src/debug_utils.h +++ b/src/debug_utils.h @@ -6,6 +6,7 @@ #include "async_wrap.h" #include "env.h" #include +#include // Use FORCE_INLINE on functions that have a debug-category-enabled check first // and then ideally only a single function call following it, to maintain @@ -93,14 +94,25 @@ class NativeSymbolDebuggingContext { public: std::string name; std::string filename; + size_t line = 0; + size_t dis = 0; std::string Display() const; }; + NativeSymbolDebuggingContext() = default; virtual ~NativeSymbolDebuggingContext() {} - virtual SymbolInfo LookupSymbol(void* address) { return { "", "" }; } + + virtual SymbolInfo LookupSymbol(void* address) { return {}; } virtual bool IsMapped(void* address) { return false; } virtual int GetStackTrace(void** frames, int count) { return 0; } + + NativeSymbolDebuggingContext(const NativeSymbolDebuggingContext&) = delete; + NativeSymbolDebuggingContext(NativeSymbolDebuggingContext&&) = delete; + NativeSymbolDebuggingContext operator=(NativeSymbolDebuggingContext&) + = delete; + NativeSymbolDebuggingContext operator=(NativeSymbolDebuggingContext&&) + = delete; }; // Variant of `uv_loop_close` that tries to be as helpful as possible -- cgit v1.2.3