xbt_assert1(!strncmp(e.msg,"Some error we will catch on client side",
strlen("Some error we will catch on client side")),
"Got wrong message: %s", e.msg);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
}
strlen("Some error we will catch on client side")),
"Got wrong message: %s", e.msg);
INFO0("Got the expected exception when calling the exception raising RPC");
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
if (!gotit)
gras_msgtype_by_name("raise exception"), NULL, NULL);
} CATCH(e) {
gotit = 1;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
if (!gotit) {
THROW0(unknown_error,0,"Didn't got the remote exception!");
"Got wrong category: %d (instead of %d)",
e.category,unknown_error);
INFO0("Got the expected exception when calling the exception raising RPC");
- xbt_ex_free(&e);
+ xbt_ex_free(e);
exception_catching();
}
#define RETHROW5(msg,a,b,c,d,e) _XBT_PRE_RETHROW msg,a,b,c,d,e _XBT_POST_RETHROW
/** @brief Exception destructor */
-void xbt_ex_free(xbt_ex_t *e);
+void xbt_ex_free(xbt_ex_t e);
void xbt_ex_display(xbt_ex_t *e);
void xbt_display_backtrace(void);
if (port == 10000 -1) {
RETHROW0("Error caught while opening a measurement socket: %s");
} else {
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
}
}
} CATCH(e) {
measMasterIn = NULL;
if (port < 10000)
- xbt_ex_free(&e);
+ xbt_ex_free(e);
else
/* FIXME: tell error to remote */
RETHROW0("Error encountered while opening a measurement server socket: %s");
saturate_further=1;
memset(&msg_got,0,sizeof(msg_got)); /* may be overprotectiv here */
}
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
/* Check whether the experiment has to be terminated by now */
} CATCH(e) {
measMaster = NULL;
if (port < 10000)
- xbt_ex_free(&e);
+ xbt_ex_free(e);
else
RETHROW0("Error encountered while opening a measurement server socket: %s");
}
gras_socket_meas_recv(meas,120,request->msg_size,request->msg_size);
} CATCH(e) {
saturate_further = 0;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
}
INFO1("Saturation stopped on %s",gras_os_myname());
DEBUG1("Create a new variable stack for '%s' into the space",name);
varstack = xbt_dynar_new(sizeof (gras_cbps_elm_t *), NULL);
xbt_dict_set(ps->space, varname, (void **)varstack, NULL);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
/* leaking, you think? only if you do not close all the openned blocks ;)*/
}
if (e.category != mismatch_error)
RETHROW;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
THROW1(not_found_error,1,"Asked to pop the non-existant %s", name);
}
xbt_dynar_pop(varstack, &var);
} CATCH(e) {
if (e.category != not_found_error)
RETHROW;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
res = NULL;
}
return res;
} CATCH(e) {
if (e.category != not_found_error)
RETHROW;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
res = NULL;
}
return res;
if (e.category != not_found_error)
RETHROW;
reference_is_to_cpy = 1;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
if (reference_is_to_cpy) {
if (e.category != not_found_error)
RETHROW;
reference_is_to_send = 1;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
if (reference_is_to_send) {
if (e.category != not_found_error)
RETHROW;
reference_is_to_recv = 1;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
if (reference_is_to_recv) {
int subsubcount = 0;
} CATCH(e) {
if (e.category != mismatch_error)
RETHROW;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
done = 1;
}
} CATCH(e) {
if (e.category != not_found_error)
RETHROW;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
if (found) {
TRY {
res = (gras_msgtype_t)xbt_set_get_by_name(_gras_msgtype_set, namev);
} CATCH(e) {
- xbt_ex_free(&e);
+ xbt_ex_free(e);
THROW1(not_found_error,0,"No registred message of that name: %s",name);
}
if (name != namev)
} CATCH(e) {
if (e.category != timeout_error)
RETHROW;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
timeouted = 1;
}
gras_socket_peer_port(msg.expe));
gras_msg_send_ext(msg.expe, e_gras_msg_kind_rpcerror,
msg.ID, msg.type, &e);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
ran_ok=1;
} else {
RETHROW0("Callback raised an exception: %s");
free(plug->name);
free(plug);
plug=NULL;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
} else {
RETHROW;
}
find_port(hd,sock->peer_port,&pr);
} CATCH(e) {
if (e.category == mismatch_error) {
- xbt_ex_free(&e);
+ xbt_ex_free(e);
THROW2(mismatch_error,0,
"can't connect to %s:%d, no process listen on this port",
sock->peer_name,sock->peer_port);
found = 1;
} CATCH(e) {
if (e.category == mismatch_error)
- xbt_ex_free(&e);
+ xbt_ex_free(e);
else
RETHROW;
}
data = xbt_set_get_by_name(pd->libdata, fab.name);
found = 1;
} CATCH(e) {
- xbt_ex_free(&e);
+ xbt_ex_free(e);
found = 0;
}
if (found)
} CATCH(e) {
if (e.category == not_found_error) {
found = 1;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
} else {
RETHROW;
}
res = xbt_dict_get((xbt_dict_t)cfg,name);
} CATCH(e) {
if (e.category == not_found_error) {
- xbt_ex_free(&e);
+ xbt_ex_free(e);
THROW1(not_found_error,0,
"No registered variable '%s' in this config set",name);
}
variable = xbt_dict_get((xbt_dict_t)cfg,name);
} CATCH(e) {
if (e.category == not_found_error) {
- xbt_ex_free(&e);
+ xbt_ex_free(e);
THROW1(not_found_error,0,
"Can't get the type of '%s' since this variable does not exist",name);
}
type = xbt_cfg_get_type(cfg,name);
} CATCH(e) {
if (e.category == not_found_error) {
- xbt_ex_free(&e);
+ xbt_ex_free(e);
THROW1(not_found_error,0,"Can't set the property '%s' since it's not registered",name);
}
RETHROW;
name = (char*) (optionlist_cpy-name + options);
free(optionlist_cpy);
if (e.category == not_found_error) {
- xbt_ex_free(&e);
+ xbt_ex_free(e);
THROW1(not_found_error,0,"No registrated variable corresponding to '%s'.",name);
}
RETHROW;
if (e.category != not_found_error)
RETHROW;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
THROW1(not_found_error,0,
"Can't empty '%s' since this config element does not exist", name);
}
variable = xbt_dict_get((xbt_dict_t)cfg,name);
} CATCH(e) {
if (e.category == not_found_error) {
- xbt_ex_free(&e);
+ xbt_ex_free(e);
THROW1(not_found_error,0,
"No registered variable %s in this config set",name);
}
if (e.category != mismatch_error ||
strncmp(e.msg,"Config elem speed needs",strlen("Config elem speed needs")))
xbt_test_fail1("Got an exception. msg=%s",e.msg);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
xbt_cfg_free(&set);
xbt_cfg_free(&set);
strncmp(e.msg,"Cannot add value 34 to the config elem speed",
strlen("Config elem speed needs")))
xbt_test_fail1("Got an exception. msg=%s",e.msg);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
xbt_cfg_check(set);
xbt_cfg_free(&set);
} CATCH(e) {
if (e.category != not_found_error)
xbt_test_exception(e);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
xbt_cfg_free(&myset);
}
} CATCH(e) {
if (e.category != not_found_error)
RETHROW;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
res=NULL;
}
return res;
} CATCH(e) {
if (e.category != not_found_error)
xbt_test_exception(e);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
}
} CATCH(e) {
if (e.category != not_found_error)
xbt_test_exception(e);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
traverse(head);
} CATCH(e) {
if (e.category != arg_error)
xbt_test_exception(e);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
xbt_test_add0("Remove each data manually (traversing the resulting dictionnary each time)");
} CATCH(e) {
if (e.category != not_found_error)
xbt_test_exception(e);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
traverse(head);
}
debuged_remove(head,"1234"); traverse(head);
} CATCH(e) {
if (e.category != not_found_error)
xbt_test_exception(e);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
} traverse(head);
xbt_test_add0("Free the dictionnary twice");
} CATCH(e) {
if (e.category == mismatch_error) {
xbt_dict_cursor_free(cursor);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
return FALSE;
}
RETHROW;
RETHROW;
/* make sure the dict of next level exists */
- xbt_ex_free(&e);
+ xbt_ex_free(e);
nextlevel=xbt_dict_new();
VERB1("Create a dict (%p)",nextlevel);
xbt_dict_set_ext(thislevel, thiskey, thislen, nextlevel, &_free_dict);
} CATCH(e) {
/* If non-existant entry, nothing to do */
if (e.category == arg_error)
- xbt_ex_free(&e);
+ xbt_ex_free(e);
else
RETHROW;
}
e.msg=NULL;
e.remote=0;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
#else
fprintf(stderr,"No backtrace on this arch");
#endif
fprintf(stderr," at %s:%d:%s (no backtrace available on that arch)\n",
e->file,e->line,e->func);
#endif
- xbt_ex_free(e);
+ xbt_ex_free(*e);
}
ex_ctx_cb_t __xbt_ex_ctx = &__xbt_ex_ctx_default;
ex_term_cb_t __xbt_ex_terminate = &__xbt_ex_terminate_default;
-void xbt_ex_free(xbt_ex_t *e) {
+void xbt_ex_free(xbt_ex_t e) {
int i;
- if (e->msg) free(e->msg);
- if (e->remote) {
- free(e->procname);
- free(e->file);
- free(e->func);
- free(e->host);
+ if (e.msg) 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++)
- free((char*)e->bt_strings[i]);
- free((char **)e->bt_strings);
+ if (e.bt_strings) {
+ for (i=0; i<e.used; i++)
+ free((char*)e.bt_strings[i]);
+ free((char **)e.bt_strings);
}
- memset(e,0,sizeof(xbt_ex_t));
+// memset(e,0,sizeof(xbt_ex_t));
}
/** \brief returns a short name for the given exception category */
if (n != 3)
xbt_test_fail1("M3: n=%d (!= 3)", n);
n++;
- xbt_ex_free(&ex);
+ xbt_ex_free(ex);
}
n++;
TRY {
if (n != 7)
xbt_test_fail1("M4: n=%d (!= 7)", n);
n++;
- xbt_ex_free(&ex);
+ xbt_ex_free(ex);
}
if (n != 8)
xbt_test_fail1("M5: n=%d (!= 8)", n);
xbt_test_fail1("value=%d (!= 2)", ex.value);
if (strcmp(ex.msg,"toto"))
xbt_test_fail1("message=%s (!= toto)", ex.msg);
- xbt_ex_free(&ex);
+ xbt_ex_free(ex);
}
}
/* r2 is allowed to be destroyed because not volatile */
if (v2 != 5678)
xbt_test_fail1("v2=%d (!= 5678)", v2);
- xbt_ex_free(&ex);
+ xbt_ex_free(ex);
}
}
xbt_test_fail1("v1 = %d (!= 5678)", v1);
if (!(ex.category == 1 && ex.value == 2 && !strcmp(ex.msg,"blah")))
xbt_test_fail0("unexpected exception contents");
- xbt_ex_free(&ex);
+ xbt_ex_free(ex);
}
if (!c)
xbt_test_fail0("xbt_ex_free not executed");
} CATCH(e) {
if (e.category != not_found_error)
RETHROW;
- xbt_ex_free(&e);
+ xbt_ex_free(e);
found = 0;
DEBUG0("Store for further application");
xbt_dict_set_ext(set->dict, elm->name, elm->name_len, elm, free_func);
xbt_dynar_set(set->dynar, elm->ID, &elm);
DEBUG2("Insertion of key '%s' (id %d)", elm->name, elm->ID);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
if (found) {
} CATCH(e) {
if (e.category != not_found_error)
xbt_test_exception(e);
- xbt_ex_free(&e);
+ xbt_ex_free(e);
}
}