From: Tom Tromey <tromey@redhat.com>
To: Phil Muldoon <pmuldoon@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch][python] 1/3 Python representation of GDB line tables (Python code)
Date: Thu, 07 Nov 2013 17:08:00 -0000 [thread overview]
Message-ID: <87habow385.fsf@fleche.redhat.com> (raw)
In-Reply-To: <527BC0F3.1080800@redhat.com> (Phil Muldoon's message of "Thu, 07 Nov 2013 16:33:55 +0000")
>> 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
next prev parent reply other threads:[~2013-11-07 17:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-08 12:04 Phil Muldoon
2013-10-23 20:46 ` Tom Tromey
2013-11-07 16:35 ` Phil Muldoon
2013-11-07 17:08 ` Tom Tromey [this message]
2013-11-07 20:42 ` Doug Evans
2013-11-08 14:42 ` Phil Muldoon
2013-11-08 17:08 ` Doug Evans
2013-11-11 21:03 ` Phil Muldoon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87habow385.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=pmuldoon@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).