This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 0/2] Fix thread_info refcount


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]