[Xapian-discuss] how to debug xapian?

jiangwen jiang jiangwen127 at gmail.com
Thu Nov 5 05:30:14 GMT 2009


Hi, Olly:
      It works by settind export LD_LIBRARY_PATH=/usr/local/lib

      Thanks for your help.

regards
  Wen

2009/11/5 Olly Betts <olly at survex.com>

> On Wed, Nov 04, 2009 at 06:24:53PM +0800, jiangwen jiang wrote:
> >      using this g++ command: g++ -g quickstartindex.cc `xapian-config
> --libs
> > --cxxflags` -o quickstartindex
> >
> >      The problem is: I want to use gdb to step into xapian functions, to
> see
> > function invocation in this example code.
> >      for example, I set a breakpoint on line 25, and I want to use gdb
> step
> > command to step into newdocument.set_data(), but it doesn't step into
> this
> > function, just goto line 27.
>
> That's what would happen if there was no debug information for libxapian,
> but
> by default xapian-core is built with -g so there should be.
>
> Perhaps you also have libxapian installed as a package and that is being
> used
> instead.  Some distros strip debug symbols by default.
>
> What does this report:
>
> $ ldd quickstartindex|grep xapian
>
> You didn't specify a prefix, so the libxapian you just built will have been
> installed in /usr/local/lib, but the dynamic linker may be using a packaged
> one
> in /usr/lib instead.
>
> If that is the case, you can override by setting LD_LIBRARY_PATH before
> running
> gdb - assuming bash is your shell:
>
> export LD_LIBRARY_PATH=/usr/local/lib
>
> If that isn't the cause, I don't know what's going on.  Debugging with gdb
> works fine for me.
>
> >      Or Should I use log file to debug this code, and see the function
> > invocation in xapian.
>
> Depends what you're trying to debug.
>
> Cheers,
>     Olly
>


More information about the Xapian-discuss mailing list