Python/MI/STL visualization
Vladimir Prus
vladimir@codesourcery.com
Wed Apr 23 11:46:00 GMT 2008
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
More information about the Gdb
mailing list