Changes between Version 6 and Version 7 of Tools/Memory Checker


Ignore:
Timestamp:
Feb 2, 2009, 4:54:32 PM (15 years ago)
Author:
Nicolas Pouillon
Comment:

Init

Legend:

Unmodified
Added
Removed
Modified
  • Tools/Memory Checker

    v6 v7  
    33The Memory checker tool is a software memory access debugger for !SoClib.
    44
    5 == Overview ==
     5= Overview =
    66
    77The Memory checker is able to perform several analysis on memory accesses performed by the running software to track software bugs. Access to uninitialized or freed data and stack overflow are examples of reported behaviors. It acts as the [http://valgrind.org/ valgrind] memory checker tool found on some UNIX.
     
    4040An exception can be reported to an optional `GdbServer` module to stop processor execution when a suspicious memory access happened. This enables further analysis of buggy software. When using the Memory checker with the `GdbServer`, the Memory checker must wrap the processor directly and must be wrapped in the GdbServer.
    4141
    42 == Usage ==
     42= Usage =
    4343
    44 === Adding Memory checker support to your platform ===
     44== Adding Memory checker support to your platform ==
    4545
    4646Adding the !GdbServer to your topcell is easy. First include the header:
     
    5454{{{
    5555   // Without Memory checker
    56 // soclib::caba::VciXcacheWrapper<soclib::common::Mips32ElIss> cpu0("cpu0", 0, maptab, IntTab(0), 1,8,4, 1,8,4);
     56   // soclib::caba::VciXcacheWrapper<soclib::common::Mips32ElIss> cpu0("cpu0", 0, maptab, IntTab(0), 1,8,4, 1,8,4);
    5757
    5858   // With Memory checker
    59    soclib::common::Memchecker<soclib::common::Mips32ElIss>::init(maptab, loader);
     59   soclib::common::Memchecker<soclib::common::Mips32ElIss>::init(maptab, loader, "tty,ramdac_ctrl");
    6060   soclib::caba::VciXcacheWrapper<soclib::common::IssMemchecker<soclib::common::Mips32ElIss> > cpu0("cpu0", 0, maptab, IntTab(0), 1,8,4, 1,8,4);
    6161}}}
     
    6767}}}
    6868
    69 === Using an instrumented operating system ===
     69== Initializer description ==
     70
     71The line:
     72{{{
     73soclib::common::Memchecker<soclib::common::Mips32ElIss>::init(maptab, loader, "tty,ramdac_ctrl");
     74}}}
     75tackes the following arguments:
     76 * `maptab`: the platform's `!MappingTable`, in order to know where memory is mapped.
     77 * `loader`: the platform's `!ElfLoader`, in order to know memory layout, initialized or constant parts, ...
     78 * `"tty,ramdac_ctrl"` a list of exclusions in the `!MappingTable` segment's names. You should ignore any segment mapped to a device.
     79
     80== Using an instrumented operating system ==
    7081
    7182The running operating system must communicate with the Memory checker to report information about context creation (stack range), and memory-allocator operations. This is done through read/write operations in specific memory locations which are intercepted by the Memory checker and not forwarded to the rest of the platform.
     
    7889 * The Memory checker registers bank is protected by a magic value and is unlikely to be modified by an other running software.
    7990
    80 == Output example ==
     91= Output example =
    8192
    8293With the following code using an unitialized stack variable to set a global: