Valgrind
Making it work with OO.o
Some tools such as cachegrind require a patch to fix some stack layout problems: from Naren:
--- configure.in.orig 2005-06-07 14:21:44.142756416 -0700 +++ configure.in 2005-06-07 14:27:01.717477720 -0700 @@ -77,7 +77,7 @@ i?86) AC_MSG_RESULT([ok (${host_cpu})]) VG_ARCH="x86" - KICKSTART_BASE="0xb0000000" + KICKSTART_BASE="0x30000000" ARCH_CORE_AM_CFLAGS="@PREFERRED_STACK_BOUNDARY@ -DELFSZ=32" ARCH_TOOL_AM_CFLAGS="@PREFERRED_STACK_BOUNDARY@" ARCH_CORE_AM_CCASFLAGS=""
Clearly it is necessary to run autoconf after applying that.
It may also be necessary to silence an assertion, according to Thorsten's blog entry:
--- main.c~ 2005-10-04 01:28:01.000000000 +0200 +++ main.c 2005-11-24 13:46:13.000000000 +0100 @@ -274,7 +274,7 @@ if (bb_seen_before) { CLG_ASSERT(ii->instr_offset == instr_offset); CLG_ASSERT(ii->instr_size == instrLen); - CLG_ASSERT(ii->data_size == dataSize); + //CLG_ASSERT(ii->data_size == dataSize); CLG_ASSERT(ii->cost_offset == *cost_offset); CLG_ASSERT(ii->eventset == es); }
disabling the custom allocator
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into linkoo's ooenv script).
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:
#!/bin/sh # instrument soffice with a malloc-based memory allocator. # Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH. # Forwards all command line arguments to valgrind. export LD_PRELOAD=libsalalloc_malloc.so valgrind $@
which preloads a small interceptor lib, which redirects all allocator calls to malloc.
Callgrind How-To
There's a Callgrind How-To at the OOo website.
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw
TODO: same as above.