<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to DebuggingAndTesting</title><link>https://sourceforge.net/p/valgrind4win/wiki/DebuggingAndTesting/</link><description>Recent changes to DebuggingAndTesting</description><atom:link href="https://sourceforge.net/p/valgrind4win/wiki/DebuggingAndTesting/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 12 Jul 2012 23:43:50 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/valgrind4win/wiki/DebuggingAndTesting/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage DebuggingAndTesting modified by Christoph Schwarz</title><link>https://sourceforge.net/p/valgrind4win/wiki/DebuggingAndTesting/</link><description>## Running/Debugging ##
1. Compile all test cases: &lt;tt&gt;make check&lt;/tt&gt;
2. Run Valgrind from the &lt;tt&gt;.in-place&lt;/tt&gt; directory in a MSys shell
    * running hello world 32 bit: &lt;tt&gt;VALGRIND_LIB=.in_place coregrind/valgrind.exe memcheck/tests/windows/hello-x86-windows.exe&lt;/tt&gt;
    * running hello world 64 bit: &lt;tt&gt;VALGRIND_LIB=.in_place coregrind/valgrind.exe memcheck/tests/windows/hello-amd64-windows.exe&lt;/tt&gt;
    * running a memcheck test: &lt;tt&gt;VALGRIND_LIB=.in_place coregrind/valgrind.exe memcheck/tests/badaddrvalue.exe&lt;/tt&gt;
3. start Valgrind with &lt;tt&gt;--wait-for-gdb=yes&lt;/tt&gt; switch to let the tool wait for a debugger to attach (both gdb or WinDbg can attach this way)
4. Debugging C code:
    * compile code with &lt;tt&gt;make OPTIMIZE=-O0&lt;/tt&gt;
    * attach with gdb
5. Debugging Assembly code:
    * hardcode &lt;tt&gt;asm("int $3");&lt;/tt&gt; breakpoint(s) where desired
    * attach with WinDbg
    * control passes to WinDbg as soon as one of the hardcoded breakpoints is hit

## Tools ##
1. &lt;tt&gt;tests/windows&lt;/tt&gt; is the place for Windows-specific tools, compiling as 32 and 64 bit (or both) versions
    * currently there is only one tool: "strace", which can trace system calls and callbacks on the real CPU. Still work in progress:
    * no multi-threading
    * brute force syscall searching missing in 32 bit modes

## Tests ##
1. to build all tests, run &lt;tt&gt;make check&lt;/tt&gt;
2. &lt;tt&gt;memcheck/tests/windows&lt;/tt&gt; is the place for Windows-specific memcheck tests, compiling as 32 and 64 bit (or both) versions
    * current tests:
    * &lt;tt&gt;hello&lt;/tt&gt; - console hello world
    * &lt;tt&gt;hellowin&lt;/tt&gt; - GUI hello world
    * &lt;tt&gt;threadtest&lt;/tt&gt; - simple test if Valgrind can manage threads
3. Other tool tests (note that many but not all tests compile under Windows):
    * &lt;tt&gt;cachegrind/tests/*.exe&lt;/tt&gt; (3 tests)
    * &lt;tt&gt;callgrind/tests/*.exe&lt;/tt&gt; (2 tests)
    * &lt;tt&gt;exp-bbv/tests/x86/*.exe&lt;/tt&gt; (4 tests)
    * &lt;tt&gt;exp-sgcheck/tests/*.exe&lt;/tt&gt; (6 tests)
    * &lt;tt&gt;massif/tests/*.exe&lt;/tt&gt; (19 tests)
    * &lt;tt&gt;memcheck/tests/*.exe&lt;/tt&gt; (90 tests)
    * &lt;tt&gt;memcheck/tests/amd64/*.exe&lt;/tt&gt; (6 tests)
    * &lt;tt&gt;memcheck/tests/x86/*.exe&lt;/tt&gt; (8 tests)
    * &lt;tt&gt;none/tests/*.exe&lt;/tt&gt; (27 tests)
    * &lt;tt&gt;none/tests/amd64/*.exe&lt;/tt&gt; (25 tests)
    * &lt;tt&gt;none/tests/x86/*.exe&lt;/tt&gt; (19 tests)
    * &lt;tt&gt;perf/*.exe&lt;/tt&gt; (8 tests)
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christoph Schwarz</dc:creator><pubDate>Thu, 12 Jul 2012 23:43:50 -0000</pubDate><guid>https://sourceforge.netbc0b6add4b1b243a89f327eb1680a8173a28f1ac</guid></item></channel></rss>