diff options
author | Imran Zaman <imran.zaman@intel.com> | 2013-06-24 16:46:39 +0300 |
---|---|---|
committer | Imran Zaman <imran.zaman@intel.com> | 2013-06-24 16:46:39 +0300 |
commit | e9a79beef3cd891ac16bae05a28c91c613df6442 (patch) | |
tree | 025245d8447accb034c8c273a2de6eeb7fd09173 /include | |
parent | 295c3b3222fbf7f414c5802c6af86bedadbc009a (diff) | |
download | gsignond-submit/tizen/20130624.140448.tar.gz gsignond-submit/tizen/20130624.140448.tar.bz2 gsignond-submit/tizen/20130624.140448.zip |
Diffstat (limited to 'include')
-rw-r--r-- | include/gsignond/gsignond-log.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/gsignond/gsignond-log.h b/include/gsignond/gsignond-log.h index 88c1452..f1bac1f 100644 --- a/include/gsignond/gsignond-log.h +++ b/include/gsignond/gsignond-log.h @@ -27,6 +27,25 @@ #include <glib.h> +#include <execinfo.h> +#include <stdio.h> +#include <stdlib.h> + +#define TRACEBACK() \ +{ \ + void *array[256];\ + size_t size, i;\ + char **strings;\ +\ + fprintf (stderr, "Backtrace for: %s %s\n", __FILE__, __PRETTY_FUNCTION__); \ + size = backtrace (array, 256);\ + strings = backtrace_symbols (array, size);\ + if (strings) { \ + for (i=0; i <size; i++) fprintf (stderr, "\t%s\n", strings[i]);\ + free (strings);\ + }\ +} + #define INFO(frmt, args...) g_message("%f %s:%d %s " frmt , \ g_get_monotonic_time()*1.0e-6, __FILE__, __LINE__, \ __PRETTY_FUNCTION__, ##args) |