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]

[patch] varobj.c c_describe_child


Hello,

When printing children of a variable created with a pointer type, gdb generates a copy of value of target type for each child. This quickly exhausts memory in certain cases.

In my case, customer has a struct with 1600+ fields and of size approx 900K. Listing children of such struct via a variable created with a pointer to it, crashes gdb (gdb version 6.8) due to running out of memory. The patch fixes this by removing intermediate value and freeing it.

Note that with latest gdb from HEAD it doesn't crash, I believe due to recent changes in lazy allocating the values, but it still seems wrong to keep all these intermediate values generated by 'adjust_value_for_child_access' in 'all_values' list.


Thanks,


--
Aleksandar Ristovski
QNX Software Systems


ChangeLog:


2010-03-22 Aleksandar Ristovski <aristovski@qnx.com>

* varobj.c (c_describe_child): Do not keep temporary parent value
while fetching child's value.


Attachment: varobj-removetempvalue-20100322-ChangeLog.patch
Description: Text document

Attachment: varobj-removetempvalue-20100322.patch
Description: Text document


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