This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: question: python gc doesn't collect buffer allocated by read_memory()
- From: Tom Tromey <tromey at redhat dot com>
- To: HATAYAMA Daisuke <d dot hatayama at jp dot fujitsu dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 20 Mar 2012 14:58:46 -0600
- Subject: Re: question: python gc doesn't collect buffer allocated by read_memory()
- References: <20120319.151647.104032080.d.hatayama@jp.fujitsu.com>
>>>>> ">" == HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> writes:
>> count = 100000
>> while count >= 0:
>> i.read_memory(buf.address, buf.type.sizeof)
>> count -= 1
You don't say what version of gdb you are using.
What you are reporting sounds like PR 12533, which was fixed in CVS back
in January.
>> 5. Looking at referrers of the buffer returned by read_memory(), they
>> are all empty [], so it looks OK to me if garbage collector collects
>> the memory...
In 12533 the problem was that intermediate values weren't properly
deallocated.
You could test for this problem by hoisting 'buf.address' out of the
loop and seeing if that has an effect.
Tom