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: [RFC - Python Scripting] Unnecessary Py_XINCREF?


I take back my simple fix. I think this is not as simple as removing
the Py_XINCREF. I am working on the proper fix.

Thanks,
Siva Chandra

On Wed, Mar 28, 2012 at 3:55 PM, Siva Chandra <sivachandra@google.com> wrote:
> Hello,
>
> I find something which to my understanding looks like an unnecessary
> Py_XINCREF in py-symtab.c:stpy_get_objfile. I support it by this
> experiment:
>
> Load any program and do the following:
>
> python
> import sys
> print sys.getrefcount(gdb.lookup_global_symbol("main").symtab.objfile)
> end
>
> The above Python snippet prints 2 without the patch applied. With the
> patch applied, it prints 1 which I think is what it should be. Am I
> missing something (real bad) here?
>
> ChangeLog:
>
> 2012-03-28 ?Siva Chandra Reddy ?<sivachandra@google.com>
>
> ? ? ? ?* python/py-symtab.c (stpy_get_objfile): Remove the unnecessary
> ? ? ? ?Py_XINCREF.
>
> Thanks,
> Siva Chandra


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