|
From: Nicholas N. <nj...@ca...> - 2003-09-12 08:23:55
|
On Thu, 11 Sep 2003, Matthew Tippett wrote: > Is it possible to configure valgrind to display reads and > writes to memory locations if they can be determined? For > example, debugging a XFree86 driver by looking at what what > is written to different parts of memory. > > Obviously with instrumentation this would appear to be possible, > but I am wondering if there is a valgrind skin that allows you > to do something like... > > valgrind --skin=memwatch --region=000a0000-000c0000 X > > And consequently understand all the reads and writes (and > possibly execution) of data and code in the BIOS. No current skin can do that, but it would be easy to do. Try modifying Cachegrind (cachegrind/cg_main.c). The SK_(instrument) function does the instrumentation. It's already setup to call one of several C functions on every memory-accessing instruction. Change it to call a different C function that prints out (or whatever) the accesses in the given range. Adding command-line options to skins is pretty easy, look at clo_I1_cache for an example in Cachegrind. There's a fair bit of stuff to know about when writing skins, but using Cachegrind as a starting point will make it fairly easy, and provide a good example. Write back (me or the list) if you have problems. N |