|
From: Jeroen N. W. <jn...@xs...> - 2005-11-05 09:13:14
|
> >> Julian, can you comment on what is_self() is meant to do exactly? >> Perhaps >> it would be better if it checked for the .in_place case as well as the >> /lib/valgrind case. > > It's a kludge. What happens is: > > - After the client is loaded and all ready to go, a loop at > m_main.c:2330 hands all segment descriptors off to VG_(di_notify_mmap), > which allows m_debuginfo to read debug info for any mappings it likes. > This is how the initial debug info is read. > > - VG_(di_notify_mmap) will read debug info from plausible-looking elf > files that are mapped for the client. But we also want to load the > debug info for V itself, and that is a non-client mapping. Hence: > > ok = (seg->kind == SkFileC || (seg->kind == SkFileV && > is_self(filename))) > && various other conditions > > is_self is simply a kludge to guess at what is the name of the V > executable > itself. Forgive my ignorance, but why do you need to check the segment's file name at all? Now that V is one static executable, the only file to have SkFileV should be the V executable anyway. Enabling 'show_nsegment()' in 'read_maps_callback()' in file coregrind/m_aspacemgr/aspacemgr.c seems be confirm this. Jeroen. > > The Right Way (tm) would be to get rid of is_self and instead do: > > seg->kind == SkFileC > || (seg->kind == SkFileV && 0==VG_(strcmp)(filename, argv[0] from > main()) > > Then it does not matter what the V executable is called or where > it is located. > > Then the only difficulty is to get main's argv[0] through to this > function. Maybe the least ugly is to pass it as a second arg to > VG_(di_notify_mmap) (or NULL from all other call sites), since > there's no obviously-correct place to put it as a global variable. > > J > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers > |