From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Help getting started debugging Emacs on macOS Sierra Date: Fri, 11 Aug 2017 09:28:32 +0300 Message-ID: <837eyasjn3.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1502432941 17191 195.159.176.226 (11 Aug 2017 06:29:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 11 Aug 2017 06:29:01 +0000 (UTC) Cc: emacs-devel@gnu.org To: Itai Berli Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 11 08:28:56 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 1dg3RD-0003dM-Bs for ged-emacs-devel@m.gmane.org; Fri, 11 Aug 2017 08:28:51 +0200 Original-Received: from localhost ([::1]:42106 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dg3RG-0002RD-EG for ged-emacs-devel@m.gmane.org; Fri, 11 Aug 2017 02:28:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dg3R9-0002QS-2W for emacs-devel@gnu.org; Fri, 11 Aug 2017 02:28:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dg3R5-0002R1-Tr for emacs-devel@gnu.org; Fri, 11 Aug 2017 02:28:47 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dg3R5-0002Qv-QB; Fri, 11 Aug 2017 02:28:43 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4123 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dg3R5-0007qr-1F; Fri, 11 Aug 2017 02:28:43 -0400 In-reply-to: (message from Itai Berli on Fri, 11 Aug 2017 02:25:17 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:217413 Archived-At: > 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