Cleaned up reading of debug info a bit.

Renamed:
  VG_(read_procselfmaps_contents)() --> VG_(read_procselfmaps)()
  VG_(read_procselfmaps)()          --> VG_(parse_procselfmaps)()
  VG_(read_symbols)()               --> VG_(read_all_symbols)()
  VG_(read_symtab_callback)()       --> VG_(read_seg_symbols)()

Removed the Bool 'read_from_file' arg from (what is now)
VG_(parse_procselfmaps)().  If /proc/self/maps needs to be read beforehand, the
code calls (what is now) VG_(read_procselfmaps)() before.  Still using the
static buffer which is not nice but good enough.

More importantly, I split up VG_(new_exe_segment)() into
VG_(new_exeseg_startup)() and VG_(new_exeseg_mmap)().  This is because at
startup, we were stupidly calling VG_(read_symbols)() for every exe seg, which
parses /proc/self/maps completely in order to load the debug info/symbols for
the exe seg (and any others we haven't already got the symbols for).  Despite
the fact that the startup code reads /proc/self/maps to know which segments are
there at startup.  In other words, we were reading /proc/self/maps several
times more often than necessary, and there were nested reads, which Stephan
Kulow's recent depth patch fixed (but in a pretty hacky way;  this commit fixes
it properly).  So VG_(new_exeseg_startup)() now doesn't cause /proc/self/maps
to be re-read.  Unfortunately we do have to re-read /proc/self/maps for mmap(),
because we don't know the filename from the mmap() call (only the file
descriptor, which isn't enough).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1830 a5019735-40e9-0310-863c-91ae7b9d1cf9
6 files changed