[Libreoffice] Need help to debug with Visual C++ 2008

Tor Lillqvist tlillqvist at novell.com
Sun Feb 6 23:24:46 PST 2011


>    2. start Visual Studio and open exe  with File > Open > Project/Solution
>    and choose soffice.exe in program folder.

It is not soffice.exe that is the actual LibreOffice program, it's soffice.bin. (Which despite its odd .bin suffix is a totally normal .exe file.) Soffice.exe is just a thin wrapper that sets up PATH and then starts soffice.bin.

Yes, this can be quite confusing, and especially confusing is that in the LO build directory, when actually built, these programs are not called soffice.exe and soffice.bin, but, if I recall correctly, what gets installed as soffice.exe is called officeloader.exe and what gets installed as soffice.bin is called soffice.exe. (And additionally, there is even a another copy of that soffice.exe (i.e. the eventual soffice.bin) called soffice_oo.exe. I am not kidding, one could not make this stuff up. Of course, this is not our bright idea, but legacy from OpenOffice.org. We should change it at some point to be less confusing.

And anyway, typically you shouldn't be starting soffice.bin from the debugger as then the environment setup that the wrapper soffice.exe does are not done and it will not find its DLLs. You should just start it normally from Explorer, just the Start Centre, and then attach it from the debugger, set your breakpoints, and use it so that the breakpoint gets hit.

Note that you don't need to quite Visual Studio between different runs of LibreOffice- You can just detach or terminate the debuggee from VS, rebuild more stuff with debugging if you want, copy the this rebuilt DLLs into place, start it again (normally, from Explorer), attach soffice.bin again. The same breakpoints will be remembered.

>    3. Open a file I want to debug(window.cxx) and set breakpoint at the
>    ImplUpdateGlobalSettings function.

That is correct, yes. And as long as you are debugging the right program, soffice.bin, it will work.

--tml




More information about the LibreOffice mailing list