This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch][python] 1/3 Python representation of GDB line tables (Python code)


>> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]