1974 shaares
6 private links
6 private links
valgrind can run a gdb server so that a gdb can interact with it. valgrind has 2 options to trigger that:
--vgdb=yes,
--vgdb-error=0.
This second option tells valgrind it needs to wait for that many errors before freezing and wait for a gdb to connect. Setting it to 0 will make valgrind to wait for gdb to connect before executing the program.
valgrind --vgdb=yes --vgdb-error=0 ./foo
gdb ./foo
(gdb) target remote | vgdb