This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Python/MI/STL visualization
Andrà PÃnitz wrote:
>> Well, segfaul is not scary. What is scary is if due to uninitialized data,
>> the amount of the children the visualizer wants to fetch end up been 10000 :-)
>
> Indeed.
>
> My "solution" here is to wildly poke around in the structure hoping to
> trigger a segfault early and interpret such segfault as "uninitialized object".
>
> So if there's a std::vector<> with size() reporting a non-0 value, try
> to access the first and last element and one from the middle and
> hope that at least one of these addresses are "bad" ;-)
>
> In practice, this works rather nicely. The bigger the reported size()
> gets the more potential harm would actually listing the children do,
> but the more likely it also is to recognize the object as uninitialized.
Oh, I think it's a nice trick :-)
- Volodya