From 3aeeb21b82915a3d03e75a88ded93049a5c1730c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 20 Aug 2020 13:36:44 -0700 Subject: [PATCH] update libunwind to llvm11rc2 --- lib/libunwind/src/AddressSpace.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/libunwind/src/AddressSpace.hpp b/lib/libunwind/src/AddressSpace.hpp index a4564cb673..e40c23291f 100644 --- a/lib/libunwind/src/AddressSpace.hpp +++ b/lib/libunwind/src/AddressSpace.hpp @@ -452,10 +452,12 @@ struct _LIBUNWIND_HIDDEN dl_iterate_cb_data { #error "_LIBUNWIND_SUPPORT_DWARF_UNWIND requires _LIBUNWIND_SUPPORT_DWARF_INDEX on this platform." #endif +#if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE) #include "FrameHeaderCache.hpp" // There should be just one of these per process. static FrameHeaderCache ProcessFrameHeaderCache; +#endif static bool checkAddrInSegment(const Elf_Phdr *phdr, size_t image_base, dl_iterate_cb_data *cbdata) { @@ -476,8 +478,10 @@ int findUnwindSectionsByPhdr(struct dl_phdr_info *pinfo, size_t pinfo_size, auto cbdata = static_cast(data); if (pinfo->dlpi_phnum == 0 || cbdata->targetAddr < pinfo->dlpi_addr) return 0; +#if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE) if (ProcessFrameHeaderCache.find(pinfo, pinfo_size, data)) return 1; +#endif Elf_Addr image_base = calculateImageBase(pinfo); bool found_obj = false; @@ -505,7 +509,9 @@ int findUnwindSectionsByPhdr(struct dl_phdr_info *pinfo, size_t pinfo_size, found_obj = checkAddrInSegment(phdr, image_base, cbdata); } if (found_obj && found_hdr) { +#if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE) ProcessFrameHeaderCache.add(cbdata->sects); +#endif return 1; } }