ftmemsim-valgrind/docs/directory-structure
Nicholas Nethercote f174930b23 Final commit for the initial modularisation pass:
- Broke part of m_scheduler off into a new module m_threadstate.  It
  contains ThreadState, VG_(threads)[] and some basic operations on the
  thread table.  All simple stuff, the complex stuff stays in m_scheduler.
  This avoids lots of circular dependencies between m_scheduler and other
  modules.

- Managed to finally remove core.h and tool.h, double hurrah!

- Introduced pub_tool_basics.h and pub_core_basics.h, one of which is
  include by every single C file.

- Lots of little cleanups and changes related to the above.

- I even did a small amount of documentation updating.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3944
2005-06-19 01:24:32 +00:00

73 lines
2.4 KiB
Plaintext

-------------------------------------------------------------------
Guide to the directory structure
-------------------------------------------------------------------
[This should be merged with coregrind/README_MODULES.txt]
Valgrind has 2 main levels of genericity.
1. Multiple tools, plus the core.
2. Multiple architectures, OSes, and platforms (arch/OS combinations).
This file is a guide to where different things live.
Basic layout
------------
1. Core stuff lives in:
- include/ for declarations that must be seen by tools
- coregrind/ for code that need not be seen by tools
Some subdirs of coregrind/ hold modules that consist of multiple files.
Tool stuff lives in:
- $TOOL/ main files
- $TOOL/tests regression tests
- $TOOL/docs documentation
Other stuff lives in:
- docs/ main, non-tool-specific docs
- tests/ regression test machinery
- nightly/ overnight test stuff (should be in tests/)
- auxprogs/ auxiliary programs
2. Generic things go in the directory specified in (1).
Arch-specific, OS-specific, or platform-specific things are sprinkled
throughout the code -- there is no single place for all the
architecture-specific things, for example.
Sometimes we have a whole file holding things specific to a particular
arch/OS/platform. Such files have an appropriate suffix, eg.
sigframe-x86-linux.c.
More often we use #ifdefs inside source files to specify the different
cases for different archs/OSes/platforms. It's pretty straightforward.
A final case: arch-specific regression tests for tools go in a
subdirectory, eg. cachegrind/tests/x86/.
Guide to headers
----------------
See coregrind/README_MODULES.txt for details of the core/tool header file
split.
Note that every single C file will #include pub_basics.h. Every single asm
file will #include pub_basics_asm.h.
Our versions of kernel types are in the vki*.h headers.
When searching for something, rgrep is very useful. If you don't have a
version of rgrep, use a command something like this:
find . -name '*.h' | xargs grep <pattern>
find . -name '*.h' \
-type f \
-not -path '*.svn\/*' | xargs grep "$1"
The -name option gives the file wildcard, the -type says "look in normal
files only" and the -not -path tells it to not look in Subversions hidden
directories.