[PATCH 1/4] Change pspace_to_pspace_object to return a new reference

Simon Marchi simark@simark.ca
Sun Sep 16 01:58:00 GMT 2018


On 2018-09-15 9:19 p.m., Simon Marchi wrote:
> On 2018-09-13 1:30 a.m., Tom Tromey wrote:
>> This changes pspace_to_pspace_object to return a new reference and
>> fixes up all the callers.
> 
> Actually, I think the patch is missing a hunk or something, I get this error:
> 
> /home/simark/src/binutils-gdb/gdb/python/py-inferior.c:474:13: error: no viable conversion from 'gdbpy_ref<>' (aka 'gdb::ref_ptr<_object, gdbpy_ref_policy<_object> >') to 'PyObject *' (aka '_object *')
>   PyObject *py_pspace = pspace_to_pspace_object (pspace);
>             ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 1 error generated.

Ah ok, this is the code I added recently, that's why.  I think changing it to

  return pspace_to_pspace_object (pspace).release ();

should work.

Simon



More information about the Gdb-patches mailing list