Really fix it this time
This commit is contained in:
parent
f4237c75df
commit
ac7db48cef
@ -56,8 +56,8 @@ namespace cpptrace {
|
|||||||
struct CPPTRACE_EXPORT object_frame {
|
struct CPPTRACE_EXPORT object_frame {
|
||||||
std::string obj_path;
|
std::string obj_path;
|
||||||
std::string symbol;
|
std::string symbol;
|
||||||
frame_ptr raw_address = 0;
|
frame_ptr raw_address;
|
||||||
frame_ptr obj_address = 0;
|
frame_ptr obj_address;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CPPTRACE_EXPORT object_trace {
|
struct CPPTRACE_EXPORT object_trace {
|
||||||
@ -193,8 +193,8 @@ namespace cpptrace {
|
|||||||
std::size_t max_depth
|
std::size_t max_depth
|
||||||
);
|
);
|
||||||
struct CPPTRACE_EXPORT minimal_object_frame {
|
struct CPPTRACE_EXPORT minimal_object_frame {
|
||||||
frame_ptr raw_address = 0;
|
frame_ptr raw_address;
|
||||||
frame_ptr address_relative_to_object_base_in_memory = 0;
|
frame_ptr address_relative_to_object_base_in_memory;
|
||||||
char object_path[CPPTRACE_PATH_MAX + 1];
|
char object_path[CPPTRACE_PATH_MAX + 1];
|
||||||
// To be called outside a signal handler. Not signal safe.
|
// To be called outside a signal handler. Not signal safe.
|
||||||
object_frame resolve() const;
|
object_frame resolve() const;
|
||||||
|
|||||||
@ -70,6 +70,7 @@ namespace detail {
|
|||||||
Dl_info info;
|
Dl_info info;
|
||||||
object_frame frame;
|
object_frame frame;
|
||||||
frame.raw_address = addr;
|
frame.raw_address = addr;
|
||||||
|
frame.obj_address = 0;
|
||||||
if(dladdr(reinterpret_cast<void*>(addr), &info)) { // thread safe
|
if(dladdr(reinterpret_cast<void*>(addr), &info)) { // thread safe
|
||||||
// dli_sname and dli_saddr are only present with -rdynamic, sname will be included
|
// dli_sname and dli_saddr are only present with -rdynamic, sname will be included
|
||||||
// but we don't really need dli_saddr
|
// but we don't really need dli_saddr
|
||||||
@ -129,6 +130,7 @@ namespace detail {
|
|||||||
for(const frame_ptr addr : addrs) {
|
for(const frame_ptr addr : addrs) {
|
||||||
object_frame frame;
|
object_frame frame;
|
||||||
frame.raw_address = addr;
|
frame.raw_address = addr;
|
||||||
|
frame.obj_address = 0;
|
||||||
HMODULE handle;
|
HMODULE handle;
|
||||||
// Multithread safe as long as another thread doesn't come along and free the module
|
// Multithread safe as long as another thread doesn't come along and free the module
|
||||||
if(GetModuleHandleExA(
|
if(GetModuleHandleExA(
|
||||||
@ -150,7 +152,7 @@ namespace detail {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline object_frame resolve_minimal_object_frame(const minimal_object_frame& frame) {
|
inline object_frame resolve_minimal_object_frame(const minimal_object_frame& frame) {
|
||||||
return object_frame {
|
return {
|
||||||
frame.object_path,
|
frame.object_path,
|
||||||
"",
|
"",
|
||||||
frame.raw_address,
|
frame.raw_address,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user