From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14813 invoked by alias); 6 Jul 2009 17:36:32 -0000 Received: (qmail 14804 invoked by uid 22791); 6 Jul 2009 17:36:31 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_56,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Jul 2009 17:36:17 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n66HaFQW002938 for ; Mon, 6 Jul 2009 13:36:15 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n66HaEFs024166; Mon, 6 Jul 2009 13:36:14 -0400 Received: from opsy.redhat.com (vpn-225-86.phx2.redhat.com [10.3.225.86]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n66HaD7b003957; Mon, 6 Jul 2009 13:36:13 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 331BB508085; Mon, 6 Jul 2009 11:36:12 -0600 (MDT) To: Phil Muldoon Cc: gdb-patches@sourceware.org Subject: Re: [patch] Support counted strings and embedded nulls in value.string References: <4A4A3F27.9060401@redhat.com> From: Tom Tromey Reply-To: Tom Tromey Date: Mon, 06 Jul 2009 17:36:00 -0000 In-Reply-To: <4A4A3F27.9060401@redhat.com> (Phil Muldoon's message of "Tue\, 30 Jun 2009 17\:36\:55 +0100") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00141.txt.bz2 Phil> This patch adds two related elements to the pretty-printer python Phil> support. This patch already exists in the archer-tromey-python branch Phil> of the archer repository, and here is my submission for the FSF Phil> repository. Thanks. Phil> Index: c-lang.c [...] Phil> /* Obtain a C string from the inferior storing it in a newly allocated [...] Phil> + buffer in BUFFER, which should be freed by the caller. If LENGTH Phil> + is specified at -1, the string is read until a null character of This should mention *LENGTH, not LENGTH. I think this comment (and the similar comment in language.h) would be clearer if it mentioned that LENGTH is both an in- and out-parameter. Phil> Index: python/python-prettyprint.c Phil> + /* Apply a pretty-printer for the varobj code. PRINTER_OBJ is the Phil> + print object. It must have a 'to_string' method (but this is Phil> + checked by varobj, not here) which takes no arguments and Phil> + returns a string. The printer will return a value and in the case Phil> + of a Python string being returned, this function will return a Phil> + PyObject containing the string. For any other type, *REPLACEMENT is Phil> + set to the replacement value and this function returns NULL. On Phil> + error, *REPLACEMENT is set to NULL and this function also returns Phil> + NULL. */ I noticed recently that this entire comment is shifted over by a space. Could you move it back? The code bits are approved with those two changes. It still needs a doc review. Tom