Join/Login
Business Software
Open Source Software
For Vendors
Blog
About
More
Articles
Create
SourceForge Podcast
Site Documentation
Subscribe to our Newsletter
Support Request
For Vendors
Help
Create
Join
Login
Business Software
Open Source Software
SourceForge Podcast
Resources
Articles
Case Studies
Blog
Menu
Help
Create
Join
Login
Home
Browse
Valgrind for Windows
Wiki
Valgrind for Windows Wiki
Status:
Pre-Alpha
Brought to you by:
cschwarz1
Summary
Reviews
Support
Wiki
Mailing Lists
Code
Tickets
Menu
▾
▴
Wiki Home
Browse Pages
Browse Labels
Formatting Help
DebuggingAndTesting
Authors:
Running/Debugging
Compile all test cases:
make check
Run Valgrind from the
.in-place
directory in a MSys shell
running hello world 32 bit:
VALGRIND_LIB=.in_place coregrind/valgrind.exe memcheck/tests/windows/hello-x86-windows.exe
running hello world 64 bit:
VALGRIND_LIB=.in_place coregrind/valgrind.exe memcheck/tests/windows/hello-amd64-windows.exe
running a memcheck test:
VALGRIND_LIB=.in_place coregrind/valgrind.exe memcheck/tests/badaddrvalue.exe
start Valgrind with
--wait-for-gdb=yes
switch to let the tool wait for a debugger to attach (both gdb or WinDbg can attach this way)
Debugging C code:
compile code with
make OPTIMIZE=-O0
attach with gdb
Debugging Assembly code:
hardcode
asm("int $3");
breakpoint(s) where desired
attach with WinDbg
control passes to WinDbg as soon as one of the hardcoded breakpoints is hit
Tools
tests/windows
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
to build all tests, run
make check
memcheck/tests/windows
is the place for Windows-specific memcheck tests, compiling as 32 and 64 bit (or both) versions
current tests:
hello
- console hello world
hellowin
- GUI hello world
threadtest
- simple test if Valgrind can manage threads
Other tool tests (note that many but not all tests compile under Windows):
cachegrind/tests/*.exe
(3 tests)
callgrind/tests/*.exe
(2 tests)
exp-bbv/tests/x86/*.exe
(4 tests)
exp-sgcheck/tests/*.exe
(6 tests)
massif/tests/*.exe
(19 tests)
memcheck/tests/*.exe
(90 tests)
memcheck/tests/amd64/*.exe
(6 tests)
memcheck/tests/x86/*.exe
(8 tests)
none/tests/*.exe
(27 tests)
none/tests/amd64/*.exe
(25 tests)
none/tests/x86/*.exe
(19 tests)
perf/*.exe
(8 tests)
Name
Related
Wiki: Home
×