From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19485 invoked by alias); 29 Jul 2010 20:39:07 -0000 Received: (qmail 19472 invoked by uid 22791); 29 Jul 2010 20:39:07 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Jul 2010 20:39:02 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6TKccmg017371 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Jul 2010 16:38:38 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6TKccsw013563; Thu, 29 Jul 2010 16:38:38 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o6TKcb76002910; Thu, 29 Jul 2010 16:38:37 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 1A4FB3797F9; Thu, 29 Jul 2010 14:38:37 -0600 (MDT) From: Tom Tromey To: Phil Muldoon Cc: Joel Brobecker , gdb-patches ml Subject: Re: [patch] Add solib_address and decode_line Python functionality References: <4C44728D.4040408@redhat.com> <20100727162545.GF13267@adacore.com> <4C5015E2.4000205@redhat.com> Date: Thu, 29 Jul 2010 20:39:00 -0000 In-Reply-To: <4C5015E2.4000205@redhat.com> (Phil Muldoon's message of "Wed, 28 Jul 2010 12:34:58 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.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: 2010-07/txt/msg00554.txt.bz2 >>>>> "Phil" == Phil Muldoon writes: Phil> +static PyObject * Phil> +gdbpy_solib_name (PyObject *self, PyObject *args) Phil> +{ Phil> + unsigned long long pc; I don't think it is ok to use 'long long'. Maybe you can use `unsigned PY_LONG_LONG', but see the Python API manual; it seems that is not always available. If it is not available then I think this function could probably revert to 'unsigned long' and the 'k' format. Phil> + TRY_CATCH (except, RETURN_MASK_ALL) Phil> + { Phil> + if (arg) Phil> + { Phil> + char *copy; Phil> + Phil> + arg = strdup (arg); Needs xstrdup and a cleanup. I think we may want this function to also return the unparsed part of the argument string. For example we could return a tuple whose first element is a string and whose second element is the return value as in this patch. Tom