From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Itai Berli Newsgroups: gmane.emacs.devel Subject: Re: Help getting started debugging Emacs on macOS Sierra Date: Fri, 11 Aug 2017 11:27:25 +0300 Message-ID: References: <837eyasjn3.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1141977a98af720556761774" X-Trace: blaine.gmane.org 1502440127 21695 195.159.176.226 (11 Aug 2017 08:28:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 11 Aug 2017 08:28:47 +0000 (UTC) Cc: Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 11 10:28:40 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dg5J8-000509-IT for ged-emacs-devel@m.gmane.org; Fri, 11 Aug 2017 10:28:38 +0200 Original-Received: from localhost ([::1]:48103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dg5JD-0006dW-0T for ged-emacs-devel@m.gmane.org; Fri, 11 Aug 2017 04:28:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dg5Ih-0006O8-Eo for emacs-devel@gnu.org; Fri, 11 Aug 2017 04:28:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dg5If-0007HB-O0 for emacs-devel@gnu.org; Fri, 11 Aug 2017 04:28:11 -0400 Original-Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:37527) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dg5Id-0007F2-AD; Fri, 11 Aug 2017 04:28:07 -0400 Original-Received: by mail-wm0-x22a.google.com with SMTP id i66so41435234wmg.0; Fri, 11 Aug 2017 01:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eQYDWa9uHfpSQe8kT37gbx6KpA82aCj5ersogTgShjI=; b=JsaDkIDW+Qoq05zVNbipUJrKWmtlQn562AH4Qq/6TL7SQmh6eRIXwG5d9gTgf3tD/8 ihMGJi/oMwp9PTYDRpCgAR7rOC9Ncw7LSmnPNUoLuQWk0vUOKhyiWvXE17D1zBLy7LMP 2astzKBpl90eCloHSuIUdeE5/jLrbm3TzN1A3YI+V7NKnJqAybNPKlvUtreXiUb/CBqT aesMxGOH1BwxpWTFzTChGqzXl96Z/wKH43H6p0rARnCAKbq5+f/07hdScmuzm19VXQjE mM/IijsXVuUNGxLEy/VWqGOT2WkkFW4fB6G1JHdmFXhdKGkPIFzQs57Ld7L8RzsayC72 YfJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eQYDWa9uHfpSQe8kT37gbx6KpA82aCj5ersogTgShjI=; b=JVkdTZNjb5hHlgLxm0/RWCOZF2ZRyGT8cAzTKtEP4jIdR6RiwVAFjxyu66XYhTneMa N5hNsxF6tFyTaJBEJ/ii1SpFKdbUjg2Tt4yKBK9TiiJs15QeKsXP/IaBAM9UZDkwX/uT awXR9J0LxQ6on99AVF/1sc3em5Njd1YEnEHqcPkr8cyrhQ67Mr0VhEZwvGKzQKzRRQOo f2PdTxdeaBeBIi/kgtLId44JjKSSvhZbcO3rO3aWUweOzk3rqubaqhH1nRT4UeMpCcnP +FCSp8HmJaO4bjdRHyhunbpyVxEcGxA4f3TC4/SQvhoOg8NfZrTFWTtN8R60MSa35KHv YnDQ== X-Gm-Message-State: AHYfb5gTrSH0kqrtuDQzQY+DRsqo1QeWQHa6JS55vJFHk0+fERQX58Pr 3kffYg9s01h9G2yAnQnmoPgclFV9ZRNDEs0= X-Received: by 10.28.126.200 with SMTP id z191mr8656577wmc.46.1502440085563; Fri, 11 Aug 2017 01:28:05 -0700 (PDT) Original-Received: by 10.28.197.196 with HTTP; Fri, 11 Aug 2017 01:27:25 -0700 (PDT) In-Reply-To: <837eyasjn3.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:217415 Archived-At: --001a1141977a98af720556761774 Content-Type: text/plain; charset="UTF-8" Eli wrote: > I suggest to rebuild Emacs without optimizations and with better debugging info: > > CFLAGS='-O0 -g3' ./configure > make > make install Thank you, Eli. Do I also need to run './autogen.sh' and './autogen.sh git' again? On Fri, Aug 11, 2017 at 9:28 AM, Eli Zaretskii wrote: > > From: Itai Berli > > Date: Fri, 11 Aug 2017 02:25:17 +0300 > > > > I'm interesting in exploring the Emacs bidi feature, which is coded in > the files bidi.c and xdisp.c. > > > > To get my feet wet, I'd like to set a breakpoint in the beginning of one > of the functions in one of these files, I > > don't care which one, and step through the function in a debugger. > > > > Not only am I new to Emacs development, I'm also new to developing C > programs. Ideally, I'd like to do this in > > the Eclipse IDE for C/C++ Developers (Oxygen Release 4.7.0). However, > I'm also willing to try another > > debugger, such as a command-line one, if it's easier to get started. > > > > My operating system is macOS Sierra Version 10.12.6 (the latest > version). My LLVM version is 8.1.0 > > (clang-802.0.42). > > > > I'll appreciate it if someone can walk me through the steps needed to > get up and running. > > I don't use macOS, and so cannot tell you how to use lldb to debug > Emacs. Some advice is in etc/DEBUG, but its most useful parts are > heavily skewed towards GDB. So if possible, I suggest to install GDB > for macOS, I'm sure some version of it is available. That would allow > more people here to help you with specific commands and features of > the debugger. Debugging support in src/.gdbinit is also GDB-specific, > and I don't know how well does lldb emulate GDB for the commands > defined on .gdbinit to work in lldb. > > > I have downloaded Emacs from git by running > > > > > git clone git://git.savannah.gnu.org/emacs.git > > > > I then compiled and installed it by running the following sequence of > scripts. > > > > > ./autogen.sh > > > ./autogen.sh git > > > ./configure > > > make > > > make install > > The default build uses optimization switches, which make debugging > harder. So I suggest to rebuild Emacs without optimizations and with > better debugging info: > > CFLAGS='-O0 -g3' ./configure > make > make install > --001a1141977a98af720556761774 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Eli wrote:

>=C2=A0I suggest to rebuild Emacs without optimizations = and with=C2=A0better debugging info= :
>
> =C2=A0CFLAGS=3D'-O0 -g3' ./configure
> make
> make install<= /span>

Thank you, Eli. Do I also need to run './autogen.s= h' and './autogen.sh git' again?

=
On Fri, Aug 11, 2017 at 9:28 AM, Eli Zaretskii <= span dir=3D"ltr"><eliz= @gnu.org> wrote:
> From: Itai Berli <itai.berli@gmail.com>
> Date: Fri, 11 Aug 2017 02:25:17 +0300
>
> I'm interesting in exploring the Emacs bidi feature, which is code= d in the files bidi.c and xdisp.c.
>
> To get my feet wet, I'd like to set a breakpoint in the beginning = of one of the functions in one of these files, I
> don't care which one, and step through the function in a debugger.=
>
> Not only am I new to Emacs development, I'm also new to developing= C programs. Ideally, I'd like to do this in
> the Eclipse IDE for C/C++ Developers (Oxygen Release 4.7.0). However, = I'm also willing to try another
> debugger, such as a command-line one, if it's easier to get starte= d.
>
> My operating system is macOS Sierra Version 10.12.6 (the latest versio= n). My LLVM version is 8.1.0
> (clang-802.0.42).
>
> I'll appreciate it if someone can walk me through the steps needed= to get up and running.

I don't use macOS, and so cannot tell you how to use lldb to deb= ug
Emacs.=C2=A0 Some advice is in etc/DEBUG, but its most useful parts are
heavily skewed towards GDB.=C2=A0 So if possible, I suggest to install GDB<= br> for macOS, I'm sure some version of it is available.=C2=A0 That would a= llow
more people here to help you with specific commands and features of
the debugger.=C2=A0 Debugging support in src/.gdbinit is also GDB-specific,=
and I don't know how well does lldb emulate GDB for the commands
defined on .gdbinit to work in lldb.

> I have downloaded Emacs from git by running
>
> > git clone git://git.savannah.gnu.org/emacs.git
>
> I then compiled and installed it by running the following sequence of = scripts.
>
> > ./autogen.sh
> > ./autogen.sh git
> > ./configure
> > make
> > make install

The default build uses optimization switches, which make debugging harder.=C2=A0 So I suggest to rebuild Emacs without optimizations and with<= br> better debugging info:

=C2=A0 CFLAGS=3D'-O0 -g3' ./configure
=C2=A0 make
=C2=A0 make install

--001a1141977a98af720556761774--