|
From: Matthew T. <mat...@sy...> - 2003-09-11 17:35:06
|
Hello, I am investigating using valgrind for tracking MMIO access. 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. Looking forward to replies (and am more than willing to be a guinea pig!). Regards, Matthew |
|
From: <mat...@sy...> - 2003-09-11 17:31:08
|
Hello, I am investigating using valgrind for tracking MMIO access. 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. Looking forward to replies (and am more than willing to be a guinea pig!). Regards, Matthew |
|
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 |
|
From: Robert W. <rj...@du...> - 2003-09-11 18:46:54
|
> 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. I wrote a patch some months back to allow watchpoints. I haven't tested it in a while, but I could blow the dust off of it and see if I can get it working again. It uses client requests, but I could add a command-line option, I suppose. Regards, Robert. |
|
From: Robert W. <rj...@du...> - 2003-09-14 00:48:28
|
Hi Matthew, The new watchpoint patch is now available at: http://www.durables.org/software/valgrind/ To set watchpoints on the command line, use the following option: --watchpoint=3DWP If WP is a single number, watch that address only. If WP is of the form X-Y, watch the range of addresses from X to Y. If WP is of the form X+Y, watch the range of addresses from X to X+Y. X and Y can be decimal or hexadecimal numbers. Hex numbers are prefixed by 0x. You can specify as many watchpoints as you want. e.g.: valgrind --watchpoint=3D0xBFFFF400 ls This watches the single byte at 0xBFFFF400 valgrind --watchpoint=3D0xBFFFF400-0xBFFFF500 This watches the range from 0xBFFFF400 to 0xBFFFF500. valgrind --watchpoint=3D0xBFFFF500+256 This watches the 256 bytes starting at 0xBFFFF500 Watchpoints will be triggered if: * the watched addresses are read from or written to * the watched addresses go in to or out of scope on the stack * memory is allocated or freed over the watched addresses Let me know if you run into any problems with this. Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |