From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: Debugging M-x gdb Date: Fri, 31 Mar 2023 15:58:38 +0200 Message-ID: <875yah10q9.fsf@ledu-giraud.fr> References: <871qlbfkpw.fsf@ledu-giraud.fr> <83ilen9xs2.fsf@gnu.org> <87jzyx5ol8.fsf@ledu-giraud.fr> <83edp52nrp.fsf@gnu.org> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16568"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 31 15:59:37 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1piFI1-00046g-1F for ged-emacs-devel@m.gmane-mx.org; Fri, 31 Mar 2023 15:59:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piFHC-0000vz-Ep; Fri, 31 Mar 2023 09:58:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piFHA-0000vS-Qj for emacs-devel@gnu.org; Fri, 31 Mar 2023 09:58:44 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piFH8-00078O-O8; Fri, 31 Mar 2023 09:58:44 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=+18TwDyA rPrwVkFU48f71ZSRYIGHozYEJcUbSZmE4Iw=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=gma8VqgJ0uQDlCvgtuCncDjctaeuox z8awkwiMdT3wNkrRVItCUMqCmjGlsuP5MDdhxqwpLw+6a9UyTYpEjxBw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=+18TwDyArPrwVkFU 48f71ZSRYIGHozYEJcUbSZmE4Iw=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=YvCTQw2vBYSuAulVW23+SR9NltrMoOsyEVxDh/ DqIE+WYxCwiEgNNNOQL4FX+91eCAH4maS1tRBbgJZvbAOKyRFDWyafSjGKqp+ugHBcQr8F KaVzV11HIxmQv/SdN5KRcGvs2ENm3CLw5P60il2baELYR5abDlTPipurv3kdVOdx7UxMMI m+G2DPdq2ayNObCKc7SnGbyfe+9ZoHWNpwnwY5ja/CVtF4gR/qvXpgvNK1JjqUKngwI73L Tok4gtrm8Na/HJNC8QXDaGk6bgaSSdWaU07/XuWzmCa2QYuapQ+/czdRMXxmQDmf8aj0Tt 6oK8M4sCmLCYwvyJKaN6IAxg== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 2c5ac310 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 31 Mar 2023 15:58:39 +0200 (CEST) In-Reply-To: <83edp52nrp.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 31 Mar 2023 13:55:38 +0300") Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304923 Archived-At: Eli Zaretskii writes: [...] > Doesn't produce any output after attaching GDB to the Emacs process > which consumes CPU? That's not possible. Please show all the > commands you did, starting from invoking Emacs that will later consume > CPU, including commands inside Emacs and outside it. > > Note that the GDB you attach to Emacs should be a new GDB process, not > the one you ran inside Emacs. Disclaimer: I'm using OpenBSD. 'egdb' is the somewhat recent version=C2=A0(9.2) from packages (there is an old bundled gdb but it does n= ot support -i=3Dmi). In the mean time, I've found that this shows with other executables I would try to debug from Emacs: I'm usin xclock here. '~/bin/emacs-debug' is Emacs compiled with the following options: CFLAGS=3D"-O0 -g3" ./configure \ --bindir=3D$HOME/bin --program-suffix=3D-debug \ --enable-checking=3D"yes,glyphs" \ --enable-check-lisp-object-type Here is my recipe: * From a xterm: egdb ~/bin/emacs-debug (gdb) source ~/emacs-repo/src/.gdbinit (gdb) set args -Q (gdb) run * Into this Emacs: M-x gdb Run gdb (like this): egdb -i=3Dmi /usr/X11R6/bin/xclock Enable querying debuginfod servers for this session? (y or n) n M-x gdb-many-windows * Into this Emacs *gud-xclock* buffer: (gdb) run # then from another terminal: pkill xclock [Inferior 1 (process 76899) exited with code 01] Now Emacs starts spinning the CPU. * Into the first xterm with GDB: (gdb) thread apply all bt ... nothing (even after quitting the Emacs *gud-xclock* buffer and that the CPU goes back to normal). --=20 Manuel Giraud