This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch][python] 1/3 Python representation of GDB line tables (Python code)
- From: Doug Evans <dje at google dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, gdb-patches at sourceware dot org
- Date: Fri, 8 Nov 2013 09:02:17 -0800
- Subject: Re: [patch][python] 1/3 Python representation of GDB line tables (Python code)
- Authentication-results: sourceware.org; auth=none
- References: <5253F4D4 dot 1050600 at redhat dot com> <87ob6fd8c7 dot fsf at fleche dot redhat dot com> <527BC0F3 dot 1080800 at redhat dot com> <21115 dot 62285 dot 436813 dot 473271 at ruffy dot mtv dot corp dot google dot com> <527CF370 dot 9030808 at redhat dot com>
Phil Muldoon writes:
> I've made the requested changes. For the sake of brevity I have just
> included the three file diffs this time around instead of mailing the
> whole series.
>
> This OK?
Thanks.
"works for me"
[I missed a few things in my previous review. Blech. Mea culpa.
There's a couple of function comments that don't have a blank
line between them and their function. How could I have missed that??? :-)
Ok with those changes, no need for another iteration on my account.
Thanks again.
> +/* Deconstructor for the line table object. Decrement the reference
> + to the symbol table object before calling the default free. */
Here.
> +static void
> +ltpy_dealloc (PyObject *self)
> +{
> + linetable_object *obj = (linetable_object *) self;
> +
> + Py_DECREF (obj->symtab);
> + Py_TYPE (self)->tp_free (self);
> +}
> +
> +/* Initialize LineTable, LineTableEntry and LineTableIterator
> + objects. */
Here.
> +int
> +gdbpy_initialize_linetable (void)
> +{
> + if (PyType_Ready (&linetable_object_type) < 0)
> + return -1;
> + if (PyType_Ready (&linetable_entry_object_type) < 0)
> + return -1;
> + if (PyType_Ready (<py_iterator_object_type) < 0)
> + return -1;
> +
> + Py_INCREF (&linetable_object_type);
> + Py_INCREF (&linetable_entry_object_type);
> + Py_INCREF (<py_iterator_object_type);
> +
> + if (gdb_pymodule_addobject (gdb_module, "LineTable",
> + (PyObject *) &linetable_object_type) < 0)
> + return -1;
> +
> + if (gdb_pymodule_addobject (gdb_module, "LineTableEntry",
> + (PyObject *) &linetable_entry_object_type) < 0)
> + return -1;
> +
> + if (gdb_pymodule_addobject (gdb_module, "LineTableIterator",
> + (PyObject *) <py_iterator_object_type) < 0)
> + return -1;
> +
> + return 0;
> +}