mirror of https://gerrit.osmocom.org/libosmocore
Move the generate backtrace call from MSGB_ABORT to osmo_panic handler
This has two benefits: - All people calling osmo_panic() will have the backtrace - It makes the thing build in 'target' mode in osmocom-bb And one downside: - The osmo_panic handler is now in the backtrace (I can live with that :) Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
c91d17b3d5
commit
7f6615a37d
|
@ -62,9 +62,7 @@ extern void msgb_reset(struct msgb *m);
|
||||||
|
|
||||||
#ifdef MSGB_DEBUG
|
#ifdef MSGB_DEBUG
|
||||||
#include <osmocore/panic.h>
|
#include <osmocore/panic.h>
|
||||||
#include <osmocore/gsm_utils.h>
|
|
||||||
#define MSGB_ABORT(msg, fmt, args ...) do { \
|
#define MSGB_ABORT(msg, fmt, args ...) do { \
|
||||||
generate_backtrace(); \
|
|
||||||
osmo_panic("msgb(%p): " fmt, msg, ## args); \
|
osmo_panic("msgb(%p): " fmt, msg, ## args); \
|
||||||
} while(0)
|
} while(0)
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <osmocore/gsm_utils.h>
|
||||||
#include <osmocore/panic.h>
|
#include <osmocore/panic.h>
|
||||||
|
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
|
@ -36,6 +37,7 @@ static osmo_panic_handler_t osmo_panic_handler = (void*)0;
|
||||||
static void osmo_panic_default(const char *fmt, va_list args)
|
static void osmo_panic_default(const char *fmt, va_list args)
|
||||||
{
|
{
|
||||||
vfprintf(stderr, fmt, args);
|
vfprintf(stderr, fmt, args);
|
||||||
|
generate_backtrace();
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue