From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Debugging M-x gdb Date: Fri, 31 Mar 2023 17:28:02 +0300 Message-ID: <83wn2x0zd9.fsf@gnu.org> References: <871qlbfkpw.fsf@ledu-giraud.fr> <83ilen9xs2.fsf@gnu.org> <87jzyx5ol8.fsf@ledu-giraud.fr> <83edp52nrp.fsf@gnu.org> <875yah10q9.fsf@ledu-giraud.fr> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10445"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Manuel Giraud Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 31 16:28:25 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 1piFjr-0002Rh-Vr for ged-emacs-devel@m.gmane-mx.org; Fri, 31 Mar 2023 16:28:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piFjP-0001V1-Oa; Fri, 31 Mar 2023 10:27:55 -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 1piFjK-0001US-Ow for emacs-devel@gnu.org; Fri, 31 Mar 2023 10:27:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piFjK-0004o3-8q; Fri, 31 Mar 2023 10:27:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=460GNHeybS9ccafKdwK+OiS0U7/a8G5ppFvqT+KB7cY=; b=qOG3JdYHKXfN ZSgpK+3553kjpynlpWTgrO6LS4CztjyIF2WNQWceQa6DbNOmefkGKjO9QoY/FpyA1foPvxQReok4s DeNy3WgY48pVAGK/1lrRdO6C5hijMRuOj4E3Y/aIilp5h6Y+TrWtmJZbQjQTJTJ8Zp8CcsVBYGH16 Pt/OtETnIxy/VszxojO/pAX3VV3lYx2KMRdgspbT5K4HMxY2K/pNEf00aGIgdS3jKdRd32O6q/YRe aERh7mD/l4fPsCeusl0Ag+CB/hZijCfFZUlQy95/AQ21ddzU5IXcIxQ0GYaPufcCaNx8t07J9JHXb yLXJytRvwYelrjE8O9V/Ag==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piFjJ-0004p1-Gp; Fri, 31 Mar 2023 10:27:49 -0400 In-Reply-To: <875yah10q9.fsf@ledu-giraud.fr> (message from Manuel Giraud on Fri, 31 Mar 2023 15:58:38 +0200) 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:304931 Archived-At: > From: Manuel Giraud > Cc: emacs-devel@gnu.org > Date: Fri, 31 Mar 2023 15:58:38 +0200 > > * 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=mi /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). You didn't attach GDB to Emacs. Instead, you started Emacs under GDB. You should do it like this: * From exterm: $ ~/bin/emacs-debug & * From Emacs: M-x gdb Run gdb (like this): egdb -i=mi /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: $ egdb -p PID where PID is the process ID of the Emacs process that spins the CPU. Then at the prompt of this GDB: (gdb) thread apply all bt