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:25:22 +1300 Message-ID: <17384.30098.596419.302015@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 1139310872 11287 80.91.229.2 (7 Feb 2006 11:14:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Feb 2006 11:14:32 +0000 (UTC) Cc: Dan Nicolaescu , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 07 12:14:27 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 1F6Qni-0000mS-Pq for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2006 12:14:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6QmR-000591-QK for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2006 06:13:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F6QBP-0007Tu-Cy for emacs-devel@gnu.org; Tue, 07 Feb 2006 05:34:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F6QBO-0007Tb-DH for emacs-devel@gnu.org; Tue, 07 Feb 2006 05:34:50 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6QBN-0007TM-QQ for emacs-devel@gnu.org; Tue, 07 Feb 2006 05:34:50 -0500 Original-Received: from [202.37.101.8] (helo=viper.snap.net.nz) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F6QB4-0000Zb-St for emacs-devel@gnu.org; Tue, 07 Feb 2006 05:34:31 -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 38B13741567; Tue, 7 Feb 2006 23:29:57 +1300 (NZDT) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id 4EACF8890; Tue, 7 Feb 2006 23:25:23 +1300 (NZDT) Original-To: storm@cua.dk (Kim F. Storm) 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:50144 Archived-At: > > Most Emacs users/developers probably don't have GDB 6.4 so you would at > > least need to give your function a different name. > > Perhaps, for portability, could .gdbinit do something like > globally: > set $argc = -1 > and then the pp functions could test if $argc >= 0 to > recognize GDB 6.4 ? Yes, that seems to work. > > I have a couple of other functions that just work when the selected frame > > is Ffuncall, for printing all the argument names. Are they generally > > useful? > > Seems useful, but why have to functions which does the same thing? Sorry I wasn't clear. They're meant as alternatives. > Actually, it would alse be useful if you could enhance > xbacktrace to recognize when the current frame is Ffuncall and > print the args at that level (maybe for other functions too). But only some of the lisp backtrace appears as calls to Ffuncall (the primitives?). In the example that I gave, the lisp backtrace has two levels: Lisp Backtrace: "load" "normal-top-level" but the C backtrace has only one call to Ffuncall (for load): (gdb) bt #0 Fload (file=140229683, noerror=137853993, nomessage=137853993, nosuffix=137853993, must_suffix=137853945) at lread.c:682 #1 0x0818cd1b in Ffuncall (nargs=5, args=0xfef0da20) at eval.c:2893 #2 0x081c0dd6 in Fbyte_code (bytestr=137297859, vector=137298020, maxdepth=48) at bytecode.c:694 #3 0x0818d3e7 in funcall_lambda (fun=137297836, nargs=0, arg_vector=0xfef0db90) at eval.c:3066 #4 0x0818d057 in apply_lambda (fun=137297836, args=137853945, eval_flag=1) at eval.c:2988 #5 0x0818c0bc in Feval (form=139389765) at eval.c:2261 #6 0x08111668 in top_level_2 () at keyboard.c:1332 #7 0x0818ab24 in internal_condition_case (bfun=0x8111654 , handlers=137897729, hfun=0x811130f ) at eval.c:1465 #8 0x08111698 in top_level_1 () at keyboard.c:1340 #9 0x0818a5b6 in internal_catch (tag=137893985, func=0x811166d , arg=137853945) at eval.c:1211 #10 0x081115d3 in command_loop () at keyboard.c:1297 #11 0x0811108e in recursive_edit_1 () at keyboard.c:995 #12 0x081111cf in Frecursive_edit () at keyboard.c:1056 #13 0x0810faac in main (argc=2, argv=0xfef0e2a4) at emacs.c:1789 Nick