From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Ludlam Newsgroups: gmane.emacs.devel Subject: Re: Improving representation of EIEIO objects in backtraces/error messages Date: Sat, 31 Dec 2016 14:48:32 -0500 Message-ID: <7b792dd9-491a-b442-f837-e85326a6c924@siege-engine.com> References: <87ful6o8x4.fsf@ericabrahamsen.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1483213735 5446 195.159.176.226 (31 Dec 2016 19:48:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 31 Dec 2016 19:48:55 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 To: Eric Abrahamsen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 31 20:48:50 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNPe3-00085d-5t for ged-emacs-devel@m.gmane.org; Sat, 31 Dec 2016 20:48:47 +0100 Original-Received: from localhost ([::1]:45221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNPe3-00006P-Df for ged-emacs-devel@m.gmane.org; Sat, 31 Dec 2016 14:48:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNPdv-000067-GL for emacs-devel@gnu.org; Sat, 31 Dec 2016 14:48:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cNPds-0005Vf-8g for emacs-devel@gnu.org; Sat, 31 Dec 2016 14:48:39 -0500 Original-Received: from mail-qk0-f174.google.com ([209.85.220.174]:32873) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cNPds-0005VM-3a for emacs-devel@gnu.org; Sat, 31 Dec 2016 14:48:36 -0500 Original-Received: by mail-qk0-f174.google.com with SMTP id t184so323018206qkd.0 for ; Sat, 31 Dec 2016 11:48:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=U30TKz17Tg0eXs2b7RnACLjfo1gz/KEi+Oy2PzPkAU8=; b=NAZJ2rAwruTx4zhkkPpbV7lTaZq9l7lE52C5ehze99Qs/uVpitkhyna1FY0EERmSfw ncp6cAWFvwb0a3OWdzqoU80f1Fm6UFvFtdGdlMSq73/ZPA1xu6PaL8gzztKX1B5FJxci D2hzl3alLXZizCYRGEVFmuLW//JyLHAH9gbXQ6lDbbDM1BCqHzfEpkq3ZaoRIx2DlSTS 53wkoM3sLhmsgMVwW4pv+/I341AAuewQAhStMdWxN/qfni1OUwoqN0+XeNKN1JniX4RK wHMH0D5kowzXZl1muaHoDMH4PbttOGjORC/lX0a/ydXmkklp+s9I8bbeO/I+UThJDFZG dIaw== X-Gm-Message-State: AIkVDXJB6VWdJioqBX1LI0knCre+ioK/j7+YgbWGA2Fu90LPeVYMy46olD3PmkkZqUGhEQ== X-Received: by 10.55.214.152 with SMTP id p24mr41062416qkl.223.1483213714211; Sat, 31 Dec 2016 11:48:34 -0800 (PST) Original-Received: from [192.168.1.202] (pool-100-0-32-98.bstnma.fios.verizon.net. [100.0.32.98]) by smtp.googlemail.com with ESMTPSA id i190sm38028398qke.9.2016.12.31.11.48.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Dec 2016 11:48:33 -0800 (PST) In-Reply-To: <87ful6o8x4.fsf@ericabrahamsen.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.174 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211042 Archived-At: On 12/29/2016 02:02 PM, Eric Abrahamsen wrote: > I can't be the first one to be bitten by this... > > When developing using EIEIO objects, backtraces and edebug messages > can be very difficult to use. In edebug, if you're lucky, you get the > # representation, but if you're unlucky, > you get the vector. In backtraces, you always get the vector. > > For large objects, or those involving recursive data structures, this > makes error reporting frustrating, to put it delicately. It can take > the printer a good couple seconds to barf up the representation of an > object, and when it does it makes a huge mess of the minibuffer > and/or *Message* buffer. Hi Eric, CEDET includes a 'data-debug' package. If you enable that it provides a way to navigate giant data structures as you might get with EIEIO. It is also a part of Emacs now, though I'm not that familiar with how it all was merged. I have this in my .emacs file to take advantage of it: (require 'data-debug) (global-set-key "\M-:" 'data-debug-eval-expression) I also include this for eieio: (add-hook 'edebug-setup-hook (lambda () (defalias 'edebug-prin1-to-string 'eieio-edebug-prin1-to-string))) though I'm not sure if something equivalent is enabled by default during the EIEIO merge. In the CEDET repository, you can get cedet-edebug.el. It includes these two snippets that bind "A" to data debug. ;;;###autoload (add-hook 'edebug-setup-hook (lambda () (require 'cedet-edebug) ;; I suspect this isn't the best way to do this, but when ;; cust-print was used on my system all my objects ;; appeared as "#1 =" which was not useful. This allows ;; edebug to print my objects in the nice way they were ;; meant to with `object-print' and `class-name' (defalias 'edebug-prin1-to-string 'cedet-edebug-prin1-to-string) ;; Add a fancy binding into EDEBUG's keymap for ADEBUG. (define-key edebug-mode-map "A" 'data-debug-edebug-expr) )) ;;; DEBUG MODE TOO ;; This seems like as good a place as any to stick this hack. ;;;###autoload (add-hook 'debugger-mode-hook (lambda () (require 'cedet-edebug) ;; Add a fancy binding into the debug mode map for ADEBUG. (define-key debugger-mode-map "A" 'data-debug-edebug-expr) )) Eric