[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost
Subject:    [boost] [stacktrace] libbacktrace callback for backtrace_pcinfo invalid return value
From:       Muazin Mugadr via Boost <boost () lists ! boost ! org>
Date:       2019-01-24 16:42:57
Message-ID: 1548348084.local-641b111b-aae0-v1.5.5-b7939d38 () getmailspring ! com
[Download RAW message or body]

Hello all

See also: https://stackoverflow.com/questions/54333608/boost-stacktrace-not-demangling-names-when-cross-compiled
 I am cross compiling boost on Unix for Windows with MINGW. I am using libbacktrace \
compiled using the same toolchain from here: \
https://github.com/ianlancetaylor/libbacktrace Digging through the code of \
libbacktrace I was able to deduce that in a success case the return value of \
backtrace_pcinfo will be the return value of the callback supplied to that function \
(for DWARF search). The callback boost is giving looks like this:

inline int libbacktrace_full_callback(void *data, uintptr_t /*pc*/, const char \
*filename, int lineno, const char *function) { pc_data& d = \
*static_cast<pc_data*>(data); if (d.filename && filename) {
*d.filename = filename;
}
if (d.function && function) {
*d.function = function;
}
d.line = lineno;
return 0;
}

As you can see it will always return 0. This causes an issue with the way the \
function is called: ::backtrace_pcinfo:(
state,
reinterpret_cast<uintptr_t>(addr),
boost::stacktrace::detail::libbacktrace_full_callback,
boost::stacktrace::detail::libbacktrace_error_callback,
&data
)
> > 
> > backtrace_syminfo:(
state,
reinterpret_cast<uintptr_t>(addr),
boost::stacktrace::detail::libbacktrace_syminfo_callback,
boost::stacktrace::detail::libbacktrace_error_callback,
&data
);

If the symbol is found using backtrace_pcinfo the return value will be 0. If its not \
found it will be 0. It will always use the value provided by backtrace_syminfo. Is \
this intended? BR
Cromon


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic