From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Debugging Emacs Date: Mon, 07 Dec 2015 18:34:08 +0200 Message-ID: <837fkqdxq7.fsf@gnu.org> References: <87r3jbicg0.fsf@russet.org.uk> <83wpt3qq7b.fsf@gnu.org> <87lh9jp073.fsf@russet.org.uk> <83h9k6r1z8.fsf@gnu.org> <878u5hlxqd.fsf@russet.org.uk> <8337vpq2po.fsf@gnu.org> <87zixxkdth.fsf@russet.org.uk> <87si3na9yr.fsf@ulb.ac.be> <83h9jxf9l2.fsf@gnu.org> <87oae27fix.fsf@russet.org.uk> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1449506071 16036 80.91.229.3 (7 Dec 2015 16:34:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Dec 2015 16:34:31 +0000 (UTC) Cc: nrichard@ulb.ac.be, emacs-devel@gnu.org To: phillip.lord@russet.org.uk (Phillip Lord) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 07 17:34:24 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a5yk3-0006y6-II for ged-emacs-devel@m.gmane.org; Mon, 07 Dec 2015 17:34:23 +0100 Original-Received: from localhost ([::1]:55395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5yk2-0001Py-Rr for ged-emacs-devel@m.gmane.org; Mon, 07 Dec 2015 11:34:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5yjx-0001Mb-Sp for emacs-devel@gnu.org; Mon, 07 Dec 2015 11:34:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5yjv-0005hj-6D for emacs-devel@gnu.org; Mon, 07 Dec 2015 11:34:17 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:45931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5yju-0005hX-OR for emacs-devel@gnu.org; Mon, 07 Dec 2015 11:34:15 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NYZ00800XY97W00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Mon, 07 Dec 2015 18:34:13 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NYZ008G2Y106H20@a-mtaout21.012.net.il>; Mon, 07 Dec 2015 18:34:13 +0200 (IST) In-reply-to: <87oae27fix.fsf@russet.org.uk> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195949 Archived-At: > From: phillip.lord@russet.org.uk (Phillip Lord) > Cc: Nicolas Richard , > Date: Mon, 07 Dec 2015 09:51:34 +0000 > > >> FWIW I use "killall -TSTP emacs", at which point gdb kicks in. (IIUC.) > > > > This was in etc/DEBUG, of course. > > Actually, it wasn't! > > etc/DEBUG > > has a section called "Getting Control to the Debugger". The section > BEFORE that mentions > > kill -TSTP PID We are miscommunicating. I didn't mean "kill -TSTP", I meant its equivalent C-z. "kill -TSTP" is only needed when Emacs hangs or infloops while already running under GDB. By contrast, the sub-thread to which I responded talked about ways to get control to GDB in general, where I think C-z is a much more important and much easier technique than "kill -TSTP". Safer, too. (Btw, AFAIK "killall -TSTOP" is better than TSTP, as the former signal cannot be blocked or ignored.) > Getting the PID of emacs is somewhat painful because I normally run two. > And three when debugging. It didn't occur to me that I could safely run > killall -TSTP emacs without trashing my other Emacs' > > Again, this all sounds small, but getting to the debug "Hello World" > needs to be as simple as possible. And it's exactly for these very reasons that I think C-z is more important than "kill". I think it's reasonable to assume that newbies to debugging Emacs won't necessarily need to start with a hung Emacs that already runs under GDB, so this corner case can be left in its corner section. I wouldn't recommend newbies to use "killall" anyway. > It's good. Slightly more detail that I would have added (less is more in > a brief tutorial). Thanks. Where to stop is a judgment call: too short descriptions risk to leave the perplexed in their confused state. > I would put back my short "run through". It makes the section longer ;-) Seriously, though: the few steps you described there are quite possibly not what the user will need to do, so I think it would get in the way. And I'm not sure why it's important to mention "ppt", but not a gazillion of other useful functions in .gdbinit. > Also, the section on "pp" needs to mention that this prints to > standard out (this is true right?). Good point, I added that. (No, it writes to stderr, but on GNU/Linux you can redirect it to a file.) > Probably, etc/DEBUG needs to be replaced with a section in the elisp > manual. Somebody already mentioned that. I don't think I agree: when you debug, you need the instructions be available on the simplest medium possible, so a plain text file is better than Info. What's more important, a single file with a distinct name is easier found than a section in a large manual. > Which probably needs to be renamed (Programming Emacs Manual?) > -- I noticed the section on modules going in the other day which isn't > very lispy! We have a section on writing Emacs primitives, had it for a long time. In fact, the entire Appendix E there is full of non-Lispy stuff. So that ship sailed quite some time ago. I won't argue about the name; it's for the FSF to consider anyway, since they are selling it as a book. The C parts of the dynamic modules documentation will probably relocate to the same appendix; what's now is just a preliminary version (as the commit log message indicates), to let people who track the development have something at their disposal. Thanks.