mirror of
https://git.freebsd.org/ports.git
synced 2025-07-06 20:09:14 -04:00
Approved by: rene (mentor) Security: https://vuxml.freebsd.org/freebsd/310ca30e-a951-11ed-8314-a8a1599412c6.html
38 lines
1.4 KiB
C++
38 lines
1.4 KiB
C++
--- base/debug/stack_trace_posix.cc.orig 2023-02-08 09:03:45 UTC
|
|
+++ base/debug/stack_trace_posix.cc
|
|
@@ -39,7 +39,7 @@
|
|
#include <AvailabilityMacros.h>
|
|
#endif
|
|
|
|
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
|
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
|
|
#include "base/debug/proc_maps_linux.h"
|
|
#endif
|
|
|
|
@@ -714,6 +714,9 @@ class SandboxSymbolizeHelper {
|
|
// for the modules that are loaded in the current process.
|
|
// Returns true on success.
|
|
bool CacheMemoryRegions() {
|
|
+#if BUILDFLAG(IS_BSD)
|
|
+ return false;
|
|
+#else
|
|
// Reads /proc/self/maps.
|
|
std::string contents;
|
|
if (!ReadProcMaps(&contents)) {
|
|
@@ -731,6 +734,7 @@ class SandboxSymbolizeHelper {
|
|
|
|
is_initialized_ = true;
|
|
return true;
|
|
+#endif
|
|
}
|
|
|
|
// Opens all object files and caches their file descriptors.
|
|
@@ -887,7 +891,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
|
|
// If we do not have unwind tables, then try tracing using frame pointers.
|
|
return base::debug::TraceStackFramePointers(const_cast<const void**>(trace),
|
|
count, 0);
|
|
-#elif !defined(__UCLIBC__) && !defined(_AIX)
|
|
+#elif !defined(__UCLIBC__) && !defined(_AIX) && !BUILDFLAG(IS_BSD)
|
|
// Though the backtrace API man page does not list any possible negative
|
|
// return values, we take no chance.
|
|
return base::saturated_cast<size_t>(
|