|
From: Nicholas N. <nj...@ca...> - 2002-10-11 11:20:26
|
On 10 Oct 2002, Jeremy Fitzhardinge wrote: > At the moment, not many skins have client callbacks (only memcheck, I > think). However, if other skins follow memcheck's example of starting > callbacks at VG_USERREQ__FINAL_DUMMY_CLIENT_REQUEST + 1, they will all > end up with overlapping numbers. > > This means that if a particular program under study has callbacks for > different skins, they will end up doing the wrong thing if run with the > wrong skin. It seems to me that there needs to be a systematic way for > skins to distinguish their callback numbers from each other. Yes, good point. > Well, since there seems to be a de-facto standard for each skin to have > a two letter code, I implemented a scheme to use it as a way for skins > to distinguish their client requests. > > I also made it not an error for a callback to be unimplemented, since > Valgrind is getting more capable with more skins, it will be common to > have a program with client requests inserted for multiple skins. As > part of this, I changed the interface to SK_(handle_client_request) so > that a skin can indicate that it did not handle the request, so that the > proper default return value can be returned. > > Patch against CVS head. This seems like a good way to do it, although I think I'll implement it slightly differently using a template function -- that must be defined if the client_requests need is set -- that returns the two letter prefix. Thanks for the good suggestion. N |