From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6857 invoked by alias); 7 Nov 2013 17:07:00 -0000 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 Received: (qmail 6846 invoked by uid 89); 7 Nov 2013 17:07:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE,SPAM_SUBJECT,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Nov 2013 17:06:59 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA7H6plP026856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Nov 2013 12:06:51 -0500 Received: from barimba (ovpn-113-94.phx2.redhat.com [10.3.113.94]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rA7H6oSc003291 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 7 Nov 2013 12:06:51 -0500 From: Tom Tromey To: Phil Muldoon Cc: gdb-patches@sourceware.org Subject: Re: [patch][python] 1/3 Python representation of GDB line tables (Python code) References: <5253F4D4.1050600@redhat.com> <87ob6fd8c7.fsf@fleche.redhat.com> <527BC0F3.1080800@redhat.com> Date: Thu, 07 Nov 2013 17:08:00 -0000 In-Reply-To: <527BC0F3.1080800@redhat.com> (Phil Muldoon's message of "Thu, 07 Nov 2013 16:33:55 +0000") Message-ID: <87habow385.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-11/txt/msg00196.txt.bz2 >> I think it's cheaper, and no more difficult, to just build a set object >> from the start rather than make a list and the convert it. I'm not sure >> what to about Python 2.4 though. Phil> All API access to sets is new in 2.5 (sets appeared in the Python Phil> default library in 2.3) Phil> I elected here just to use a dictionary to ensure unique line numbers Phil> only. Thanks, Phil. Python 2.4 support is getting to be a pain. Phil> + if (item->line > 0) Phil> + { Phil> + line = PyLong_FromUnsignedLongLong (item->line); This should use gdb_py_object_from_longest. Phil> +static PyObject * Phil> +ltpy_entry_get_line (PyObject *self, void *closure) Phil> +{ Phil> + linetable_entry_object *obj = (linetable_entry_object *) self; Phil> + Phil> + return PyLong_FromUnsignedLongLong (obj->line); This one too. Phil> +static PyObject * Phil> +ltpy_entry_get_pcs (PyObject *self, void *closure) Phil> +{ Phil> + linetable_entry_object *obj = (linetable_entry_object *) self; Phil> + Phil> + return PyLong_FromUnsignedLongLong (obj->pc); I think this one should use gdb_py_long_from_ulongest. The patch is ok with those changes. Tom