+void mmalloc_backtrace_fragment_display(xbt_mheap_t mdp, size_t block, size_t frag){
+
+ xbt_ex_t e;
+
+ memcpy(&e.bt,&(mdp->heapinfo[block].busy_frag.bt[frag]),sizeof(void*)*XBT_BACKTRACE_SIZE);
+ e.used = XBT_BACKTRACE_SIZE;
+
+ xbt_ex_setup_backtrace(&e);
+ if (e.used == 0) {
+ fprintf(stderr, "(backtrace not set)\n");
+ } else if (e.bt_strings == NULL) {
+ fprintf(stderr, "(backtrace not ready to be computed. %s)\n",xbt_binary_name?"Dunno why":"xbt_binary_name not setup yet");
+ } else {
+ int i;
+
+ fprintf(stderr, "Backtrace of where the fragment %zu in block %zu where malloced (%d frames):\n", frag, block ,e.used);
+ for (i = 0; i < e.used; i++) /* no need to display "xbt_backtrace_display" */{
+ fprintf(stderr,"%d",i);fflush(NULL);
+ fprintf(stderr, "---> %s\n", e.bt_strings[i] + 4);
+ }
+ }
+}
+