From: Martin Quinson Date: Mon, 31 Oct 2016 23:02:01 +0000 (+0100) Subject: cosmetics X-Git-Tag: v3_14~266 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c03ae7b36d851a71a62a6f800c7f437f1e03a2ba cosmetics --- diff --git a/src/xbt/backtrace_linux.cpp b/src/xbt/backtrace_linux.cpp index 49ec6a110c..e37bbcc151 100644 --- a/src/xbt/backtrace_linux.cpp +++ b/src/xbt/backtrace_linux.cpp @@ -342,26 +342,22 @@ std::vector resolveBacktrace( #if HAVE_MC int xbt_libunwind_backtrace(void** bt, int size){ - int i = 0; - for(i=0; i < size; i++) + for (int i = 0; i < size; i++) bt[i] = nullptr; - i=0; - unw_cursor_t c; unw_context_t uc; unw_getcontext (&uc); unw_init_local (&c, &uc); - unw_word_t ip; - unw_step(&c); - while(unw_step(&c) >= 0 && i < size){ + int i; + for (i = 0; unw_step(&c) >= 0 && i < size; i++) { + unw_word_t ip; unw_get_reg(&c, UNW_REG_IP, &ip); bt[i] = (void*)(long)ip; - i++; } return i;