[evolution-data-server] Introduce camel_debug_get_backtrace()



commit eb5511010e77920447af5c0f8aabe25271df23e4
Author: Milan Crha <mcrha redhat com>
Date:   Fri Feb 21 13:21:13 2014 +0100

    Introduce camel_debug_get_backtrace()
    
    Just for easier debugging and reuse of a code. This might not
    be used in a production code.

 camel/camel-debug.c |   18 ++++++++++++++++++
 camel/camel-debug.h |    2 ++
 2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-debug.c b/camel/camel-debug.c
index e706d4d..22f989e 100644
--- a/camel/camel-debug.c
+++ b/camel/camel-debug.c
@@ -672,3 +672,21 @@ camel_pointer_tracker_dump (void)
 {
        dump_tracked_ptrs (FALSE);
 }
+
+/**
+ * camel_debug_get_backtrace:
+ *
+ * Gets current backtrace leading to this function call.
+ *
+ * Returns: Current backtrace, or %NULL, if cannot determine it.
+ *
+ * Note: Getting backtraces only works if the library was
+ * configured with --enable-backtraces.
+ *
+ * Since: 3.12
+ **/
+GString *
+camel_debug_get_backtrace (void)
+{
+       return get_current_backtrace ();
+}
diff --git a/camel/camel-debug.h b/camel/camel-debug.h
index 70a4d63..94b36ac 100644
--- a/camel/camel-debug.h
+++ b/camel/camel-debug.h
@@ -138,6 +138,8 @@ void                camel_pointer_tracker_track_with_info
 void           camel_pointer_tracker_untrack   (gpointer ptr);
 void           camel_pointer_tracker_dump      (void);
 
+GString *      camel_debug_get_backtrace       (void);
+
 G_END_DECLS
 
 #endif /* CAMEL_DEBUG_H */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]