On Tue, 2010-11-30 at 11:48 +1100, Mattias Johnsson wrote: > On 30 November 2010 11:34, Joe Smith <j...@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 <kyosh...@novell.com> _______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice