Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit b548c8098fcc954056a68bc9cc7f755262402254
- Author: Ivan Dives <[email protected]>
- Date: Wed Aug 15 03:23:56 2012 +0300
- foo
- diff --git a/dbus/backtrace.h b/dbus/backtrace.h
- new file mode 100644
- index 0000000..3c09622
- --- /dev/null
- +++ b/dbus/backtrace.h
- @@ -0,0 +1,26 @@
- +#ifndef BACKTRACE_H
- +#define BACKTRACE_H
- +
- +#include <execinfo.h>
- +#include <stdlib.h>
- +#include <syslog.h>
- +
- +#define BACKTRACE_BUFFER_SIZE 100
- +#define BACKTRACE() { \
- + int j, nptrs; \
- + void *buffer[BACKTRACE_BUFFER_SIZE]; \
- + char ** strings; \
- + nptrs = backtrace(buffer, BACKTRACE_BUFFER_SIZE); \
- + syslog(LOG_NOTICE, "%s(): backtrace() returned %d addresses\n", __func__, nptrs); \
- + strings = backtrace_symbols(buffer, nptrs); \
- + if (strings == NULL) { \
- + syslog(LOG_NOTICE, "strings == NULL"); \
- + } else { \
- + for (j = 0; j < nptrs; j++) \
- + syslog(LOG_NOTICE, "%s\n", strings[j]); \
- + free(strings); \
- + } \
- +}
- +
- +#endif /* BACKTRACE_H */
- +
- diff --git a/dbus/dbus-server-socket.c b/dbus/dbus-server-socket.c
- index ae4b602..a1f2f60 100644
- --- a/dbus/dbus-server-socket.c
- +++ b/dbus/dbus-server-socket.c
- @@ -22,6 +22,7 @@
- */
- #include <config.h>
- +#include "backtrace.h"
- #include "dbus-internals.h"
- #include "dbus-server-socket.h"
- #include "dbus-transport-socket.h"
- @@ -162,6 +163,8 @@ socket_handle_watch (DBusWatch *watch,
- DBusServer *server = data;
- DBusServerSocket *socket_server = data;
- + BACKTRACE();
- +
- #ifndef DBUS_DISABLE_ASSERT
- int i;
- dbus_bool_t found = FALSE;
Advertisement
Add Comment
Please, Sign In to add comment