diff options
author | Tom Tromey <tromey@redhat.com> | 2013-05-30 16:22:06 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-05-30 16:22:06 +0000 |
commit | af83e3f886c6e098f997d6f03dcf5e807a14a4f2 (patch) | |
tree | ba8e8baafd9aed463d011d8083535791a711f624 /gas/hash.c | |
parent | 564eac4292c0c15307fdd067dbece83f321bc3ad (diff) | |
download | gdb-af83e3f886c6e098f997d6f03dcf5e807a14a4f2.zip gdb-af83e3f886c6e098f997d6f03dcf5e807a14a4f2.tar.gz gdb-af83e3f886c6e098f997d6f03dcf5e807a14a4f2.tar.bz2 |
add the cleanup checker
This patch adds the cleanup checker. This is a Python plugin for GCC
that checks some rules for cleanup handling. In particular it tries
to notice when cleanups are left dangling at the end of a function.
It does this by applying a few simple rules.
First, it understands that a function whose return type is "struct
cleanup *" is a "cleanup constructor". Such functions are expected to
return the first cleanup that they make.
Then, it has the notion of a "master cleanup". The checker keeps a
stack of all cleanups made in a basic block. The first element is
pushed on the stack is the master cleanup -- the one that must later
be passed to either do_cleanups or discard_cleanups.
It is not perfect -- some constructs confuse it. So, part of this
series rewrites some code in gdb so that it is analyzable. I'll note
these spots and you can decide whether or not this is a good idea.
This patch also changes gcc-with-excheck to give it options. Now you
must use either -Xc (for the cleanup checker) or -Xx (for the
exception checker).
* contrib/cleanup_check.py: New file.
* contrib/gcc-with-excheck: Add option parsing.
Diffstat (limited to 'gas/hash.c')
0 files changed, 0 insertions, 0 deletions