Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb@sources.redhat.com
Subject: Re: Python/MI/STL visualization
Date: Wed, 23 Apr 2008 11:46:00 -0000	[thread overview]
Message-ID: <fun4a9$voj$1@ger.gmane.org> (raw)
In-Reply-To: <200804231200.52610.apoenitz@trolltech.com>

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



      reply	other threads:[~2008-04-23 10:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-23  7:46 Vladimir Prus
2008-04-23  9:59 ` Vladimir Prus
2008-04-23 10:09 ` André Pönitz
2008-04-23 10:51   ` Vladimir Prus
2008-04-23 10:55     ` André Pönitz
2008-04-23 11:46       ` Vladimir Prus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='fun4a9$voj$1@ger.gmane.org' \
    --to=vladimir@codesourcery.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox