This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 0/2] Fix thread_info refcount
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 28 Mar 2017 09:24:41 +0100
- Subject: [PATCH 0/2] Fix thread_info refcount
- Authentication-results: sourceware.org; auth=none
This patch set fixes PR gdb/19942 and hopefully fixes a GDB internal
error reported https://sourceware.org/ml/gdb/2017-03/msg00054.html
The fix in general is that we should free/delete thread_info when
its refcount is zero. free_thread is a static function, which is
not visible out side of thread.c, so have to make it external.
That is what I did in the patch fixing this problem for 7.12 branch
(https://sourceware.org/ml/gdb/2017-03/msg00062.html)
However, we can add constructor and destructor to thread_info, and
use delete instead of free_thread. That is why patch 1 add constructor
and destructor to thread_info. Also, this change paves the way of
using std::shared_ptr, so that "refcount" can be moved.
They are tested on x86_64-linux.
*** BLURB HERE ***
Yao Qi (2):
Add constructor and destructor to thread_info
Delete thread_info is refcount is zero
gdb/gdbthread.h | 48 ++++++++++++++++--------------
gdb/infrun.c | 7 ++++-
gdb/thread.c | 90 ++++++++++++++++++++++++++++++++++-----------------------
3 files changed, 86 insertions(+), 59 deletions(-)
--
1.9.1