From: Julian Seward Date: Tue, 20 Sep 2011 16:10:59 +0000 (+0000) Subject: Get rid of DebugInfo::memname, a hangover from the now-removed X-Git-Tag: svn/VALGRIND_3_7_0~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b97c829a039dad21d8312ee84e205541930c1dc;p=thirdparty%2Fvalgrind.git Get rid of DebugInfo::memname, a hangover from the now-removed AIX5 support. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12040 --- diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 66ac344931..3a4b621ac5 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -168,8 +168,7 @@ static ULong handle_counter = 1; /* Allocate and zero out a new DebugInfo record. */ static -DebugInfo* alloc_DebugInfo( const UChar* filename, - const UChar* memname ) +DebugInfo* alloc_DebugInfo( const UChar* filename ) { Bool traceme; DebugInfo* di; @@ -179,15 +178,11 @@ DebugInfo* alloc_DebugInfo( const UChar* filename, di = ML_(dinfo_zalloc)("di.debuginfo.aDI.1", sizeof(DebugInfo)); di->handle = handle_counter++; di->filename = ML_(dinfo_strdup)("di.debuginfo.aDI.2", filename); - di->memname = memname ? ML_(dinfo_strdup)("di.debuginfo.aDI.3", memname) - : NULL; /* Everything else -- pointers, sizes, arrays -- is zeroed by ML_(dinfo_zalloc). Now set up the debugging-output flags. */ traceme - = VG_(string_match)( VG_(clo_trace_symtab_patt), filename ) - || (memname && VG_(string_match)( VG_(clo_trace_symtab_patt), - memname )); + = VG_(string_match)( VG_(clo_trace_symtab_patt), filename ); if (traceme) { di->trace_symtab = VG_(clo_trace_symtab); di->trace_cfi = VG_(clo_trace_cfi); @@ -464,25 +459,20 @@ static void discard_DebugInfos_which_overlap_with ( DebugInfo* diRef ) } -/* Find the existing DebugInfo for (memname,filename) or if not found, - create one. In the latter case memname and filename are strdup'd - into VG_AR_DINFO, and the new DebugInfo is added to - debugInfo_list. */ -static -DebugInfo* find_or_create_DebugInfo_for ( UChar* filename, UChar* memname ) +/* Find the existing DebugInfo for |filename| or if not found, create + one. In the latter case |filename| is strdup'd into VG_AR_DINFO, + and the new DebugInfo is added to debugInfo_list. */ +static DebugInfo* find_or_create_DebugInfo_for ( UChar* filename ) { DebugInfo* di; vg_assert(filename); for (di = debugInfo_list; di; di = di->next) { vg_assert(di->filename); - if (0==VG_(strcmp)(di->filename, filename) - && ( (memname && di->memname) - ? 0==VG_(strcmp)(memname, di->memname) - : True )) + if (0==VG_(strcmp)(di->filename, filename)) break; } if (!di) { - di = alloc_DebugInfo(filename, memname); + di = alloc_DebugInfo(filename); vg_assert(di); di->next = debugInfo_list; debugInfo_list = di; @@ -779,7 +769,7 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV ) /* See if we have a DebugInfo for this filename. If not, create one. */ - di = find_or_create_DebugInfo_for( filename, NULL/*membername*/ ); + di = find_or_create_DebugInfo_for( filename ); vg_assert(di); if (is_rx_map) { @@ -1107,7 +1097,7 @@ void VG_(di_notify_pdb_debuginfo)( Int fd_obj, Addr avma_obj, /* dump old info for this range, if any */ discard_syms_in_range( avma_obj, total_size ); - { DebugInfo* di = find_or_create_DebugInfo_for(exename, NULL/*membername*/ ); + { DebugInfo* di = find_or_create_DebugInfo_for(exename); /* this di must be new, since we just nuked any old stuff in the range */ vg_assert(di && !di->have_rx_map && !di->have_rw_map); @@ -1466,7 +1456,6 @@ Bool VG_(get_datasym_and_offset)( Addr data_addr, require debug info. Caller supplies buf and nbuf. */ Bool VG_(get_objname) ( Addr a, Char* buf, Int nbuf ) { - Int used; DebugInfo* di; const NSegment *seg; HChar* filename; @@ -1479,17 +1468,6 @@ Bool VG_(get_objname) ( Addr a, Char* buf, Int nbuf ) && di->text_avma <= a && a < di->text_avma + di->text_size) { VG_(strncpy_safely)(buf, di->filename, nbuf); - if (di->memname) { - used = VG_(strlen)(buf); - if (used < nbuf) - VG_(strncpy_safely)(&buf[used], "(", nbuf-used); - used = VG_(strlen)(buf); - if (used < nbuf) - VG_(strncpy_safely)(&buf[used], di->memname, nbuf-used); - used = VG_(strlen)(buf); - if (used < nbuf) - VG_(strncpy_safely)(&buf[used], ")", nbuf-used); - } buf[nbuf-1] = 0; return True; } diff --git a/coregrind/m_debuginfo/priv_storage.h b/coregrind/m_debuginfo/priv_storage.h index 77fa773fbb..0cf8a72057 100644 --- a/coregrind/m_debuginfo/priv_storage.h +++ b/coregrind/m_debuginfo/priv_storage.h @@ -436,7 +436,6 @@ struct _DebugInfo { VG_(di_notify_mmap) and its immediate helpers. */ UChar* filename; /* in mallocville (VG_AR_DINFO) */ - UChar* memname; /* also in VG_AR_DINFO. AIX5 only: .a member name */ Bool have_rx_map; /* did we see a r?x mapping yet for the file? */ Bool have_rw_map; /* did we see a rw? mapping yet for the file? */ diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c index f84b05234b..da38af333a 100644 --- a/coregrind/m_debuginfo/readelf.c +++ b/coregrind/m_debuginfo/readelf.c @@ -1217,7 +1217,6 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di ) vg_assert(di->rw_map_size > 0); vg_assert(di->have_dinfo == False); vg_assert(di->filename); - vg_assert(!di->memname); vg_assert(!di->symtab); vg_assert(!di->loctab); vg_assert(!di->cfsi);