X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0f5e8daaa6e9f74521068aa75837200bcd182ea6..2c2f9b9fa2cf5d207a8b4d7fec333bfb9e23967d:/src/xbt/backtrace_windows.c diff --git a/src/xbt/backtrace_windows.c b/src/xbt/backtrace_windows.c index 90f84abf04..0953a8d143 100644 --- a/src/xbt/backtrace_windows.c +++ b/src/xbt/backtrace_windows.c @@ -1,7 +1,7 @@ /* backtrace_windows - backtrace displaying on windows platform */ /* This file is included by ex.c on need (windows x86) */ -/* Copyright (c) 2008, 2009, 2010. The SimGrid Team. +/* Copyright (c) 2008-2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -123,10 +123,10 @@ void xbt_backtrace_preinit(void) return; } - (*fun_set_options) ((*fun_get_options) () | + fun_set_options(fun_get_options() | SYMOPT_LOAD_LINES | SYMOPT_DEFERRED_LOADS); - if (!(*fun_initialize) (process_handle, 0, 1)) { + if (!fun_initialize(process_handle, 0, 1)) { FreeLibrary(hlp_dbg_instance); hlp_dbg_instance = NULL; } @@ -137,7 +137,7 @@ void xbt_backtrace_postexit(void) if (!hlp_dbg_instance) return; - if ((*fun_cleanup) (process_handle)) + if (fun_cleanup(process_handle)) FreeLibrary(hlp_dbg_instance); hlp_dbg_instance = NULL; @@ -179,16 +179,16 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e) int i; char **backtrace_syms; - xbt_assert0(e - && e->used, - "Backtrace not setup yet, cannot set it up for display"); + xbt_assert(e, "Backtrace not setup yet, cannot set it up for display"); + + if (!e->used) + return; backtrace_syms = backtrace_symbols(e->bt, e->used); e->bt_strings = NULL; /* parse the output and build a new backtrace */ e->bt_strings = xbt_new(char *, e->used); - for (i = 0; i < e->used; i++) e->bt_strings[i] = backtrace_syms[i]; @@ -318,9 +318,9 @@ char **backtrace_symbols(void *const *buffer, int size) if (NULL != stack_frame) { - if ((*fun_get_sym_from_addr) + if (fun_get_sym_from_addr (process_handle, stack_frame->AddrPC.Offset, &offset, pSym)) { - if ((*fun_get_line_from_addr) + if (fun_get_line_from_addr (process_handle, stack_frame->AddrPC.Offset, &offset, &line_info)) { strings[pos] =