From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: Re: better "pr" with gdb-6.4 Date: Tue, 7 Feb 2006 23:48:32 +1300 Message-ID: <17384.31488.175443.179842@kahikatea.snap.net.nz> References: <200602051840.k15IeONe013609@scanner2.ics.uci.edu> <200602070004.k1704vJF000960@scanner2.ics.uci.edu> <17384.2154.16730.449835@kahikatea.snap.net.nz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1139313891 21122 80.91.229.2 (7 Feb 2006 12:04:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Feb 2006 12:04:51 +0000 (UTC) Cc: Dan Nicolaescu , emacs-devel@gnu.org, "Kim F. Storm" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 07 13:04:47 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F6RaQ-0003CQ-Tz for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2006 13:04:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6RZd-0004QE-LM for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2006 07:03:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F6QXX-0004AM-Ub for emacs-devel@gnu.org; Tue, 07 Feb 2006 05:57:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F6QUS-0003gB-CD for emacs-devel@gnu.org; Tue, 07 Feb 2006 05:55:06 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6QUP-0003fi-Uo for emacs-devel@gnu.org; Tue, 07 Feb 2006 05:54:30 -0500 Original-Received: from [202.37.101.8] (helo=viper.snap.net.nz) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F6QU1-0002Lv-PY; Tue, 07 Feb 2006 05:54:06 -0500 Original-Received: from kahikatea.snap.net.nz (p202-124-115-153.snap.net.nz [202.124.115.153]) by viper.snap.net.nz (Postfix) with ESMTP id 1E9BF741624; Tue, 7 Feb 2006 23:50:02 +1300 (NZDT) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id 9C50B8890; Tue, 7 Feb 2006 23:48:32 +1300 (NZDT) Original-To: Miles Bader In-Reply-To: X-Mailer: VM 7.19 under Emacs 22.0.50.56 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:50145 Archived-At: > FWIW, I find the current emacs debug macros quite hard to remember in > all their subtle variation. It would be nice to have the "main" > macros like pr and xbacktrace work intuitively in more cases (which I > think includes accepting an argument for pr -- everytime I debug emacs > after a long absence, I seem to try giving pr an argument a few times > before I remember how it works... :-), and deprecate the older less > flexible ones (they can be kept around for people with ancient > versions of gdb). Well GDB 6.3 isn't exactly ancient, but I think we can keep everybody happy. If we follow Kim's suggestion and modify Dan's function (GDB doesn't understand elif): set $argc = -1 define pr if ($argc == -1 || $argc == 0) set debug_print ($) else if ($argc == 1) set debug_print ($arg0) end end end then pr will work without an argument for pre 6.4 (as before) and with and without an argument for 6.4. We could also add more arguments as Dan suggests if people want, but note that GDB's print command doesn't have this feature. We need to keep pp for pre 6.4 (but those with 6.4 don't need to remember it!). Nick