/* backtrace_windows - backtrace displaying on windows platform */
/* This file is included by ex.c on need (windows x86) */
/* backtrace_windows - backtrace displaying on windows platform */
/* This file is included by ex.c on need (windows x86) */
-/* Copyright (c) 2007 The SimGrid team */
-/* All rights reserved. */
+/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
- (fun_function_table_access_t) GetProcAddress(hlp_dbg_instance,
- "SymFunctionTableAccess");
+ (fun_function_table_access_t) GetProcAddress(hlp_dbg_instance,
+ "SymFunctionTableAccess");
- byte
- __buffer[(sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR) +
- sizeof(ULONG64) - 1) / sizeof(ULONG64)];
+ byte __buffer[(sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR) +
+ sizeof(ULONG64) - 1) / sizeof(ULONG64)];
CONTEXT context = { CONTEXT_FULL };
GetThreadContext(GetCurrentThread(), &context);
CONTEXT context = { CONTEXT_FULL };
GetThreadContext(GetCurrentThread(), &context);
/* ebp points on stack base */
/* esp points on stack pointer, ie on last stacked element (current element) */
_asm call $ + 5
/* 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
- if ((NULL == hlp_dbg_instance) || (size <= 0) || (NULL == buffer)) {
+ _asm pop eax
+ _asm mov context.Eip, eax
+ _asm mov eax, esp
+ _asm mov context.Esp, eax
+ _asm mov context.Ebp, ebp
+ if ((NULL == hlp_dbg_instance) || (size <= 0) || (NULL == buffer)) {
unsigned long offset = 0;
IMAGEHLP_LINE line_info = { 0 };
IMAGEHLP_MODULE module = { 0 };
unsigned long offset = 0;
IMAGEHLP_LINE line_info = { 0 };
IMAGEHLP_MODULE module = { 0 };
- byte
- __buffer[(sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR) +
- sizeof(ULONG64) - 1) / sizeof(ULONG64)];
+ byte __buffer[(sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR) +
+ sizeof(ULONG64) - 1) / sizeof(ULONG64)];
(process_handle, stack_frame->AddrPC.Offset, &offset, pSym)) {
(process_handle, stack_frame->AddrPC.Offset, &offset, pSym)) {
- if ((*fun_get_line_from_addr)
- (process_handle, stack_frame->AddrPC.Offset, &offset, &line_info)) {
+ if (fun_get_line_from_addr
+ (process_handle, stack_frame->AddrPC.Offset, &offset,
+ &line_info)) {
- bprintf("** In %s() at %s:%d", pSym->Name, line_info.FileName,
- (int) line_info.LineNumber);
+ bprintf("** In %s() at %s:%d", pSym->Name,
+ line_info.FileName, (int) line_info.LineNumber);