|
From: Paul F. <pa...@so...> - 2022-10-20 21:15:22
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0ea3746e978420963760051e6f821f9b5c3d872d commit 0ea3746e978420963760051e6f821f9b5c3d872d Author: Paul Floyd <pj...@wa...> Date: Thu Oct 20 23:11:42 2022 +0200 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: --- coregrind/m_debuginfo/priv_storage.h | 6 +++--- coregrind/m_debuginfo/readmacho.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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); |