summaryrefslogtreecommitdiffstats
path: root/devel/bug-buddy/files/patch-gnome-breakpad_gnome-breakpad.cc
blob: 801be10640bf7f244eb94dad0bea042a095ee90d (plain) (blame)
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
--- gnome-breakpad/gnome-breakpad.cc.orig   2007-08-16 13:55:38.000000000 -0400
+++ gnome-breakpad/gnome-breakpad.cc    2007-09-02 19:21:10.000000000 -0400
@@ -6,8 +6,14 @@
 #include <cassert>
 #include <cstring>
 
+#ifdef __FreeBSD__
+#include <sys/param.h>
+#endif
+
+#if !defined(__FreeBSD__) || __FreeBSD_version > 700024
 #include <libelf.h>
 #include <gelf.h>
+#endif
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -114,6 +120,7 @@ find_in_debug_path (const char *filename
 }
    
 
+#if !defined(__FreeBSD__) || __FreeBSD_version > 700024
 static gboolean
 elf_has_debug_symbols (const char *filename)
 {
@@ -166,7 +173,7 @@ elf_has_debug_symbols (const char *filen
        elf_end (elf);
        return false;
 }
-
+#endif
 
 
 
@@ -269,9 +276,17 @@ check_if_gdb (void *callback_context)
        _exit(0);
    }
    
+#if !defined(__FreeBSD__) || __FreeBSD_version > 700024
    memset(mypath, 0, sizeof(mypath));
+#ifndef __FreeBSD__
    readlink ("/proc/self/exe", mypath, sizeof(mypath));
+#else
+   readlink ("/proc/curproc/file", mypath, sizeof(mypath));
+#endif
    has_debug_symbols = elf_has_debug_symbols (mypath);
+#else
+   has_debug_symbols = TRUE;
+#endif
 
 
    if (bugbuddy && gdb && has_debug_symbols) {