On Mon, 17 Mar 2008, Roland Mainz wrote: > Keith M Wesolowski wrote: >> On Sat, Mar 15, 2008 at 04:47:25PM +0100, Roland Mainz wrote: >>> Does anyone know tools to track down problems caused by uninitalised >>> global or stack variables except dbx's "check -access" functionality >>> (which doesn't work in B84) which work in Solaris 11 ? >> >> gcc -Wuninitialized and lint in "enhanced mode" both do this today. > > "gcc" doesn't show any problems... > ... how cam I enable "lint"'s enhanched mode ? The normal "lint" pass in > OS/Net doesn't show any problems in the related code segments...
-Nlevel=1,2,3,4 it actually works only all of the messages of the normal mode have been fixed (or switched off). >>> BTW: Did anyone thought about adding compiler options yet to initalise >>> "uninitalised" variables with a fixed byte sequence (e.g. >>> -xinituninitalised=0xdeadbeef will fill all uninitalised memory >>> belonging to variables on the stack with the (repeated) sequence >>> 0xdeadbeef ; using -xinituninitalised=0xff will write 0xff repeatedly >>> into such memory etc.) to make this kind of bug hunt more "predictable" >>> ? >> >> Interesting idea. Still, it could greatly reduce performance so you >> wouldn't likely want to ship such binaries. > > The primary purpose of the option is debugging, e.g. something to get > data in the case when other tools fail or are unavailable (like dbx's > "check -access" mode). IMO it would be nice to have more tools to corner > such bugs in an edge, e.g. I'd like to have fallback options if > something goes wrong with tools like "dbx" or "lint" (in this specific > case I already ran out of options and now I am manually editing source > code and add lots of |foo=0FEDEADFE| to the code...). > > ---- > > Bye, > Roland > > -- > __ . . __ > (o.\ \/ /.o) roland.mainz at nrubsig.org > \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer > /O /==\ O\ TEL +49 641 7950090 > (;O/ \/ \O;) > _______________________________________________ > tools-compilers mailing list > tools-compilers at opensolaris.org >
