MCPcopy Create free account
hub / github.com/Singular/Singular / omGetBackTrace

Function omGetBackTrace

omalloc/omGetBackTrace.c:43–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43int omGetBackTrace(void** bt, int start, int max)
44{
45 int i = 0;
46 void* this_frame = __builtin_frame_address(0);
47 void* f_addr;
48 void* r_addr;
49
50 start++;
51
52 switch(start)
53 {
54 OM_GET_BACK_TRACE(1)
55 OM_GET_BACK_TRACE(2)
56/* the following fails on Mac OsX, but the debugging
57 * support it provides is too useful to disable it
58 */
59#ifdef __linux
60#if defined(__x86_64) || defined(__i386)
61 OM_GET_BACK_TRACE(3)
62 OM_GET_BACK_TRACE(4)
63 OM_GET_BACK_TRACE(5)
64 OM_GET_BACK_TRACE(6)
65 OM_GET_BACK_TRACE(7)
66 OM_GET_BACK_TRACE(8)
67 OM_GET_BACK_TRACE(9)
68 OM_GET_BACK_TRACE(10)
69 OM_GET_BACK_TRACE(11)
70 OM_GET_BACK_TRACE(12)
71 OM_GET_BACK_TRACE(13)
72 OM_GET_BACK_TRACE(14)
73 OM_GET_BACK_TRACE(15)
74 OM_GET_BACK_TRACE(16)
75 OM_GET_BACK_TRACE(17)
76#endif
77#endif
78 }
79 if (i < max) bt[i] = 0;
80 return i;
81}
82
83#endif /* __GNUC__ > 1 */
84

Callers 4

omAllocTrackAddrFunction · 0.85
omMarkAsFreeTrackAddrFunction · 0.85
_omPrintCurrentBackTraceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected