Below is a graphical representation of OOo’s module dependencies as of DEV300 milestone 84 generated via graphviz. Click on the image to get the whole picture.
You can find the python script I wrote to generate this nice picture here.
While searching for a debug tool equivalent of strace that runs on Windows, I’ve come across Process Monitor. This appears to work well for me. For anyone in search of strace equivalent on Windows, give this one a try.
I’ve also tried StraceNT, but this one was not very reliable as it tends to crash the traced process almost every time.
An equally useful tool for debugging on Windows is DebugView, which captures output from the OutputDebugString calls.
I’m happy to announce that the mso-dumper tool is now packaged in the openSUSE build service under my home repository. This tool is written in Python, and allows you to dump the contents of MS Office documents stored in the BIFF-structured binary file format in a more human readable fashion. It is an indispensable tool when dealing with importing from and/or exporting to the Office documents. Right now, only Excel and Power Point formats are supported.
This package provides two new commands xls-dump and ppt-dump. If you wish to dump the content of an Excel document, all you have to do is
xls-dump ./path/to/mydoc.xls
and it dumps its content to standard output. What the output looks like depends on what’s stored with the document, but it will look something like this:
... 0085h: ============================================================= 0085h: BOUNDSHEET - Sheet Information (0085h) 0085h: size = 14 0085h: ------------------------------------------------------------- 0085h: B4 09 00 00 00 00 06 00 53 68 65 65 74 31 0085h: ------------------------------------------------------------- 0085h: BOF position in this stream: 2484 0085h: sheet name: Sheet1 0085h: hidden state: visible 0085h: sheet type: worksheet or dialog sheet 008Ch: ============================================================= 008Ch: COUNTRY - Default Country and WIN.INI Country (008Ch) 008Ch: size = 4 008Ch: ------------------------------------------------------------- 008Ch: 01 00 01 00 00EBh: ============================================================= 00EBh: MSODRAWINGGROUP - Microsoft Office Drawing Group (00EBh) 00EBh: size = 90 00EBh: ------------------------------------------------------------- 00EBh: 0F 00 00 F0 52 00 00 00 00 00 06 F0 18 00 00 00 00EBh: 02 04 00 00 02 00 00 00 02 00 00 00 01 00 00 00 00EBh: 01 00 00 00 02 00 00 00 33 00 0B F0 12 00 00 00 00EBh: BF 00 08 00 08 00 81 01 09 00 00 08 C0 01 40 00 00EBh: 00 08 40 00 1E F1 10 00 00 00 0D 00 00 08 0C 00 00EBh: 00 08 17 00 00 08 F7 00 00 10 00FCh: ============================================================= 00FCh: SST - Shared String Table (00FCh) 00FCh: size = 8 00FCh: ------------------------------------------------------------- 00FCh: 00 00 00 00 00 00 00 00 00FCh: ------------------------------------------------------------- 00FCh: total number of references: 0 00FCh: total number of unique strings: 0 ...
I have originally written this tool to deal with the Excel import and export part of Calc’s development, and continue to develop it further. Thorsten Behrens has later joined forces and added support for the Power Point format. Right now, I’m working on adding an XML output format option to make it easier to compare outputs, which is important for regression testing.
Caolan told me today that when debugging with gdb, you can actually set a break point right before an exception is thrown.
You can do
gdb ./soffice.bin (gdb) catch throw (gdb) run
and gdb breaks at every location where an exception is raised. Or, you can set a normal break point, run catch throw and cont, and gdb will break at the next exception throw event. This technique helps when an exception gets caught somewhere at higher level in the call stack and you are trying to find out where exactly it is thrown. Such task, without this technique, would be very time-consuming, tedious, boring, and at times frustrating especially when you’ve spent hours and still don’t have the location of the thrown exception.
Similarly, you can also break where an exception is caught, with catch catch command, or you can catch a whole set of other events with this construct.
The only drawback with this catch event construct is that, it breaks at every single exception raised or caught, which, inside OOo’s codebase can be quite substantial in some places. Nonetheless, this is a very useful technique to add to your debugging arsenal.
I just had the chance to play with Caolan’s cool callcatcher program to search and destroy (or comment out rather) lots of unused methods in Calc’s code. It was surprisingly simple to install and use it. All I had to do after downloading the source package was to
tar xvf callcatcher-1.0.8.tar.gz cd callcatcher-1.0.8 sudo ./setup.py install
then replace all gcc and g++ calls with callcatcher gcc and callcatcher g++, respectively, to catch all defined functions and their references (or lack thereof). That’s all. Once done, run callanalyse [executable or shared library] to generate the summary output of all unused methods. It was pretty accurate, and as he claims there was no false positives as far as I could tell.