Watt-32 tcp/ip  2.2 dev-rel.10
btrace.h
Go to the documentation of this file.
1 #ifndef _w32_BACKTRACE_H
2 #define _w32_BACKTRACE_H
3 
11 #define backtrace W32_NAMESPACE (backtrace)
12 #define backtrace_init W32_NAMESPACE (backtrace_init)
13 #define backtrace_symbols_fd W32_NAMESPACE (backtrace_symbols_fd)
14 
15 extern int backtrace_init (const char *prog);
16 extern int backtrace (void **buf, int size);
17 extern int backtrace_symbols_fd (const void *buf, int size, int file);
18 extern int traceback_exit (const void *caller);
19 
20 #if defined(__GNUC__)
21  #define CALLER_CS() -1
22  #define CALLER_EIP(stk) __builtin_return_address (0)
23 
24 #elif (DOSX)
25  #define CALLER_CS() -1
26  #define CALLER_EIP(stk) *(DWORD*)(&(stk)+1))
27 
28 #elif defined(__LARGE__)
29  #define CALLER_CS() *(WORD*)(&(stk)+1))
30  #define CALLER_EIP(stk) *(WORD*)(&(stk)+2))
31 
32 #else /* small model */
33  #define CALLER_CS() MY_CS()
34  #define CALLER_EIP(stk) *(WORD*)(&(stk)+1))
35 #endif
36 
37 #endif