public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix thread_info refcount
@ 2017-03-28  8:24 Yao Qi
  2017-03-28  8:24 ` [PATCH 2/2] Delete thread_info is refcount is zero Yao Qi
  2017-03-28  8:24 ` [PATCH 1/2] Add constructor and destructor to thread_info Yao Qi
  0 siblings, 2 replies; 20+ messages in thread
From: Yao Qi @ 2017-03-28  8:24 UTC (permalink / raw)
  To: gdb-patches

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-04-10 15:57 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28  8:24 [PATCH 0/2] Fix thread_info refcount Yao Qi
2017-03-28  8:24 ` [PATCH 2/2] Delete thread_info is refcount is zero Yao Qi
2017-03-28 12:10   ` Pedro Alves
2017-04-05 21:15     ` [PATCH 0/2] Don't delete thread_info if refcount isn't zero Yao Qi
2017-04-05 21:15       ` [PATCH 1/2] Hoist code on marking thread as exited Yao Qi
2017-04-06  9:27         ` Pedro Alves
2017-04-05 21:15       ` [PATCH 2/2] Don't delete thread_info if refcount isn't zero Yao Qi
2017-04-06 10:18         ` Pedro Alves
2017-04-07  9:22           ` Yao Qi
2017-04-07 10:29             ` Pedro Alves
2017-04-10 13:40               ` Yao Qi
2017-04-10 14:50                 ` [pushed] GC gdb/thread.c:current_thread_cleanup_chain (Re: [PATCH 2/2] Don't delete thread_info if refcount isn't zero) Pedro Alves
2017-04-10 15:57           ` [PATCH 2/2] Don't delete thread_info if refcount isn't zero Pedro Alves
2017-03-28  8:24 ` [PATCH 1/2] Add constructor and destructor to thread_info Yao Qi
2017-03-28 12:12   ` Pedro Alves
2017-03-28 14:08     ` Yao Qi
2017-03-28 14:47       ` Pedro Alves
2017-03-28 15:40         ` Yao Qi
2017-03-28 22:35           ` Pedro Alves
2017-03-29 15:59             ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).