forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
classlib-3.1.3-fix-unwind-x86_64.patch
35 lines (30 loc) · 1.42 KB
/
classlib-3.1.3-fix-unwind-x86_64.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff --git a/src/utils/DebugAids.cpp b/src/utils/DebugAids.cpp
index 894c8a0..f014b1b 100644
--- a/src/utils/DebugAids.cpp
+++ b/src/utils/DebugAids.cpp
@@ -83,7 +83,7 @@ GetLogicalAddress (PVOID addr, PTSTR name, DWORD length,
}
#endif
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) // FIXME: Check
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && defined(__x86_64__) // FIXME: Check
extern "C" {
typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
struct _Unwind_Context;
@@ -168,7 +168,7 @@ unwindWalkStack (_Unwind_Context *ctx, void *data)
writev (fd, bufs, nbufs);
return _URC_NO_REASON;
}
-#endif // GCC 3.4+
+#endif // (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && defined(__x86_64__)
#if __hpux
@@ -868,10 +868,10 @@ DebugAids::stacktrace (IOFD fd /* = IOFD_INVALID */)
sprintf (buffer, PSTACK_COMMAND, (unsigned long) getpid (), fd);
system (buffer);
-#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && defined(__x86_64__)
// FIXME: Check for _Unwind*, compilers other than GCC support this API
_Unwind_Backtrace (unwindWalkStack, &fd);
-#endif
+#endif // (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && defined(__x86_64__)
// FIXME: mpatrol has some generic unix unwind code.
// FIXME: from unix faq: ask debugger to dump stack trace