31# define __PRETTY_FUNCTION__ __FUNCTION__
35# ifdef _CRTDBG_MAP_ALLOC
57#define dbg_str1(x) dbg_str2(x)
58#define dbg_module dbg_str1(MODULE)
59#define dbg(level, ...) \
61 if (max_debug_level >= level) \
62 debug_printf(level, dbg_module, strlen(dbg_module), __PRETTY_FUNCTION__, strlen(__PRETTY_FUNCTION__), 1, \
65#define dbg_assert(expr) \
67 : debug_assert_fail(dbg_module, strlen(dbg_module), __PRETTY_FUNCTION__, strlen(__PRETTY_FUNCTION__), \
68 __FILE__, __LINE__, dbg_str1(expr)))
70#define DEBUG_MODULE_GLOBAL "global"
75# define g_new(type, size) (type *)debug_malloc(__FILE__, __LINE__, __PRETTY_FUNCTION__, sizeof(type) * (size))
76# define g_new0(type, size) (type *)debug_malloc0(__FILE__, __LINE__, __PRETTY_FUNCTION__, sizeof(type) * (size))
77# define g_malloc(size) debug_malloc(__FILE__, __LINE__, __PRETTY_FUNCTION__, (size))
78# define g_malloc0(size) debug_malloc0(__FILE__, __LINE__, __PRETTY_FUNCTION__, (size))
79# define g_realloc(ptr, size) debug_realloc(__FILE__, __LINE__, __PRETTY_FUNCTION__, ptr, (size))
80# define g_free(ptr) debug_free(__FILE__, __LINE__, __PRETTY_FUNCTION__, ptr)
81# define g_strdup(ptr) debug_strdup(__FILE__, __LINE__, __PRETTY_FUNCTION__, ptr)
82# define g_strdup_printf(fmt...) debug_guard(__FILE__, __LINE__, __PRETTY_FUNCTION__, g_strdup_printf(fmt))
83# define graphics_icon_path(x) debug_guard(__FILE__, __LINE__, __PRETTY_FUNCTION__, graphics_icon_path(x))
84# define dbg_guard(x) debug_guard(__FILE__, __LINE__, __PRETTY_FUNCTION__, x)
85# define g_free_func debug_free_func
87# define g_free_func g_free
88# define dbg_guard(x) x
99 int prefix,
const char *fmt, va_list ap);
101 const char *fmt, ...)
106void debug_assert_fail(
const char *module,
const int mlen,
const char *function,
const int flen,
const char *
file,
107 int line,
const char *expr);
113char *
debug_strdup(
const char *where,
int line,
const char *func,
const char *ptr);
114char *
debug_guard(
const char *where,
int line,
const char *func,
char *str);
115void debug_free(
const char *where,
int line,
const char *func,
void *ptr);
118void *
debug_realloc(
const char *where,
int line,
const char *func,
void *ptr,
int size);
void * debug_malloc0(const char *where, int line, const char *func, int size)
Definition debug.c:558
void debug_printf(dbg_level level, const char *module, const int mlen, const char *function, const int flen, int prefix, const char *fmt,...)
Definition debug.c:456
void debug_dump_mallocs(void)
Definition debug.c:505
dbg_level
Definition debug.h:42
@ lvl_info
Definition debug.h:50
@ lvl_error
Definition debug.h:46
@ lvl_debug
Definition debug.h:52
@ lvl_unset
Definition debug.h:44
@ lvl_warning
Definition debug.h:48
void debug_set_global_level(dbg_level level, int override_old_value)
Definition debug.c:149
void debug_set_logfile(const char *path)
Definition debug.c:479
void debug_vprintf(dbg_level level, const char *module, const int mlen, const char *function, const int flen, int prefix, const char *fmt, va_list ap)
Write a log message.
Definition debug.c:333
struct debug * debug_new(struct attr *parent, struct attr **attrs)
Definition debug.c:202
char * debug_strdup(const char *where, int line, const char *func, const char *ptr)
Definition debug.c:573
void debug_free_func(void *ptr)
Definition debug.c:615
dbg_level debug_level_get(const char *name)
Definition debug.c:241
void * debug_malloc(const char *where, int line, const char *func, int size)
Definition debug.c:520
void debug_finished(void)
Definition debug.c:619
void * debug_realloc(const char *where, int line, const char *func, void *ptr, int size)
Definition debug.c:565
void debug_destroy(void)
Definition debug.c:470
char * debug_guard(const char *where, int line, const char *func, char *str)
Definition debug.c:585
void debug_assert_fail(const char *module, const int mlen, const char *function, const int flen, const char *file, int line, const char *expr)
Definition debug.c:464
void debug_free(const char *where, int line, const char *func, void *ptr)
Definition debug.c:591
dbg_level max_debug_level
Definition debug.c:56
void debug_init(const char *program_name)
Definition debug.c:130
void debug_level_set(const char *name, dbg_level level)
Definition debug.c:158
struct map_priv __attribute__
static int debug
Definition garmin_img.c:265
int size
Definition garmin_img.c:3
struct navit struct traffic_methods struct attr ** attrs
Definition plugin_def.h:36
char name[0]
Definition street.c:3
Definition garmin_img.c:476
Definition gpx2navit_txt.h:50