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.bugs Subject: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Date: Sun, 12 Feb 2023 16:49:13 +0200 Message-ID: <83fsbbgcra.fsf@gnu.org> References: <83mt5jghej.fsf@gnu.org> <83k00ngeu8.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36967"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 61453@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 12 15:50:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1pRDgG-0009Ry-IO for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Feb 2023 15:50:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRDg6-0004Q2-QZ; Sun, 12 Feb 2023 09:50:06 -0500 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 1pRDg2-0004Pe-5W for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 09:50:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRDg1-00023S-Sb for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 09:50:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pRDg1-0006Nd-Kt for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 09:50:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 14:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61453 X-GNU-PR-Package: emacs Original-Received: via spool by 61453-submit@debbugs.gnu.org id=B61453.167621338924501 (code B ref 61453); Sun, 12 Feb 2023 14:50:01 +0000 Original-Received: (at 61453) by debbugs.gnu.org; 12 Feb 2023 14:49:49 +0000 Original-Received: from localhost ([127.0.0.1]:44459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRDfo-0006N7-On for submit@debbugs.gnu.org; Sun, 12 Feb 2023 09:49:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRDfn-0006Mu-J7 for 61453@debbugs.gnu.org; Sun, 12 Feb 2023 09:49:48 -0500 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 1pRDfi-00020t-6F; Sun, 12 Feb 2023 09:49:42 -0500 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=NjjzVOVrtLn+tiYj/T/pjbvvPNvIDQDn4ZrnQOxMrBc=; b=HChKMUtcQSSP vE5Ov0ab+My1svJfJ/qJ4Ew6/jwCDdfjx4NQbWNESa2Daj1vVnwS2CbFRnQHMPlFZrzgt1aKlSeIf 2YylHTkfLHFkb5c2OyKLHD7Obfoauo8ZMVB/UaohL9LDw9xoa9CbQcBNsy08VAzynxoBt0QYO+pYG r3XC1pM1hUSLT5KLnTOwFy97rp7SEhH550KwBopZtZwdp+p1uVtyUDT1Uk1FAiRNqZxysbir/CiYd nTEiBYqMC64gqX0K7ZPX8k9oDoj5sXs+ag4jYAwLXtJG6rZA4X88G//eedyyHbOVIwZA2jGQqZKTd KJ2gfQ+AYmH9FaZ5Zw60OQ==; 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 1pRDfg-0000SR-HP; Sun, 12 Feb 2023 09:49:40 -0500 In-Reply-To: (message from Alan Mackenzie on Sun, 12 Feb 2023 14:42:38 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255419 Archived-At: > Date: Sun, 12 Feb 2023 14:42:38 +0000 > Cc: 61453@debbugs.gnu.org, acm@muc.de > From: Alan Mackenzie > > I've looked at the pp command, and I think it is only capable of > displaying objects from within the Lisp environment; it won't display > Lisp_Object's in the C environment. Nonsense, I use it every day when debugging the C code. The GDB command "pp" can display any Lisp object defined by a C expression. > > You do need to have a running Emacs for "pp", but if you attach to a > > running Emacs, you already have that. I guess the problem is that the > > output of "pp" goes to the same display as the one Emacs uses, ..... > > I have an Emacs running gdb, and a seperate "target" Emacs, the one being > debugged. I'm not sure which one you mean as "... the one Emacs uses". I mean the Emacs you debug. > > But does it really work? You use $arg0, but that means you cannot > > have an arbitrary expression as an argument, and have to be very > > cautious with blanks and other delimiters, because GDB could decide > > that $arg0 is just part of the argument. > > Thanks, that's a good point I wasn't aware of. One way out of that would > be to test gdb's $argc is exactly 1, and throw an error message if not. How will this help? You will ask people to deliberately remove any delimiters from what they type? That's a terrible annoyance. It means, for example, that you cannot simply copy/paste code fragments. > Presumably, there will be some way to quote arguments to gdb functions, > I'll have to read the fine manual a bit more closely. Even if there are such quoting methods (I'm not sure), using them will be a significant annoyance.