robustify guality self-check

Alexandre Oliva aoliva@redhat.com
Sun Sep 23 16:26:00 GMT 2012


I found out I wasn't getting any guality tests run.  The old gdb I used
wouldn't recognize line number information at -O0 or something, and this
caused guality.exp to give up.  -O2 -g would have worked, but passing
them to guality_check in either order would cause only the first of the
two to make to the command line, so the test would still fail.  Some
messing with a list and additional quoting to avoid too-early expansion
within the eval took care of that.  But the test still wouldn't work.

Debug info generated for the local variables used by the guality
framework wouldn't be recognized by that old gdb: as a result, the
variables wouldn't be set, and we'd conclude they had incorrect values.
I've now arranged for the variables to be initialized to different
values at each probe point, and if they remain unchanged, we just bump
them up and repeat the probe, with an upper limit of retries large
enough to make room for both probe variables to get values identical to
the initializer, but not for us to loop indefinitely: we quickly realize
when gdb is unable to set the probe variables and error out.

Having taken care of detecting problems, I made the probe variables
global, just like the variable used to detect whether gdb has attached
to the program, and that got things to work at least to some extend with
the older GDB.  However, it looks like we're emitting a lot of debug
info now that the older GDB can't deal with, so...

Having fixed it all, I installed a newer GDB, but I still thing the
patch brings in some useful robustness improvements.  Ok to install?

Regstrapped on x86_64-linux-gnu and i686-linux-gnu.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vta-guality-reenable.patch
Type: text/x-diff
Size: 5109 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120923/c27bb8e3/attachment.bin>
-------------- next part --------------


-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer


More information about the Gcc-patches mailing list