X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bccebf423e34203bb20f22ac5b52c756aba29e26..5daf43327dc8fce985687f6306daa762ec07a4b6:/src/xbt/backtrace_windows.c?ds=sidebyside diff --git a/src/xbt/backtrace_windows.c b/src/xbt/backtrace_windows.c index 16cdd74a4b..85b8b9927b 100644 --- a/src/xbt/backtrace_windows.c +++ b/src/xbt/backtrace_windows.c @@ -139,11 +139,13 @@ int backtrace(void **buffer, int size) /* ebp points on stack base */ /* esp points on stack pointer, ie on last stacked element (current element) */ _asm call $ + 5 - _asm pop eax - _asm mov context.Eip, eax - _asm mov eax, esp - _asm mov context.Esp, eax - _asm mov context.Ebp, ebp dbg_hlp_init(GetCurrentProcess()); + _asm pop eax + _asm mov context.Eip, eax + _asm mov eax, esp + _asm mov context.Esp, eax + _asm mov context.Ebp, ebp + + dbg_hlp_init(GetCurrentProcess()); if ((NULL == dbg_hlp) || (size <= 0) || (NULL == buffer)) { errno = EINVAL; @@ -167,11 +169,6 @@ int backtrace(void **buffer, int size) while (pos < size) { stack_frame = (void *) xbt_new0(STACKFRAME, 1); - if (!stack_frame) { - errno = ENOMEM; - break; - } - stack_frame->AddrPC.Offset = context.Eip; stack_frame->AddrPC.Mode = AddrModeFlat; @@ -238,11 +235,6 @@ char **backtrace_symbols(void *const *buffer, int size) strings = xbt_new0(char *, size); - if (NULL == strings) { - errno = ENOMEM; - return NULL; - } - pSym = (IMAGEHLP_SYMBOL *) __buffer; pSym->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL); @@ -299,9 +291,6 @@ static int dbg_hlp_init(HANDLE process_handle) /* allocation */ dbg_hlp = xbt_new0(s_xbt_debug_hlp_t, 1); - if (!dbg_hlp) - return ENOMEM; - /* load the library */ dbg_hlp->instance = LoadLibraryA("Dbghelp.dll");