X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/696ee2a4af4489387e1557a5bd4bcc523d56ff04..3e33945312989c2b5a84a31efafd429185ece096:/src/xbt/ex.c diff --git a/src/xbt/ex.c b/src/xbt/ex.c index f5a7969b52..48ab1de9f1 100644 --- a/src/xbt/ex.c +++ b/src/xbt/ex.c @@ -72,7 +72,11 @@ void xbt_ex_setup_backtrace(xbt_ex_t *e) { /* size (in char) of pointers on this arch */ int addr_len=0; - + + /* Some arches only have stubs of backtrace, no implementation (hppa comes to mind) */ + if (!e->used) + return; + /* build the commandline */ curr += sprintf(curr,"%s -f -e %s ",ADDR2LINE,xbt_binary_name); for (i=0; iused;i++) { @@ -151,7 +155,7 @@ void xbt_ex_setup_backtrace(xbt_ex_t *e) { free(maps_name); if (!found) { - WARN0("Problem while reading the maps file"); + VERB0("Problem while reading the maps file. Following backtrace will be mangled."); e->bt_strings[i] = bprintf("** In ?? (%s)", backtrace[i]); continue; } @@ -454,9 +458,10 @@ static void bad_example(void) { /* end_of_bad_example */ } #endif - +typedef struct {char *first;} global_context_t; + static void good_example(void) { - struct {char*first;} *globalcontext; + global_context_t *global_context=malloc(sizeof(global_context_t)); xbt_ex_t ex; /* GOOD_EXAMPLE */ @@ -466,7 +471,7 @@ static void good_example(void) { char * volatile /*03*/ cp3 = NULL /*02*/; TRY { cp1 = mallocex(SMALLAMOUNT); - globalcontext->first = cp1; + global_context->first = cp1; cp1 = NULL /*05 give away*/; cp2 = mallocex(TOOBIG); cp3 = mallocex(SMALLAMOUNT);