[Top][All Lists]

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

Re: How to build Emacs with debugging information?

From: Alan Mackenzie
Subject: Re: How to build Emacs with debugging information?
Date: Sat, 24 Jan 2015 17:10:29 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hello, Oleh.

On Sat, Jan 24, 2015 at 04:43:57PM +0100, Oleh wrote:
> Hi all,

> Sorry if I'm asking obvious things, I'm not too experienced with C.

> I wanted to step through `scan_lists' from syntax.c to understand why
> and how "<" and ">" are matched in `c++-mode'. For example, they won't
> be matched here, calling `forward-list':

>     #include <vector>

> but will be matched here:

>     vector<int> foo;

What exactly do you want here?  Do you really just want to know the
answer to your question about scanning "<" and ">", or do you
specifically want to find it out yourself with the debugger?  If it's the
first of these, I can tell you.  ;-)

If it's the second of these, ....

> Anyway, stepping with gdb, inside another Emacs instance, I see that
> many values are "<optimized out>", e.g.

>     (gdb) p found
>     $1 = <optimized out>

> Normally I would pass "-g -O0" flags to gcc to solve this for the
> C/C++ programs that I write. How can I do the equivalent thing for
> Emacs?

You'll need to reconfigure and rebuild Emacs.  If you're on a GNU or
other Unix-like system, do something like:

    $ CFLAGS='-g3 -O0' ./configure <other arguments>

, then call make in the usual way.  (If you're on a different OS, such as
Microsoft Windows, then I can't help you here, but somebody else will.)

> Is there a way to have both the "debug" and "release" configurations
> for the Emacs executable?

I'm not sure what you mean by "configurations", but you can have two
Emacs executables side by side.  (Again, on GNU etc.,) when you build
Emacs, the executable is called something like emacs-, where the
4 is incremented each time you build.  The last build is hard linked to
the file emacs.  So you just have the hassle of typing in "-"
when you start the "release" version.

> regards,
> Oleh

Alan Mackenzie (Nuremberg, Germany).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]