This is the mail archive of the gdb-prs@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]

[Bug python/15978] New: support weakref for all python classes


https://sourceware.org/bugzilla/show_bug.cgi?id=15978

            Bug ID: 15978
           Summary: support weakref for all python classes
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: b.r.longbons at gmail dot com

IWBN if all of gdb's classes allowed weak references, via python's weakref
module. This provides a much better lifetime model than events.

Most python objects (that have __dict__) automatically support weakref. If a
classes uses __slots__, it must include '__weakref__'. I have no clue how to
implement this for classes created in C though.

test code for a -gdb.py file is:

import gdb
import weakref
print(weakref.ref(gdb.current_objfile()))

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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