From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2738 invoked by alias); 13 Jul 2009 17:42:26 -0000 Received: (qmail 2730 invoked by uid 22791); 13 Jul 2009 17:42:25 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Jul 2009 17:42:20 +0000 Received: (qmail 26961 invoked from network); 13 Jul 2009 17:42:17 -0000 Received: from unknown (HELO wind.localnet) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 13 Jul 2009 17:42:17 -0000 From: Vladimir Prus To: gdb@sources.redhat.com Subject: MI & pretty-printing Date: Mon, 13 Jul 2009 17:42:00 -0000 User-Agent: KMail/1.11.90 (Linux/2.6.24-24-generic; KDE/4.2.90; i686; svn-979530; 2009-06-10) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200907132142.18043.vladimir@codesourcery.com> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00088.txt.bz2 On IRC, Tom and I talked about best way to support Python pretty-printing with MI. Here's my attempt at summarizing. 1. It does not seem like existing frontends can make use of pretty-printing automatically. If frontend tries to list children of an invalid value, GDB may just hang. If GDB automatically limits the number of children, then existing frontends will not be able to see the children beyond this limit (or have GUI for that). Therefore, it is suggested than a new MI command is used to explicitly enable pretty-printing in MI, say -enable-pretty-printing [0|1] 2. The FE may request a specific range of children by passing low and high boundary: -var-list-children varobj [low] [hi] If no range is specified, an attempt to report all children is made, be what may. 3. A varobj keeps a range of children to fetch on -var-update, and a new command is added to set that range, say, -var-set-update-range varobj low hi The important aspect is that the range updated by -var-update is not automatically changed by -var-list-children. This allows the frontend to implement any update strategy it wishes, for example: - Frontend might initially set update range to 0-10 and also fetch first 10 children. If user wishes to see 10 children more, frontend does -var-list-children 10 20. On next step, -var-update updates first 10 children, the remaining ones are discarded. - Frontend might display a part of big array, say from 1000th to 1100th elements. User scrolls. FE does: -var-list-children varobj 1100 1110 to fetch 10 more items, and then does -var-set-update-range varobj 1010 1110 so that the entire view is updated on next step. This actually seem almost same as Tom's original design, except that -var-list-children does not automatically change the update range. Since this is somewhat contrived area, I am not 100% sure the above is best solution -- feedback appreciated. - Volodya