|
From: Tom H. <to...@co...> - 2012-11-27 08:46:32
|
On 27/11/12 00:57, Alex Chiang wrote: > (apologies if this is the wrong list, valgrind-developers seemed > like it was just svn commits?) It's the right list, although we generally recommend handling patches by opening a bug and attaching the patch, so that it doesn't get forgotten about. > The use cases are: > - user may not have superuser permissions to install debug > packages on their system. > - even if user does have sudo, user might not want to install > 10s (or 100s) of debug packages on their system > - same as above but replace user with 'nightly automation script' We do already support searching .debug directory in the same location as the original executable, which doesn't help much with your use case here but does help in general with non-root users. > This is where my valgrind patch comes into play. Valgrind looks > in some hard-coded locations for debug files, and in my > experimentation with LD_PRELOAD and LD_LIBRARY_PATH, changing > those variables to point at the sandbox didn't seem to help > valgrind find the symbols. It follows (or should) the same rules as gdb etc do to look for separated debug information. > So I add a new command line parameter, --include-debugsyms-path, > and it tells valgrind to search a user-supplied path *in > addition* to the existing well-known search paths. > > Now valgrind can be told about the sandbox; it will pick up the > debug symbols and we can generate better logs. I don't change any > of the CRC checking logic, so any sort of validity checks should > still hold. > > It's not the most beautiful patch, but I tried to balance > straightforward against too much repetition of code. Certainly > the gotos could be removed, but would require a bit more > copy/paste of code (I think). I think it would be more flexible if valgrind just looked directly in the directory specified by the switch, rather than adding /usr/lib/debug to it - you can still do that by adding that to the switch value and other people get the benefit of just being able to say "this is where my debug files are". Tom -- Tom Hughes (to...@co...) http://compton.nu/ |