From: Florian Krohm Date: Mon, 16 Feb 2015 22:58:30 +0000 (+0000) Subject: Translations are allowed from all client segments. Update comments X-Git-Tag: svn/VALGRIND_3_11_0~656 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=798e5a77076a59cbfd6d43760ee4c4654a87ea2e;p=thirdparty%2Fvalgrind.git Translations are allowed from all client segments. Update comments and rename VG_(am_set_segment_hasT_if_SkFileC_or_SkAnonC) to VG_(am_set_segment_hasT_if_client_segment). Change it so it handles all client segments. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14936 --- diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 6ab10440a2..04611ff4d4 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -2710,13 +2710,14 @@ void VG_(am_set_segment_isCH_if_SkAnonC)( const NSegment* seg ) } /* Same idea as VG_(am_set_segment_isCH_if_SkAnonC), except set the - segment's hasT bit (has-cached-code) if this is SkFileC or SkAnonC - segment. */ -void VG_(am_set_segment_hasT_if_SkFileC_or_SkAnonC)( const NSegment* seg ) + segment's hasT bit (has-cached-code) if this is a client segment, + i.e. SkFileC, SkAnonC, or SkShmC. */ +void VG_(am_set_segment_hasT_if_client_segment)( const NSegment* seg ) { aspacem_assert(seg != NULL); Int i = segAddr_to_index( seg ); - if (nsegments[i].kind == SkAnonC || nsegments[i].kind == SkFileC) { + if (nsegments[i].kind == SkAnonC || nsegments[i].kind == SkFileC || + nsegments[i].kind == SkShmC) { nsegments[i].hasT = True; } } diff --git a/coregrind/m_translate.c b/coregrind/m_translate.c index 8eb85b0c6c..3ae779a0e0 100644 --- a/coregrind/m_translate.c +++ b/coregrind/m_translate.c @@ -1772,14 +1772,14 @@ Bool VG_(translate) ( ThreadId tid, vg_assert( vge.base[0] == addr ); /* set 'translations taken from this segment' flag */ - VG_(am_set_segment_hasT_if_SkFileC_or_SkAnonC)( seg ); + VG_(am_set_segment_hasT_if_client_segment)( seg ); } /* END new scope specially for 'seg' */ for (i = 1; i < vge.n_used; i++) { NSegment const* seg = VG_(am_find_nsegment)( vge.base[i] ); /* set 'translations taken from this segment' flag */ - VG_(am_set_segment_hasT_if_SkFileC_or_SkAnonC)( seg ); + VG_(am_set_segment_hasT_if_client_segment)( seg ); } /* Copy data at trans_addr into the translation cache. */ diff --git a/coregrind/pub_core_aspacemgr.h b/coregrind/pub_core_aspacemgr.h index aec6add1b7..915c37a147 100644 --- a/coregrind/pub_core_aspacemgr.h +++ b/coregrind/pub_core_aspacemgr.h @@ -254,9 +254,9 @@ extern Bool VG_(am_change_ownership_v_to_c)( Addr start, SizeT len ); extern void VG_(am_set_segment_isCH_if_SkAnonC)( const NSegment* seg ); /* Same idea as VG_(am_set_segment_isCH_if_SkAnonC), except set the - segment's hasT bit (has-cached-code) if this is SkFileC or SkAnonC - segment. */ -extern void VG_(am_set_segment_hasT_if_SkFileC_or_SkAnonC)( const NSegment* ); + segment's hasT bit (has-cached-code) if this is a client segment, + i.e. SkFileC, SkAnonC, or SkShmC. */ +extern void VG_(am_set_segment_hasT_if_client_segment)( const NSegment* ); /* --- --- --- reservations --- --- --- */ diff --git a/include/pub_tool_aspacemgr.h b/include/pub_tool_aspacemgr.h index e48652659e..5edcb030fb 100644 --- a/include/pub_tool_aspacemgr.h +++ b/include/pub_tool_aspacemgr.h @@ -87,7 +87,7 @@ typedef // segment has no permissions hasR==hasW==hasX == False - Also: hasT==True is only allowed in SkFileC and SkAnonC + Also: hasT==True is only allowed in SkFileC, SkAnonC, and SkShmC (viz, not allowed to make translations from non-client areas) */ typedef