This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA 0/8] C++-ification series #5
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 28 Nov 2016 22:05:38 -0700
- Subject: [RFA 0/8] C++-ification series #5
- Authentication-results: sourceware.org; auth=none
This series holds a few more C++-ification changes:
* Generalizes gdbpy_ref to an "externally refcounted" smart pointer,
with the behavior controlled by a policy class. This is then used
to convert BFD refcounting.
* Adds a class to optionally unlink a file in the destructor.
* Adds a class to call value_free_to_mark in the destructor.
* Adds a class to optionally discard psymtabs in the destructor.
* Fix up one more cleanup in the Python code that I missed.
* Change demangle_parse_info to have a constructor and destructor and
use unique_ptr for managing these.
gdb is getting relatively close to no cleanups in the Python layer
after this series (25 hits for "make_cleanup").
Please review. I'm running this through the buildbot and will comment
when that is done.
Note that the BFD refcounting change is a bit tricky. It probably
should have extra testing -- I tested it locally, and there's the
buildbot, and additionally I built it locally using the mingw32 cross
toolchain; but even so it's possible that there are paths that weren't
updated. These will manifest as build failures on some other
host.
One thing that would be nice is if there were a way to build gdb such
that all the nat* code were built. This would at least catch compiler
errors. I think it could be done by having stub implementations of
any platform-specific APIs that are used (just a #define for each
would probably suffice), and by arranging for only the real nat*.c
file's initialization function to be called at startup.
Tom