summaryrefslogtreecommitdiff
path: root/package/mrd6/patches/patch-src_linux_mrd_components_cpp
blob: 4416c29dbe9e7767258a8b6a54e3504e6df0deb9 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--- mrd6-0.9.6.orig/src/linux/mrd_components.cpp	2007-01-07 03:11:27.000000000 +0100
+++ mrd6-0.9.6/src/linux/mrd_components.cpp	2010-11-11 11:16:08.114995686 +0100
@@ -28,10 +28,6 @@
 #include <mrdpriv/linux/us_mfa.h>
 #include <mrdpriv/linux/icmp_raw.h>
 
-#if defined(__GLIBC__) && !defined(__UCLIBC__)
-#include <execinfo.h>
-#endif
-
 bool mrd::prepare_os_components() {
 	m_mfa = new us_mfa();
 
@@ -57,45 +53,14 @@ const char *mrd::loopback_interface_name
 #define MAX_DEEP_BACKTRACE	32
 
 void mrd::output_backtrace(base_stream &out) const {
-#if defined(__GLIBC__) && !defined(__UCLIBC__)
-	void *bt[MAX_DEEP_BACKTRACE];
-
-	int count = backtrace(bt, MAX_DEEP_BACKTRACE);
-
-	char **btnames = backtrace_symbols(bt, count);
-
-	for (int i = 0; i < count; i++) {
-		out.xprintf("#%i %s\n", i+1, btnames[i]);
-	}
-
-	free(btnames);
-#else
 	out.writeline("Backtraces aren't available in this system.");
-#endif
 }
 
 char *mrd::obtain_frame_description(void *ptr) const {
-#if defined(__GLIBC__) && !defined(__UCLIBC__)
-	void *p[1] = { ptr };
-
-	char **names = backtrace_symbols(p, 1);
-	char *ret = strdup(names[0]);
-	free(names);
-
-	return ret;
-#else
 	return 0;
-#endif
 }
 
 void *mrd::posix_uctx::get_current_frame() const {
-#if defined(__GLIBC__)
-#if defined(__i386__)
-	return (void *)base->uc_mcontext.gregs[REG_EIP];
-#elif defined(__mips__)
-	return (void *)base->uc_mcontext.gpregs[CTX_EPC];
-#endif
-#endif
 	return 0;
 }