Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


On Tue, 2010-11-30 at 11:48 +1100, Mattias Johnsson wrote:
On 30 November 2010 11:34, Joe Smith <jes@martnet.com> wrote:
I was also having a lot of trouble learning anything from running OOo under
gdb. Gdb was acting weird and I couldn't step through the code and poke
around. I ended up trying to do it by adding a printf, rebuild, run, rinse,
repeat. No fun; less progress.

Did you turn off compiler optimisations? I had the same problem (gdb
hopping around in a non-intuitive way, and the values of some useful
variables were optimised out) until I turned them off.

Yup, this is a good advice.  Also, gdb at one point had issues with
setting break points in class constructors.  I don't know if this has
been resolved yet in the more recent releases, but something to keep in
mind in case you still use a version of gdb with this issue unresolvedd.
gdb also tends to quit when you try to step through parts of code where
no debug symbols are available.  This may happen when you've rebuilt
module only partially with debug symbols, and/or step into code of other
modules that have not been re-built with debug symbols.

If that's the problem, you can do it by configuring with
--enable-debug, or if you're just building a single module you can do
"build -- debug=t dbglevel=2"

"build debug=t" alone should turn off compiler optimization, before the
'--' not after.  I wouldn't recommend dbglevel=2 unless you know what
you are getting with dbglevel=2.

I think "dbglevel=1" also turns them off, and will give less noise,
but I haven't checked.

It's the debug=t part that turns off compiler optimization.  dbglevel=#
controls the amount of debug messages that other devs have put in (if I
understand David's mail correctly, that is).

Kohei

-- 
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida@novell.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.