diff --git a/include/cpptrace/cpptrace.hpp b/include/cpptrace/cpptrace.hpp index ba13d05..1b594c9 100644 --- a/include/cpptrace/cpptrace.hpp +++ b/include/cpptrace/cpptrace.hpp @@ -56,8 +56,8 @@ namespace cpptrace { struct CPPTRACE_EXPORT object_frame { std::string obj_path; std::string symbol; - frame_ptr raw_address = 0; - frame_ptr obj_address = 0; + frame_ptr raw_address; + frame_ptr obj_address; }; struct CPPTRACE_EXPORT object_trace { @@ -193,8 +193,8 @@ namespace cpptrace { std::size_t max_depth ); struct CPPTRACE_EXPORT minimal_object_frame { - frame_ptr raw_address = 0; - frame_ptr address_relative_to_object_base_in_memory = 0; + frame_ptr raw_address; + frame_ptr address_relative_to_object_base_in_memory; char object_path[CPPTRACE_PATH_MAX + 1]; // To be called outside a signal handler. Not signal safe. object_frame resolve() const; diff --git a/src/binary/object.hpp b/src/binary/object.hpp index 5c96932..7c59a17 100644 --- a/src/binary/object.hpp +++ b/src/binary/object.hpp @@ -70,6 +70,7 @@ namespace detail { Dl_info info; object_frame frame; frame.raw_address = addr; + frame.obj_address = 0; if(dladdr(reinterpret_cast(addr), &info)) { // thread safe // dli_sname and dli_saddr are only present with -rdynamic, sname will be included // but we don't really need dli_saddr @@ -129,6 +130,7 @@ namespace detail { for(const frame_ptr addr : addrs) { object_frame frame; frame.raw_address = addr; + frame.obj_address = 0; HMODULE handle; // Multithread safe as long as another thread doesn't come along and free the module if(GetModuleHandleExA( @@ -150,7 +152,7 @@ namespace detail { #endif inline object_frame resolve_minimal_object_frame(const minimal_object_frame& frame) { - return object_frame { + return { frame.object_path, "", frame.raw_address,