Re: problem when debug glib source code with gdb



On 24 November 2015 at 10:48, 落痕 <losemyheaven qq com> wrote:
I really appreciate your help. I succeed!

Great!

I saw that you set CFLAG=-g, but u did not export it.

You don't need to export it if you set the variable on the same line
as the command. So this:

$ JOHN=1 somecommand ...

is the same as:

$ export JOHN=1
$ somecommand ...
$ unset JOHN

Confusingly, configure also has a feature where you can set
environment variables as arguments, for example:

$ ./configure CFLAGS=-g

Now since configure knows about the CFLAGS setting it can preserve it
across autoreconf. But some versions of configure don't handle this
correctly, so in my experience it's safer to just set CFLAGS in the
environment.

I guess that settig --enable-debug option yes has helped us add -g to CFLAG.
Am I right?

I don't think --enable-debug does much. It might enable g_assert()
tests inside glib, perhaps? You would need to read glib's configure.ac
to find out.

For -g, you just need to set CFLAGS before configure.

John


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]