* How to run emacs under a debugger on macOS?
@ 2020-01-11 11:32 Pankaj Jangid
2020-01-11 13:48 ` Alan Third
0 siblings, 1 reply; 6+ messages in thread
From: Pankaj Jangid @ 2020-01-11 11:32 UTC (permalink / raw)
To: emacs-devel
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.
Regards,
Pankaj
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to run emacs under a debugger on macOS?
2020-01-11 11:32 How to run emacs under a debugger on macOS? Pankaj Jangid
@ 2020-01-11 13:48 ` Alan Third
2020-01-11 13:58 ` Yuan Fu
2020-01-11 19:00 ` Pankaj Jangid
0 siblings, 2 replies; 6+ messages in thread
From: Alan Third @ 2020-01-11 13:48 UTC (permalink / raw)
To: Pankaj Jangid; +Cc: emacs-devel
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
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to run emacs under a debugger on macOS?
2020-01-11 13:48 ` Alan Third
@ 2020-01-11 13:58 ` Yuan Fu
2020-01-11 19:00 ` Pankaj Jangid
1 sibling, 0 replies; 6+ messages in thread
From: Yuan Fu @ 2020-01-11 13:58 UTC (permalink / raw)
To: Alan Third; +Cc: Pankaj Jangid, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 284 bytes --]
I haven’t have much luck with gdb. It doesn’t work for me starting from Mojave. A SO question that describes the symptom:
https://stackoverflow.com/questions/54416996/gdb-on-macos-mojave-10-14-2 <https://stackoverflow.com/questions/54416996/gdb-on-macos-mojave-10-14-2>
Yuan
[-- Attachment #2: Type: text/html, Size: 619 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to run emacs under a debugger on macOS?
2020-01-11 13:48 ` Alan Third
2020-01-11 13:58 ` Yuan Fu
@ 2020-01-11 19:00 ` Pankaj Jangid
2020-01-11 19:11 ` Alan Third
1 sibling, 1 reply; 6+ messages in thread
From: Pankaj Jangid @ 2020-01-11 19:00 UTC (permalink / raw)
To: Alan Third; +Cc: emacs-devel
Alan Third <alan@idiocy.org> writes:
> On Sat, Jan 11, 2020 at 11:32:15AM +0000, Pankaj Jangid wrote:
>> 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 make install lldb
> nextstep/Emacs.app/Contents/MacOS/Emacs
Thanks.
BTW I launched directory from the ./src/emacs after building with "-g
-O0".
> 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.
Okay. I'll look into it sometime. :-)
One followup query: Does lldb also create similar dump that the gdb
creates when there is a crash?
Regards
Pankaj
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to run emacs under a debugger on macOS?
2020-01-11 19:00 ` Pankaj Jangid
@ 2020-01-11 19:11 ` Alan Third
2020-01-12 4:24 ` Pankaj Jangid
0 siblings, 1 reply; 6+ messages in thread
From: Alan Third @ 2020-01-11 19:11 UTC (permalink / raw)
To: Pankaj Jangid; +Cc: emacs-devel
On Sat, Jan 11, 2020 at 07:00:26PM +0000, Pankaj Jangid wrote:
> Alan Third <alan@idiocy.org> writes:
>
> > On Sat, Jan 11, 2020 at 11:32:15AM +0000, Pankaj Jangid wrote:
> >> 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 make install lldb
> > nextstep/Emacs.app/Contents/MacOS/Emacs
>
> Thanks.
>
> BTW I launched directory from the ./src/emacs after building with "-g
> -O0".
Yes, that works fine too.
> One followup query: Does lldb also create similar dump that the gdb
> creates when there is a crash?
Yes. Most of the basic commands in gdb work in lldb too, but not all,
so if you’re being given gdb commands and they don’t work I suggest
you check https://lldb.llvm.org/use/map.html.
--
Alan Third
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to run emacs under a debugger on macOS?
2020-01-11 19:11 ` Alan Third
@ 2020-01-12 4:24 ` Pankaj Jangid
0 siblings, 0 replies; 6+ messages in thread
From: Pankaj Jangid @ 2020-01-12 4:24 UTC (permalink / raw)
To: Alan Third; +Cc: emacs-devel
Alan Third <alan@idiocy.org> writes:
>> One followup query: Does lldb also create similar dump that the gdb
>> creates when there is a crash?
>
> Yes. Most of the basic commands in gdb work in lldb too, but not all,
> so if you’re being given gdb commands and they don’t work I suggest
> you check https://lldb.llvm.org/use/map.html.
Thanks. Good resource. And I should have searched for it a little
bit. :-|
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-01-12 4:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-11 11:32 How to run emacs under a debugger on macOS? Pankaj Jangid
2020-01-11 13:48 ` Alan Third
2020-01-11 13:58 ` Yuan Fu
2020-01-11 19:00 ` Pankaj Jangid
2020-01-11 19:11 ` Alan Third
2020-01-12 4:24 ` Pankaj Jangid
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).