From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.devel Subject: Added support for debugging emacs daemon Date: Tue, 12 Feb 2019 10:44:01 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="230965"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 12 16:50:21 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtaKD-000xxq-7L for ged-emacs-devel@m.gmane.org; Tue, 12 Feb 2019 16:50:21 +0100 Original-Received: from localhost ([127.0.0.1]:41501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtaKC-0007ec-90 for ged-emacs-devel@m.gmane.org; Tue, 12 Feb 2019 10:50:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtaJ3-0007Xt-Pp for emacs-devel@gnu.org; Tue, 12 Feb 2019 10:49:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtaE8-0003id-9h for emacs-devel@gnu.org; Tue, 12 Feb 2019 10:44:05 -0500 Original-Received: from veto.sei.cmu.edu ([147.72.252.17]:56112) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtaE7-0003gI-Ut for emacs-devel@gnu.org; Tue, 12 Feb 2019 10:44:04 -0500 Original-Received: from korb.sei.cmu.edu (korb.sei.cmu.edu [10.64.21.30]) by veto.sei.cmu.edu (8.14.7/8.14.7) with ESMTP id x1CFi2H2011104 for ; Tue, 12 Feb 2019 10:44:02 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 veto.sei.cmu.edu x1CFi2H2011104 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cert.org; s=yc2bmwvrj62m; t=1549986242; bh=bx+WvD+T394JphPX42XHPNjh71BJuFv7yuRzrGUXB68=; h=From:To:Subject:Date:From; b=eNtYU0Zu4/2kDS63nsRl0q+KkUIh7YWomUhd3QRWxFm77zuzTRJbJ0GaRlSd6WT2f zA1XM3Y6ryXH1IEcxVS9FAqEgTSUlaBve0C+m9anEq2KjEf9Z66ciJg3IwKYPxH3vq E+VMg7T0Fx0ay4Czdk0fER7EVGZU/cIRZS6F9G1k= Original-Received: from lx-chumsalmon.ad.sei.cmu.edu (lx-chumsalmon.ad.sei.cmu.edu [10.64.51.248]) by korb.sei.cmu.edu (8.14.7/8.14.7) with ESMTP id x1CFi1oa032695 for ; Tue, 12 Feb 2019 10:44:01 -0500 Original-Received: from lx-chumsalmon.ad.sei.cmu.edu (localhost [127.0.0.1]) by lx-chumsalmon.ad.sei.cmu.edu (8.14.7/8.14.7) with ESMTP id x1CFi1SQ022080 for ; Tue, 12 Feb 2019 10:44:01 -0500 Original-Received: (from mwd@localhost) by lx-chumsalmon.ad.sei.cmu.edu (8.14.7/8.14.7) id x1CFi1WU022038; Tue, 12 Feb 2019 10:44:01 -0500 X-Authentication-Warning: lx-chumsalmon.ad.sei.cmu.edu: mwd set sender to mwd@cert.org using -f X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 147.72.252.17 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:233254 Archived-At: I was recently in a position where I wanted to run "emacs --daemon" under gdb. After a few fumbles, I hit upon the following. I suggest either adding this or something like this to .gdbinit or mentioning it in DEBUG: # Follow forks until any possible daemonization is over set follow-fork-mode child tbreak init_signals commands set follow-fork-mode parent end Mind you, init_signals is only used since it is the first emacs function called after daemonization currently. If things were to be moved around, this snippet would have to change. -- Michael Welsh Duggan (mwd@cert.org)