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 1/2] python: disallow python code to instanciate certain types


>> -static PyObject *
>> -objfpy_new (PyTypeObject *type, PyObject *args, PyObject *keywords)
[...]

Phil> In removing this function, you are removing the instantiation of
Phil> self-> printers (Which is needed for pretty-printers),
Phil> self-> frame-filters (for frame filters) and self->type_printers (for
Phil> type printers).  If this is the case, and I have not missed an
Phil> equivalent instantiation somewhere else, you will have an
Phil> uninitialized PyObject for each of the above and likely will result in
Phil> a crash?

Internal instantiations don't go through tp_new.  instead they use
PyObject_New.

In the case of objfile these fields are initialized in
objfile_to_objfile_object.

>> -static PyObject *
>> -pspy_new (PyTypeObject *type, PyObject *args, PyObject *keywords)

Phil> Ditto, same with object files above.

This is handled in pspace_to_pspace_object.

Tom


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