blob: 7a76584417bfbe57588bd5e5bb7553f139bf3a98 (
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
|
--- base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace_posix.cc.orig 2023-12-23 12:33:28 UTC
+++ base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/debug/stack_trace_posix.cc
@@ -12,11 +12,11 @@
#include <string.h>
#include <unistd.h>
-#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_APPLE)
+#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
#include <link.h> // For ElfW() macro.
#endif
-#if BUILDFLAG(IS_APPLE)
+#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
#define HAVE_DLADDR
#include <dlfcn.h>
#endif
@@ -25,7 +25,7 @@ namespace partition_alloc::internal::base::debug {
namespace {
-#if !BUILDFLAG(IS_APPLE)
+#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
constexpr size_t kBufferSize = 4096u;
@@ -359,7 +359,7 @@ void PrintStackTraceInternal(const void** trace, size_
}
#endif // !BUILDFLAG(IS_APPLE)
-#if BUILDFLAG(IS_APPLE)
+#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
// Since /proc/self/maps is not available, use dladdr() to obtain module
// names and offsets inside the modules from the given addresses.
void PrintStackTraceInternal(const void* const* trace, size_t size) {
|