- Use a type hiding the vector
- Remove a deprecated function that nobody uses
This is the first step toward the rewriting of the backtraces. My
motivation is that our ugly hack with addr2line is not working anymore
on my Debian while boost::stacktrace entered testing. I plan to
convert to that new system.
SG_BEGIN_DECL()
XBT_PUBLIC_DATA int xbt_log_no_loc; /* Do not show the backtrace on failed backtrace when doing our tests */
SG_BEGIN_DECL()
XBT_PUBLIC_DATA int xbt_log_no_loc; /* Do not show the backtrace on failed backtrace when doing our tests */
+XBT_PUBLIC void xbt_backtrace_display_current();
+
/**
* @addtogroup XBT_error
* @brief Those are the SimGrid version of the good ol' assert macro.
/**
* @addtogroup XBT_error
* @brief Those are the SimGrid version of the good ol' assert macro.
XBT_PUBLIC std::unique_ptr<char, void (*)(void*)> demangle(const char* name);
/** Get the current backtrace */
XBT_PUBLIC std::unique_ptr<char, void (*)(void*)> demangle(const char* name);
/** Get the current backtrace */
-XBT_PUBLIC std::vector<xbt_backtrace_location_t> backtrace();
+XBT_PUBLIC Backtrace backtrace();
/* Translate the backtrace in a human friendly form
*
* Try resolve symbols and source code location.
*/
XBT_PUBLIC std::vector<std::string> resolve_backtrace(xbt_backtrace_location_t const* loc, std::size_t count);
/* Translate the backtrace in a human friendly form
*
* Try resolve symbols and source code location.
*/
XBT_PUBLIC std::vector<std::string> resolve_backtrace(xbt_backtrace_location_t const* loc, std::size_t count);
-XBT_ATTRIB_DEPRECATED_v323("Please use xbt::resolve_backtrace()") XBT_PUBLIC std::vector<std::string> resolveBacktrace(xbt_backtrace_location_t const* loc, std::size_t count);
-XBT_PUBLIC void xbt_backtrace_display_current();
-
/** @brief Like malloc, but xbt_die() on error
@hideinitializer */
static XBT_ALWAYS_INLINE void *xbt_malloc(size_t n) {
/** @brief Like malloc, but xbt_die() on error
@hideinitializer */
static XBT_ALWAYS_INLINE void *xbt_malloc(size_t n) {
return std::unique_ptr<char, void(*)(void*)>(xbt_strdup(name), std::free);
}
return std::unique_ptr<char, void(*)(void*)>(xbt_strdup(name), std::free);
}
-std::vector<xbt_backtrace_location_t> backtrace()
{
const std::size_t size = 10;
xbt_backtrace_location_t loc[size];
size_t used = xbt_backtrace_current(loc, size);
{
const std::size_t size = 10;
xbt_backtrace_location_t loc[size];
size_t used = xbt_backtrace_current(loc, size);
- return std::vector<xbt_backtrace_location_t>(loc, loc + used);
+ return Backtrace(loc, loc + used);
namespace simgrid {
namespace xbt {
namespace simgrid {
namespace xbt {
-std::vector<std::string> resolveBacktrace(xbt_backtrace_location_t const* loc, std::size_t count) // deprecated
-{
- return resolve_backtrace(loc, count);
-}
-
std::vector<std::string> resolve_backtrace(xbt_backtrace_location_t const* loc, std::size_t count)
{
return std::vector<std::string>();
std::vector<std::string> resolve_backtrace(xbt_backtrace_location_t const* loc, std::size_t count)
{
return std::vector<std::string>();
-std::vector<std::string> resolveBacktrace(xbt_backtrace_location_t const* loc, std::size_t count) // deprecated
-{
- return resolve_backtrace(loc, count);
-}
-
//FIXME: This code could be greatly improved/simplifyied with
// http://cairo.sourcearchive.com/documentation/1.9.4/backtrace-symbols_8c-source.html
std::vector<std::string> resolve_backtrace(xbt_backtrace_location_t const* loc, std::size_t count)
//FIXME: This code could be greatly improved/simplifyied with
// http://cairo.sourcearchive.com/documentation/1.9.4/backtrace-symbols_8c-source.html
std::vector<std::string> resolve_backtrace(xbt_backtrace_location_t const* loc, std::size_t count)