From: Paul Floyd Date: Thu, 20 Oct 2022 21:11:42 +0000 (+0200) Subject: Fix build on macOS X-Git-Tag: VALGRIND_3_20_0~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ea3746e978420963760051e6f821f9b5c3d872d;p=thirdparty%2Fvalgrind.git Fix build on macOS A while back when I added support for split RW PT_LOAD sections one instance in the macho code didn't get updated. Also update the comment that refers to the old struct member that got renamed. --- diff --git a/coregrind/m_debuginfo/priv_storage.h b/coregrind/m_debuginfo/priv_storage.h index f44ab43ffe..a4b90d36b3 100644 --- a/coregrind/m_debuginfo/priv_storage.h +++ b/coregrind/m_debuginfo/priv_storage.h @@ -541,9 +541,9 @@ ML_(cmp_for_DiAddrRange_range) ( const void* keyV, const void* elemV ); essentially an ultra-trivial finite state machine which, when it reaches an accept state, signals that we should now read debug info from the object into the associated struct _DebugInfo. The accept - state is arrived at when have_rx_map and have_rw_map both become - true. The initial state is one in which we have no observations, - so have_rx_map and have_rw_map are both false. + state is arrived at when have_rx_map is true and rw_map_count + is 1 or 2. The initial state is one in which we have no observations, + so have_rx_map is false and rw_map_count is 0. This all started as a rather ad-hoc solution, but was further expanded to handle weird object layouts, e.g. more than one rw diff --git a/coregrind/m_debuginfo/readmacho.c b/coregrind/m_debuginfo/readmacho.c index 61a3fe9f5a..33cc037b57 100644 --- a/coregrind/m_debuginfo/readmacho.c +++ b/coregrind/m_debuginfo/readmacho.c @@ -714,7 +714,7 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) /* This should be ensured by our caller (that we're in the accept state). */ vg_assert(di->fsm.have_rx_map); - vg_assert(di->fsm.have_rw_map); + vg_assert(di->fsm.rw_map_count); for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) { const DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i);