|
From: Nicholas N. <nj...@cs...> - 2006-04-12 07:34:14
|
On Tue, 11 Apr 2006, Erick Reyes wrote: > Hello , we are a group of students, of San Carlos University of Guatemala= , > we have a project, in which we have to use as a base Valgrind, understand > and modify it. > We have to use it in order to map the memory and describe which proceses = are > using which blocks of memory. We have been searching but we just found t= he > functions than VAlgrid does,and don=B4t understand what is the objective = of > each function of the source. We downloaded the source, and we want to fi= nd > in the source where the map of memory begin. The file coregrind/m_aspacemgr/aspacemgr.c controls the layout of the=20 address space. It would be a good place to start. There is a long comment= =20 at the top of that file that gives a good overview of how it works. The=20 functions that are exported from that file are in=20 coregrind/pub_core_aspacemgr.h and include/pub_tool_aspacemgr.h. If you run "valgrind -d <program>" you will see a memory map. You can see = a=20 very similar memory map without using Valgrind if you look at the file=20 /proc/<pid>/maps, where <pid> is the process ID of the process you are=20 interestd in. /proc/self/maps gives thegives the memory map for the=20 current process. For example, run "cat /proc/self/maps" to see the memory= =20 map for 'cat'. > We would like, if you can give us more technical information, information > which describes more what each file do, and were are the function and fil= es > that makes the memory mapping or how do you read the memory blocks. There is no central document on the structure of Valgrind. Some subsystems= =20 are described in docs/internals/, but not many. Some of the files have=20 comments within them that are helpful (such as aspacemgr.c). > We are also looking for information that tell us how can we modify the=20 > valgrind library and use it, how we can make changes in the source and=20 > then compile it. That's easy. To install, follow the instructions in the README. If you= =20 modify the code, just rebuild and reinstall it. If you want to skip the=20 reinstall step, there are instruction how in README_DEVELOPERS. Nick > Thanks for your atention and help that you can give us > > Andrea Rivera > Erick Reyes |