mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-09 04:21:49 +08:00
af83e3f886
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. |
||
---|---|---|
.. | ||
ari | ||
cc-with-tweaks.sh | ||
cleanup_check.py | ||
excheck.py | ||
expect-read1.c | ||
expect-read1.sh | ||
exsummary.py | ||
gcc-with-excheck | ||
test_pubnames_and_indexes.py |