From patchwork Fri Apr 26 15:19:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Bird X-Patchwork-Id: 32427 Received: (qmail 70184 invoked by alias); 26 Apr 2019 15:19:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 70168 invoked by uid 89); 26 Apr 2019 15:19:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=Bird, HX-Received:720c, silent, H*r:sk:mail-pg X-HELO: mail-pg1-f176.google.com Received: from mail-pg1-f176.google.com (HELO mail-pg1-f176.google.com) (209.85.215.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 Apr 2019 15:19:43 +0000 Received: by mail-pg1-f176.google.com with SMTP id c13so807589pgt.1 for ; Fri, 26 Apr 2019 08:19:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=NM1joRNWQj2vYBVGpAxba2SEAMlQxV2wo/2qJOuOTOg=; b=FxQ6zvvtZu1h3pn0xo7U7OBS/DqyxdGnx3/PE5VNiT1nQmDil1vYhqHet4vxhCYsBo lFs+ZMcQJIcGxrD9Af904lAjn6p5GmWNtBDok76crO7PK+szS3E92OOdqI4PCFbJXs+c KpK99trYeUwWg//q8KsmvhYRkbSg4LuCqHbL4CttJK2m/EjpS6+a+zvxqd/GTq4Vzhst EkP8lo66xiKNSL//x9apCF6voZtbcfn6c0kozKg+lfEj/OG7Z6vGiaQLDzX9yOtPJshD Hxth9bsx0GLLEjza0G0u2AMLfH8zSVX4H4hqYlwwWcV3tnUIuwUeuxyrmGV4wk1ZSIF/ HKdg== Return-Path: Received: from localhost ([13.75.109.155]) by smtp.gmail.com with ESMTPSA id i2sm37040791pfo.9.2019.04.26.08.19.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2019 08:19:40 -0700 (PDT) User-agent: mu4e 1.1.0; emacs 27.0.50 From: Amos Bird To: gdb-patches@sourceware.org Subject: [PATCH] Add "thread-exited" annotation Date: Fri, 26 Apr 2019 23:19:52 +0800 Message-ID: <87d0l8pzdz.fsf@gmail.com> MIME-Version: 1.0 This patch adds "thread-exited" annotation so that annotation based clients like cgdb could currently handle thread exit. --- Amos Bird amosbird@gmail.com From 890aa5099b92b5c05bd03b1084926460f6aa0d7a Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Fri, 26 Apr 2019 23:09:11 +0800 Subject: [PATCH] Add "thread-exit" annotation. --- gdb/ChangeLog | 5 +++++ gdb/annotate.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e0120e7743..849ed30731 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-04-26 Amos Bird + + * annotate.c (annotate_thread_exited): Add "thread-exited" + annotation. + 2019-04-25 Keith Seitz PR c++/24367 diff --git a/gdb/annotate.c b/gdb/annotate.c index 97cb4c8855..b3a7343a5a 100644 --- a/gdb/annotate.c +++ b/gdb/annotate.c @@ -241,6 +241,17 @@ annotate_thread_changed (void) } } +void +annotate_thread_exited (struct thread_info *t, int silent) +{ + if (annotation_level > 1) + { + printf_filtered(("\n\032\032thread-exited," + "id=\"%d\",group-id=\"i%d\"\n"), + t->global_num, t->inf->num); + } +} + void annotate_field_begin (struct type *type) { @@ -595,4 +606,5 @@ _initialize_annotate (void) gdb::observers::breakpoint_created.attach (breakpoint_changed); gdb::observers::breakpoint_deleted.attach (breakpoint_changed); gdb::observers::breakpoint_modified.attach (breakpoint_changed); + gdb::observers::thread_exit.attach (annotate_thread_exited); } -- 2.21.0