[Top][All Lists]

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

Re: How to run emacs under a debugger on macOS?

From: Alan Third
Subject: Re: How to run emacs under a debugger on macOS?
Date: Sat, 11 Jan 2020 13:48:35 +0000

On Sat, Jan 11, 2020 at 11:32:15AM +0000, Pankaj Jangid wrote:
> I haven't done any C/C++ programming on macOS. I am just a user who
> connects to remote machines for development. Those who have done it on
> macos, please help.
> On GNU/Linux, launching a debug build under a debugger is simple "gdb
> <binary>". How does Emacs dev community do so on macos? Also tell me how
> to make a debug build on macos. Usually I just
> make install
> test the binary (./src/emacs -Q)
> rm -rf /Applications/Emacs.app
> cp -r nextstep/Emacs.app /Applications/Emacs.app
> In short,
> 1. How to make debug build?
> 2. How to launch emacs under a debugger on macos?
> 3. Any other instructions relevant for debugging.

I usually do something like:

    ./configure CFLAGS="-g -O0"
    make install
    lldb nextstep/Emacs.app/Contents/MacOS/Emacs

and in lldb

    run -Q

lldb’s not ideal, though, as it doesn’t support the commands in
src/.gdbinit that make working with lisp structures easier.

It’s possible to use gdb on macOS, but you need to at a minimum sign
it, and upgrades will undo that so you have to do it again. I don’t
usually bother with gdb.

Alan Third

reply via email to

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