From: Florian Krohm Date: Thu, 30 Apr 2015 17:34:04 +0000 (+0000) Subject: Fix the namespace of the functions dealing with segment names. X-Git-Tag: svn/VALGRIND_3_11_0~442 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=307f73e22bba69dec495e00785e1de3bb94617c9;p=thirdparty%2Fvalgrind.git Fix the namespace of the functions dealing with segment names. As those are private to the address space manager they should be ML_ not VG_ prefixed. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15165 --- diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index d1740f7b87..d5e0be8f27 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -421,7 +421,7 @@ static void show_len_concisely ( /*OUT*/HChar* buf, Addr start, Addr end ) static void show_nsegment_full ( Int logLevel, Int segNo, const NSegment* seg ) { HChar len_buf[20]; - const HChar* name = VG_(am_get_segname)( seg->fnIdx ); + const HChar* name = ML_(am_get_segname)( seg->fnIdx ); if (name == NULL) name = "(none)"; @@ -439,7 +439,7 @@ static void show_nsegment_full ( Int logLevel, Int segNo, const NSegment* seg ) seg->isCH ? 'H' : '-', show_ShrinkMode(seg->smode), seg->dev, seg->ino, seg->offset, - VG_(am_segname_get_seqnr)(seg->fnIdx), seg->fnIdx, + ML_(am_segname_get_seqnr)(seg->fnIdx), seg->fnIdx, name ); } @@ -486,7 +486,7 @@ static void show_nsegment ( Int logLevel, Int segNo, const NSegment* seg ) seg->hasX ? 'x' : '-', seg->hasT ? 'T' : '-', seg->isCH ? 'H' : '-', seg->dev, seg->ino, seg->offset, - VG_(am_segname_get_seqnr)(seg->fnIdx), seg->fnIdx + ML_(am_segname_get_seqnr)(seg->fnIdx), seg->fnIdx ); break; @@ -520,7 +520,7 @@ void VG_(am_show_nsegments) ( Int logLevel, const HChar* who ) VG_(debugLog)(logLevel, "aspacem", "<<< SHOW_SEGMENTS: %s (%d segments)\n", who, nsegments_used); - VG_(am_show_segnames)( logLevel, who); + ML_(am_show_segnames)( logLevel, who); for (i = 0; i < nsegments_used; i++) show_nsegment( logLevel, i, &nsegments[i] ); VG_(debugLog)(logLevel, "aspacem", @@ -533,7 +533,7 @@ void VG_(am_show_nsegments) ( Int logLevel, const HChar* who ) const HChar* VG_(am_get_filename)( NSegment const * seg ) { aspacem_assert(seg); - return VG_(am_get_segname)( seg->fnIdx ); + return ML_(am_get_segname)( seg->fnIdx ); } /* Collect up the start addresses of segments whose kind matches one of @@ -621,7 +621,7 @@ static Bool sane_NSegment ( const NSegment* s ) case SkFileC: case SkFileV: return s->smode == SmFixed - && VG_(am_sane_segname)(s->fnIdx) + && ML_(am_sane_segname)(s->fnIdx) && !s->isCH; case SkResvn: @@ -675,7 +675,7 @@ static Bool maybe_merge_nsegments ( NSegment* s1, const NSegment* s2 ) + ((ULong)s2->start) - ((ULong)s1->start) ) { s1->end = s2->end; s1->hasT |= s2->hasT; - VG_(am_dec_refcount)(s1->fnIdx); + ML_(am_dec_refcount)(s1->fnIdx); return True; } break; @@ -1366,7 +1366,7 @@ static void split_nsegment_at ( Addr a ) nsegments[i+1].offset += ((ULong)nsegments[i+1].start) - ((ULong)nsegments[i].start); - VG_(am_inc_refcount)(nsegments[i].fnIdx); + ML_(am_inc_refcount)(nsegments[i].fnIdx); aspacem_assert(sane_NSegment(&nsegments[i])); aspacem_assert(sane_NSegment(&nsegments[i+1])); @@ -1431,7 +1431,7 @@ static void add_segment ( const NSegment* seg ) that decrement the reference counters for the segments names of the replaced segments. */ for (i = iLo; i <= iHi; ++i) - VG_(am_dec_refcount)(nsegments[i].fnIdx); + ML_(am_dec_refcount)(nsegments[i].fnIdx); delta = iHi - iLo; aspacem_assert(delta >= 0); if (delta > 0) { @@ -1528,7 +1528,7 @@ static void read_maps_callback ( Addr addr, SizeT len, UInt prot, # endif // defined(VGP_arm_linux) if (filename) - seg.fnIdx = VG_(am_allocate_segname)( filename ); + seg.fnIdx = ML_(am_allocate_segname)( filename ); if (0) show_nsegment( 2,0, &seg ); add_segment( &seg ); @@ -1570,7 +1570,7 @@ Addr VG_(am_startup) ( Addr sp_at_startup ) aspacem_assert(sizeof(SSizeT) == sizeof(void*)); /* Initialise the string table for segment names. */ - VG_(am_segnames_init)(); + ML_(am_segnames_init)(); /* Check that we can store the largest imaginable dev, ino and offset numbers in an NSegment. */ @@ -2014,7 +2014,7 @@ VG_(am_notify_client_mmap)( Addr a, SizeT len, UInt prot, UInt flags, seg.mode = mode; } if (ML_(am_resolve_filename)(fd, buf, VKI_PATH_MAX)) { - seg.fnIdx = VG_(am_allocate_segname)( buf ); + seg.fnIdx = ML_(am_allocate_segname)( buf ); } } add_segment( &seg ); @@ -2236,9 +2236,9 @@ SysRes VG_(am_mmap_named_file_fixed_client) seg.mode = mode; } if (name) { - seg.fnIdx = VG_(am_allocate_segname)( name ); + seg.fnIdx = ML_(am_allocate_segname)( name ); } else if (ML_(am_resolve_filename)(fd, buf, VKI_PATH_MAX)) { - seg.fnIdx = VG_(am_allocate_segname)( buf ); + seg.fnIdx = ML_(am_allocate_segname)( buf ); } add_segment( &seg ); @@ -2543,7 +2543,7 @@ static SysRes VG_(am_mmap_file_float_valgrind_flags) ( SizeT length, UInt prot, seg.mode = mode; } if (ML_(am_resolve_filename)(fd, buf, VKI_PATH_MAX)) { - seg.fnIdx = VG_(am_allocate_segname)( buf ); + seg.fnIdx = ML_(am_allocate_segname)( buf ); } add_segment( &seg ); diff --git a/coregrind/m_aspacemgr/aspacemgr-segnames.c b/coregrind/m_aspacemgr/aspacemgr-segnames.c index 481b58ea88..7fcacf4864 100644 --- a/coregrind/m_aspacemgr/aspacemgr-segnames.c +++ b/coregrind/m_aspacemgr/aspacemgr-segnames.c @@ -272,7 +272,7 @@ put_sentinel(UInt ix) If none is found, an index is allocated and the name stored. If running ouf of memory, return -1. */ Int -VG_(am_allocate_segname)(const HChar *name) +ML_(am_allocate_segname)(const HChar *name) { UInt len, ix, size, next_freeslot; @@ -349,7 +349,7 @@ VG_(am_allocate_segname)(const HChar *name) /* Debugging output */ void -VG_(am_show_segnames)(Int logLevel, const HChar *prefix) +ML_(am_show_segnames)(Int logLevel, const HChar *prefix) { UInt size, ix, i; @@ -378,7 +378,7 @@ VG_(am_show_segnames)(Int logLevel, const HChar *prefix) Used in aspacemgr debug output to associate a segment with a segment name. */ Int -VG_(am_segname_get_seqnr)(Int fnIdx) +ML_(am_segname_get_seqnr)(Int fnIdx) { SizeT ix, size; Int seqnr = -1; @@ -399,7 +399,7 @@ VG_(am_segname_get_seqnr)(Int fnIdx) /* Initialise the string table for segment names. It contains an empty string which is not referenced. */ void -VG_(am_segnames_init)(void) +ML_(am_segnames_init)(void) { aspacem_assert(sizeof segnames >= overhead); @@ -409,7 +409,7 @@ VG_(am_segnames_init)(void) /* Increase reference count of segment name identified by IX. */ void -VG_(am_inc_refcount)(Int ix) +ML_(am_inc_refcount)(Int ix) { if (ix != -1) inc_refcount(ix); @@ -417,20 +417,20 @@ VG_(am_inc_refcount)(Int ix) /* Decrease reference count of segment name identified by IX. */ void -VG_(am_dec_refcount)(Int ix) +ML_(am_dec_refcount)(Int ix) { if (ix != -1) dec_refcount(ix); } Bool -VG_(am_sane_segname)(Int ix) +ML_(am_sane_segname)(Int ix) { return ix == -1 || (ix >= overhead && ix < segnames_used); } const HChar * -VG_(am_get_segname)(Int ix) +ML_(am_get_segname)(Int ix) { return (ix == -1) ? NULL : segnames + ix; } diff --git a/coregrind/m_aspacemgr/priv_aspacemgr.h b/coregrind/m_aspacemgr/priv_aspacemgr.h index c36dc3af30..13d3dfff8e 100644 --- a/coregrind/m_aspacemgr/priv_aspacemgr.h +++ b/coregrind/m_aspacemgr/priv_aspacemgr.h @@ -132,27 +132,27 @@ extern void ML_(am_do_sanity_check)( void ); /* ------ Implemented in aspacemgr-segnames.c ------ */ -void VG_(am_segnames_init)(void); -void VG_(am_show_segnames)(Int logLevel, const HChar *prefix); +void ML_(am_segnames_init)(void); +void ML_(am_show_segnames)(Int logLevel, const HChar *prefix); /* Put NAME into the string table of segment names. Return index for future reference. A return value of -1 indicates that the segment name could not be stored. Basically an out-of-memory situation. */ -Int VG_(am_allocate_segname)(const HChar *name); +Int ML_(am_allocate_segname)(const HChar *name); /* Increment / decrement the reference counter for this segment name. */ -void VG_(am_inc_refcount)(Int); -void VG_(am_dec_refcount)(Int); +void ML_(am_inc_refcount)(Int); +void ML_(am_dec_refcount)(Int); /* Check whether the segname index is sane. */ -Bool VG_(am_sane_segname)(Int fnIdx); +Bool ML_(am_sane_segname)(Int fnIdx); /* Return the segment name for the given index. Maybe return NULL, if the segment does not have a name. */ -const HChar *VG_(am_get_segname)(Int fnIdx); +const HChar *ML_(am_get_segname)(Int fnIdx); /* Return the sequence number of the segment name */ -Int VG_(am_segname_get_seqnr)(Int fnIdx); +Int ML_(am_segname_get_seqnr)(Int fnIdx); #endif // __PRIV_ASPACEMGR_H