From: Arnaud Giersch Date: Tue, 11 Dec 2012 14:48:02 +0000 (+0100) Subject: Remove now unused support for remote exceptions. X-Git-Tag: v3_9_rc1~86^2~130 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9ed8f63d4856efe72038250011ad82a0f90f7d53 Remove now unused support for remote exceptions. Plus slight reindent in ex.h. --- diff --git a/include/xbt/ex.h b/include/xbt/ex.h index 909af2c3fb..82573e0ad6 100644 --- a/include/xbt/ex.h +++ b/include/xbt/ex.h @@ -250,41 +250,34 @@ __ex_mctx_struct} __ex_mctx_t; /** @brief different kind of errors */ typedef enum { - unknown_error = 0,/**< unknown error */ - arg_error, /**< Invalid argument */ - bound_error, /**< Out of bounds argument */ - mismatch_error, /**< The provided ID does not match */ - not_found_error, /**< The searched element was not found */ - - system_error, /**< a syscall did fail */ - network_error, /**< error while sending/receiving data */ - timeout_error, /**< not quick enough, dude */ - cancel_error, /**< an action was canceled */ - thread_error, /**< error while [un]locking */ - host_error, /**< host failed */ - tracing_error, /**< error during the simulation tracing */ - io_error /**< disk or file error */ + unknown_error = 0, /**< unknown error */ + arg_error, /**< Invalid argument */ + bound_error, /**< Out of bounds argument */ + mismatch_error, /**< The provided ID does not match */ + not_found_error, /**< The searched element was not found */ + system_error, /**< a syscall did fail */ + network_error, /**< error while sending/receiving data */ + timeout_error, /**< not quick enough, dude */ + cancel_error, /**< an action was canceled */ + thread_error, /**< error while [un]locking */ + host_error, /**< host failed */ + tracing_error, /**< error during the simulation tracing */ + io_error /**< disk or file error */ } xbt_errcat_t; XBT_PUBLIC(const char *) xbt_ex_catname(xbt_errcat_t cat); /** @brief Structure describing an exception */ typedef struct { - char *msg; /**< human readable message */ - xbt_errcat_t category; - /**< category like HTTP (what went wrong) */ - int value; /**< like errno (why did it went wrong) */ + char *msg; /**< human readable message */ + xbt_errcat_t category; /**< category like HTTP (what went wrong) */ + int value; /**< like errno (why did it went wrong) */ /* throw point */ - short int remote; - /**< whether it was raised remotely */ - char *host; /**< NULL locally thrown exceptions; full hostname if remote ones */ - /* FIXME: host should be hostname:port[#thread] */ - char *procname; - /**< Name of the process who thrown this */ - int pid; /**< PID of the process who thrown this */ - char *file; /**< Thrown point */ - int line; /**< Thrown point */ - char *func; /**< Thrown point */ + char *procname; /**< Name of the process who thrown this */ + int pid; /**< PID of the process who thrown this */ + char *file; /**< Thrown point */ + int line; /**< Thrown point */ + char *func; /**< Thrown point */ /* Backtrace */ int used; char **bt_strings; /* only filed on display (or before the network propagation) */ @@ -302,9 +295,9 @@ typedef struct { } xbt_running_ctx_t; /* the static and dynamic initializers for a context structure */ -#define XBT_RUNNING_CTX_INITIALIZER \ - { NULL, 0, { /* content */ NULL, unknown_error, 0, \ - /* throw point*/ 0,NULL, NULL,0, NULL, 0, NULL,\ +#define XBT_RUNNING_CTX_INITIALIZER \ + { NULL, 0, { /* content */ NULL, unknown_error, 0, \ + /* throw point*/ NULL, 0, NULL, 0, NULL, \ /* backtrace */ 0, NULL, /* bt[] */ } } XBT_PUBLIC_DATA(const xbt_running_ctx_t) __xbt_ex_ctx_initializer; @@ -426,8 +419,6 @@ XBT_PUBLIC( void )__xbt_ex_terminate_default(xbt_ex_t * e); _throw_ctx->exception.msg = (m); \ _throw_ctx->exception.category = (xbt_errcat_t)(c); \ _throw_ctx->exception.value = (v); \ - _throw_ctx->exception.remote = 0; \ - _throw_ctx->exception.host = (char*)NULL; \ _throw_ctx->exception.procname = (char*)xbt_procname(); \ _throw_ctx->exception.pid = xbt_getpid(); \ _throw_ctx->exception.file = (char*)__FILE__; \ diff --git a/src/xbt/backtrace_linux.c b/src/xbt/backtrace_linux.c index 04a26c714f..d7e6d49292 100644 --- a/src/xbt/backtrace_linux.c +++ b/src/xbt/backtrace_linux.c @@ -80,7 +80,8 @@ void xbt_backtrace_current(xbt_ex_t * e) e->used = backtrace((void **) e->bt, XBT_BACKTRACE_SIZE); if (e->used == 0) { fprintf(stderr, "The backtrace() function failed, which probably means that the memory is exhausted. Here is a crude dump of the exception that I was trying to build:"); - fprintf(stderr, "%s:%s(%d) [%s:%d] %s", e->host,e->procname,e->pid, e->file,e->line,e->msg); + fprintf(stderr, "%s(%d) [%s:%d] %s", + e->procname, e->pid, e->file, e->line, e->msg); fprintf(stderr, "Bailing out now since there is nothing I can do without a decent amount of memory. Please go fix the memleaks\n"); exit(1); } diff --git a/src/xbt/ex.c b/src/xbt/ex.c index 1017b5f20c..c6e74bddfd 100644 --- a/src/xbt/ex.c +++ b/src/xbt/ex.c @@ -103,7 +103,6 @@ void xbt_backtrace_display(xbt_ex_t * e) /* don't fool xbt_ex_free with uninitialized msg field */ e->msg = NULL; - e->remote = 0; xbt_ex_free(*e); #else @@ -132,9 +131,6 @@ void xbt_ex_display(xbt_ex_t * e) { char *thrower = NULL; - if (e->remote) - thrower = bprintf(" on host %s(%d)", e->host, e->pid); - fprintf(stderr, "** SimGrid: UNCAUGHT EXCEPTION received on %s(%d): category: %s; value: %d\n" "** %s\n" @@ -145,7 +141,7 @@ void xbt_ex_display(xbt_ex_t * e) XBT_CRITICAL("%s", e->msg); xbt_free(thrower); - if (!e->remote && !e->bt_strings) + if (!e->bt_strings) xbt_ex_setup_backtrace(e); #ifdef HAVE_BACKTRACE @@ -187,12 +183,6 @@ void xbt_ex_free(xbt_ex_t e) int i; free(e.msg); - if (e.remote) { - free(e.procname); - free(e.file); - free(e.func); - free(e.host); - } if (e.bt_strings) { for (i = 0; i < e.used; i++) diff --git a/src/xbt/xbt_log_layout_format.c b/src/xbt/xbt_log_layout_format.c index 651a2ffef6..9801a74479 100644 --- a/src/xbt/xbt_log_layout_format.c +++ b/src/xbt/xbt_log_layout_format.c @@ -162,7 +162,6 @@ static int xbt_log_layout_format_doit(xbt_log_layout_t l, e.used = backtrace((void **) e.bt, XBT_BACKTRACE_SIZE); e.bt_strings = NULL; e.msg = NULL; - e.remote = 0; xbt_ex_setup_backtrace(&e); if (*q == 'B') { show_string(e.bt_strings[1] + 8);