Documentation/Building Guide/Building on MacOSX/Creating Debug-Versions of Modules

From Apache OpenOffice Wiki
< Documentation‎ | Building Guide‎ | Building on MacOSX
Revision as of 22:15, 25 April 2007 by Ericb (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 Important: a new section about use XCode for OpenOffice.org debug has been created.
 See:

MacOSX_Debug_OpenOffice.org_using_XCode


Is it possible to build the complete set with symbols included ?

Currently not possible, and not advised.

is it possible to build some modules with symbols ?

Yes, and that's the simplest way to proceed. Some modules, like sal and vcl can be rebuilt using debug.

Example:

To rebuild sal with symbols included, do:

[bash,N] cd sal rm -rf unxmacxp.pro build debug=true

and recopy the libs into the bundle. gdb will display the symbols, and make your life easier.

Note: debug string is tested, and DEBUG is active when debug string is not empty. So debug=t works too.

How change gdb options, and use e.g. -g -ggdb or -gdwarf-2  ?

To rebuild the module, you just have to modify the option in solenv/inc/unxmacx.mk, replacing -g with -ggdb

Known issues

Sometimes a build error, or a runtime error, may be seen in the normal build,  
but the error goes away when --enable-debug is used or if the module is compiled with debug=true. 

The DEBUG build turns off optimisation, so this is a hint that compiler optimisation causes the error.

The error might be due to incorrect code or a compiler fault. Such errors might not be seen on all platforms,

and might not be seen in different compiler versions on one platform.

If the code can not be fixed there is a workaround using NOOPTFILES to build specified files with no optimisation.

Example:

jvmfwk on Mac OS X: build jvmfwk in m183 on Mac OS X Intel leads to Bus Error when javaldx is run.

Solution: use trial and error to rebuild individual files with debug=true. This proves the problem lies with vendorbase.cxx

Have a look in sc/source/core/data/makefile.mk for an example to use NOOPTFILES

To solve our problem: just add: NOOPTFILES= $(SLO)$/vendorbase.obj in the corresponding makefile.

Take care in case some .IF is needed to prevent interference with other platforms.

There's some additional information around debugging on Christians Page User:CL#2006-09-03

Personal tools