Education Project/Effort/Math baseline alignment/Debuging starmath

From Apache OpenOffice Wiki
< Education Project‎ | Effort‎ | Math baseline alignment
Revision as of 15:06, 17 February 2008 by Ericb (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Current Build is m245

install it wherever ( Desktop is a good option on Mac OS X)


Debug :

all libmath are stripped by default, and you'll have to add the symbols for debugging. Thus you'll have to rebuild starmath, ans symlink with the new math libs.

Process:

1) Build adding rectangles (for baselines and co )

-> uncomment line 93 in node.cxx : all formulas will be drawn with colored lines giving all alignment information ( Top Bottom Baseline when existing ..etc ) -> See screenshot

2) Build starmath again using :

cd starmath

mv unxmacxi.pro unxmacxi.pro_backup /* adapt to your architecture / OS */ build, debug="something_but_not_empty"


3) Link the new libs ( or use linkoo ) from inside the bundle :

3.1) cd ~/Desktop/test_print/OpenOffice.org 2.4.app/Contents/MacOS

3.2 remove the striped libs :

rm -f libsm680mxi.dylib libsmd680mxi.dylib

3.3 create symlinks for the non strippied one :

ln -s ~/Desktop/SRC680_m245/starmath/unxmacxi.pro/lib/libsm680mxi.dylib . ln -s ~/Desktop/SRC680_m245/starmath/unxmacxi.pro/lib/libsmd680mxi.dylib .

!! don't forget the points !!


4) run gdb (from the previous location, inside the bundle) :

gdb --args soffice.bin - ( the " - " will open a new empty Writer document )


Interesting breakpoints :

First try:

type an equation containing a^2 + b^2 , exit formula ( ESC twice ) then enter the word "text"

then create a new equation containing  %tau a^2 + b^2 and notice the difference.


First breakpoint: parse.cxx:398

When entering whatever letter, you hit a breakpoint. Just trace after it, and compare the two equations (e.g.)

Entering  %tau a^2 + b^2 , you'll see the line starmath/source/parse.cxx:770


  • FIXME* : verify what makes ( if (aTmpRes.TokenType & KParseType::IDENTNAME)) true
Personal tools