Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sanitize backtrace naming space
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 14 Jul 2007 08:52:10 +0000 (08:52 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 14 Jul 2007 08:52:10 +0000 (08:52 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3781 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/xbt/ex.h
src/gras/Transport/transport.c
src/gras/gras.c
src/java/jxbt_context.c

index 5c9a0c5..6dacb0f 100644 (file)
@@ -505,8 +505,13 @@ extern void __xbt_ex_terminate_default(xbt_ex_t *e);
 /** @brief Exception destructor */
 XBT_PUBLIC(void) xbt_ex_free(xbt_ex_t e);
 
-XBT_PUBLIC(void) xbt_ex_display(xbt_ex_t *e);
-XBT_PUBLIC(void) xbt_backtrace_display(void);
+/** @brief Shows a backtrace of the current location */
+XBT_PUBLIC(void) xbt_backtrace_display_current(void);
+
+/** @brief Captures a backtrace for further use */
+XBT_PUBLIC(void) xbt_backtrace_current(xbt_ex_t *e);
+/** @brief Display a previously captured backtrace */
+XBT_PUBLIC(void) xbt_backtrace_display(xbt_ex_t *e);
 
 /** @} */
 #endif /* __XBT_EX_H__ */
index e219c39..4f5fe77 100644 (file)
@@ -372,7 +372,7 @@ void gras_socket_close(gras_socket_t sock) {
                        }
     }
     WARN1("Ignoring request to free an unknown socket (%p). Execution stack:",sock);
-    xbt_backtrace_display();
+    xbt_backtrace_display_current();
   }
   XBT_OUT;
 }
index 40c0fce..7ca7b9e 100644 (file)
@@ -28,13 +28,13 @@ static int gras_running_process = 0;
 #if defined(HAVE_SIGNAL) && defined(HAVE_SIGNAL_H)
 static void gras_sigusr_handler(int sig) {
    INFO0("SIGUSR1 received. Display the backtrace");
-   xbt_backtrace_display();
+   xbt_backtrace_display_current();
 }
 
 static void gras_sigint_handler(int sig) {
    static double lastone = 0;
    if (lastone == 0 || xbt_os_time() - lastone > 5) {
-      xbt_backtrace_display();
+      xbt_backtrace_display_current();
       fprintf(stderr,
              "\nBacktrace displayed because Ctrl-C was pressed. Press again (within 5 sec) to abort the process.\n");
       lastone = xbt_os_time();
index 9ca20d8..ea22c83 100644 (file)
@@ -12,6 +12,7 @@
 #include "xbt/log.h"
 #include "xbt/dynar.h"
 #include "xbt/xbt_os_thread.h"
+#include "xbt/ex_interface.h"
 #include "java/jxbt_context.h"
 #include "java/jmsg.h"
 #include "java/jmsg_process.h"