From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21534 invoked by alias); 20 Jul 2012 10:05:53 -0000 Received: (qmail 21526 invoked by uid 22791); 20 Jul 2012 10:05:52 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-bk0-f41.google.com (HELO mail-bk0-f41.google.com) (209.85.214.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Jul 2012 10:05:35 +0000 Received: by bkcjc3 with SMTP id jc3so3212544bkc.0 for ; Fri, 20 Jul 2012 03:05:34 -0700 (PDT) Received: by 10.204.130.151 with SMTP id t23mr2556350bks.94.1342778734422; Fri, 20 Jul 2012 03:05:34 -0700 (PDT) Received: from [10.0.0.3] (d83-191-103-145.cust.tele2.at. [83.191.103.145]) by mx.google.com with ESMTPS id o4sm2470026bkv.15.2012.07.20.03.05.32 (version=SSLv3 cipher=OTHER); Fri, 20 Jul 2012 03:05:33 -0700 (PDT) Message-ID: <50092D6B.3040103@googlemail.com> Date: Fri, 20 Jul 2012 10:05:00 -0000 From: Oliver Buchtala User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: gdb@sourceware.org Subject: Inconsistency between results of pretty-printing children Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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: 2012-07/txt/msg00057.txt.bz2 Hi, I am facing a problem with the python API for implemenation of Printer.children(). In working examples the metod of a pretty printer looks like that: def children(): return [("key", 1)] Usually one returns an iterable here. The point is, that it returns tuples with key and value. This works fine with existing IDEs using the MI interface (kdevelop, eclipse cdt, nemiver). In the API documentation it is described, that this method should return alternating keys and values. And that is exactly what is expected by gdb's print command when printing pretty. To work with gdb's print method, I would adapt my printer to flatten the whole list so that keys and values are iterated in an alternating manner. This way it happens, that my pretty printer can not be used in IDEs and with gdb's print simultanously. Am I doing something wrong? Regards, Oliver