Debugging

From AbiWiki

Jump to: navigation, search

Debugging AbiWord. Here is some tips.

Contents

Linux

Running in a debugger

Since 2.7.x, AbiWord by default build with libabiword shared. Therefore it produce a small abiword executable and a large libabiword.so. Since we use libtool the result is that abiword is a libtool wrapper, that you can not directly start in gdb.

To start AbiWord without installing the binary:

libtool --mode=execute gdb --args ./src/abiword

Note: the plugins need to be installed. You must have run make install as well at one point for the data files (GtkBuilder, etc). It is just tedious to always have to install the binary.

Valgrind and plugins

One of the problem with plugins is that they are unloaded when the program exit. So if valgrind found something in there, you lose the stack trace.

Just export:

G_DEBUG=resident-modules

Gdb and optimization

With inlining, sometime it is uneasy to locate the code. One way it is to build AbiWord with less optimisations.

make CXXFLAGS=-g\ -O0 

This will compile with much less inlining. The code will no be performing as fast but it will be far easier to debug.

MacOS X

The best way to debug AbiWord on MacOS X is to use the XCode project and debug from there, with all the limitation on what the system builds.

Otherwise make sure you have build the bundle properly and you can use the command line gdb. See the building instruction for Mac.

Valgrind

Valgrind now exist on Mac Intel. If you have it, try it and document it here.

Personal tools