From 5c3f1794bc1ab053fd8c014b38f4746ed392d7cd Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Tue, 19 Sep 2023 19:53:06 +0200 Subject: [PATCH] FreeBSD: refactor VG_(load_all_debuginfo) Thanks to Philippe Waroquiers for the suggestion --- coregrind/m_debuginfo/debuginfo.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 4f6ffd48ae..51efe58c7a 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -5100,16 +5100,16 @@ static void caches__invalidate ( void ) { } #if defined(VGO_freebsd) +/* + * Used by FreeBSD if we detect a syscall cap_enter. That + * means capability mode, and lots of things won't work any more. + * Like opening new file handles. So try to make the most of a bad job + * and read all debuginfo in one go. + */ void VG_(load_all_debuginfo) (void) { for (DebugInfo* di = debugInfo_list; di; di = di->next) { - if (di->deferred == True) { - di->deferred = False; - ML_(read_elf_debug)( di ); - ML_(canonicaliseTables)( di ); - check_CFSI_related_invariants(di); - ML_(finish_CFSI_arrays)(di); - } + VG_(di_load_di)(di); } } #endif -- 2.47.3