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: Sat, 12 Aug 2017 12:53:24 +0300 Message-ID: References: <87556904-541c-6ef5-5a2b-9b7199ffb603@cs.ucla.edu> <7b152bb1-5768-633c-8b7a-172cc6227a26@cs.ucla.edu> <83valuqvmw.fsf@gnu.org> <83poc2qjc3.fsf@gnu.org> <83o9rmqh0j.fsf@gnu.org> <83lgmqqe83.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c0d106af53add05568b6801" X-Trace: blaine.gmane.org 1502531707 5468 195.159.176.226 (12 Aug 2017 09:55:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 12 Aug 2017 09:55:07 +0000 (UTC) Cc: Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 12 11:55:03 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 1dgT8C-0000ra-Oi for ged-emacs-devel@m.gmane.org; Sat, 12 Aug 2017 11:54:56 +0200 Original-Received: from localhost ([::1]:40382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgT8J-0006aj-37 for ged-emacs-devel@m.gmane.org; Sat, 12 Aug 2017 05:55:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgT7T-0006To-Hg for emacs-devel@gnu.org; Sat, 12 Aug 2017 05:54:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgT7S-00054H-67 for emacs-devel@gnu.org; Sat, 12 Aug 2017 05:54:11 -0400 Original-Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]:37974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dgT7Q-00051O-3f; Sat, 12 Aug 2017 05:54:08 -0400 Original-Received: by mail-wr0-x235.google.com with SMTP id 26so4749520wrt.5; Sat, 12 Aug 2017 02:54:06 -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=bXaez1rYK11IQz7qH2qwa9ekaRaRP5hehS5D1DjrQ+0=; b=Ds6JO+Oo9K+zxxGoxLU4VhlzIBmNO+kx+zF+82iKg3IAAIz3OcYJEE9gg5XwbeTrph I0ZiGvAnOjmh+IEyihoR2EYlayuQD69BFlp5DQVjBvAWX8Ssoqz3Mu7hft91jac/Z6ZQ sEOagR4n7J/Ji2LmGIXlujwSoHUXp+XE/rDRwTaKvBpFDmQ08rpS7jKMZ/aXOjop44c6 tqzstIfcf9T/8fc5CB1KjVnUV4w2zDYGdqn8/KSbhkTPk40leLa0LEwfCoP7hBw01+Hk 700GMxnk67wVHgHmjxUcBIftGsIZTW9JPw4zB3s8hBjEBu+Zm6S8som4f0WZZ4K+aSeV pYKw== 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=bXaez1rYK11IQz7qH2qwa9ekaRaRP5hehS5D1DjrQ+0=; b=Sjk3yqplZBVs1e4fsoXgcEZDso75cPJbfCoPI5otmOOi0tiNN9wNljNSdAU9L9r9s0 bZMlUfwzNmgYMSDMH5ygI8mirCB/LYUx+1eaToSVDTWVH1FvpdGz1CCRoL5Gvs/BeVCI +9IiwNbwx8KTkKANt3RmE6g4f1awDLNy0s4CeUUTZyCwYsrfIAldR6WrWk/zPB6b1XFr 4kj7IgPWWfPWzu4/n1iO5QHOE2zHWfM2Bs9ofsk8gSsi2643A0ksEBkd9794kIGNu2PG qECJKpXNON5EzkFReMELehUe5KIodO7VoGcFCUTYHql99/C1uhB3j44TrvYf2kBJUu5o 1FfQ== X-Gm-Message-State: AHYfb5j99/GyCECUDHulVvfEDsk7JqHnHmGWsFT7fIm+e5p8h+a7jJkr uRx9UOjtqndkKzJHCczMpF+/sHRAE6hm X-Received: by 10.223.131.99 with SMTP id 90mr11701690wrd.155.1502531644896; Sat, 12 Aug 2017 02:54:04 -0700 (PDT) Original-Received: by 10.28.197.196 with HTTP; Sat, 12 Aug 2017 02:53:24 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::235 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:217465 Archived-At: --94eb2c0d106af53add05568b6801 Content-Type: text/plain; charset="UTF-8" If I make a change to the code, for experimentation purposes, how do I compile it so I can see my change in action and debug it? Should I run ./autogen.sh ./autogen.sh git CFLAGS='-O0 -g3' ./configure make make install or can I simply compile the file that I changed with the compiler (GCC or Clang)? On Fri, Aug 11, 2017 at 8:32 PM, Itai Berli wrote: > Thank you, Eli. > > On Fri, Aug 11, 2017 at 7:08 PM, Eli Zaretskii wrote: > >> > From: Itai Berli >> > Date: Fri, 11 Aug 2017 18:34:08 +0300 >> > Cc: Emacs developers >> > >> > > Tell me what you want to do and with what text, and then I might be >> able to help you do >> > that in a more useful way. >> > >> > I just want to get more familiar with the bidi algorithm and the way it >> is implemented by Emacs. I'd like to try >> > various small phrases, such as the ones that can be found in this >> article: >> > https://www.w3.org/International/articles/inline-bidi-markup/uba-basics >> >> After entering GDB, set a breakpoint in a function called >> Fredraw_display, then run Emacs ("run -Q"). Insert the text you want, >> then move point to its beginning and type "C-x =". Remember the >> buffer position displayed as result, let's call it POS. >> >> Then type "M-x redraw-display RET". GDB will get control, and you can >> now put breakpoints where you want. For tracing through the bidi.c >> code, I'd suggest this: >> >> (gdb) break bidi_get_next_char_visually if bidi_it->charpos == POS >> (gdb) continue >> >> When the breakpoint in bidi_get_next_char_visually breaks, you can >> step through the code using the "step" and "next" commands (you have >> tool-bar buttons for them). >> >> Note that bidi_get_next_char_visually is called for each character the >> display engine wants to display, so when it returns, it puts in >> bidi_it->charpos the position of the next character in visual order. >> > > --94eb2c0d106af53add05568b6801 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If I make a change to the code, for experimentation purpos= es, how do I compile it so I can see my change in action and debug it? Shou= ld I run

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

or can I simply compile the file th= at I changed with the compiler (GCC or Clang)?

On Fri, Aug 11, 2017 at 8:32 PM, Itai Be= rli <itai.berli@gmail.com> wrote:
Thank you, Eli.

On Fri, Aug 11, 2017 at 7:08 PM, Eli= Zaretskii <eliz@gnu.org> wrote:
itai.berli@gmail.com>
> Date: Fri, 11 Aug 2017 18:34:08 +0300
> Cc: Emacs developers <emacs-devel@gnu.org>
>
> > Tell me what you want to do and with what text, and then I = might be able to help you do
> that in a more useful way.
>
> I just want to get more familiar with the bidi algorithm and the way i= t is implemented by Emacs. I'd like to try
> various small phrases, such as the ones that can be found in this arti= cle:
> https://www.w3.org/Inter= national/articles/inline-bidi-markup/uba-basics

After entering GDB, set a breakpoint in a function called
Fredraw_display, then run Emacs ("run -Q").=C2=A0 Insert the text= you want,
then move point to its beginning and type "C-x =3D".=C2=A0 Rememb= er the
buffer position displayed as result, let's call it POS.

Then type "M-x redraw-display RET".=C2=A0 GDB will get control, a= nd you can
now put breakpoints where you want.=C2=A0 For tracing through the bidi.c code, I'd suggest this:

=C2=A0 (gdb) break bidi_get_next_char_visually if bidi_it->charpos =3D= =3D POS
=C2=A0 (gdb) continue

When the breakpoint in bidi_get_next_char_visually breaks, you can
step through the code using the "step" and "next" comma= nds (you have
tool-bar buttons for them).

Note that bidi_get_next_char_visually is called for each character the
display engine wants to display, so when it returns, it puts in
bidi_it->charpos the position of the next character in visual order.


--94eb2c0d106af53add05568b6801--