Re: Detecting Reads of Global Uninitialized Variables



"Mike Wahler" <mkwahler@xxxxxxxxxxxx> wrote in message
news:jJ__e.1161$4h2.796@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> <jyu.james@xxxxxxxxx> wrote in message
> news:1128034028.587595.231600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > I'm trying to detect reads of uninitialized global variables (that are
> > declared in one file, and used in another as an extern).
....
> > Is there a tool out there that can do this? Or is there a particular
> > technique that can be used to automate this?
>
> You'll need some kind of C parser.

If these variables are grouped into a special section, it might be possible
to trap on each and every access to the pages in which the section lies. It
may not be easy to do, though, or not easy to find everything if you have
many variables in there and need to stop every time... Just an idea...

Alex


.



Relevant Pages