public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add "thread-exited" annotation
@ 2019-04-26 15:19 Amos Bird
  2019-04-30 15:45 ` Tom Tromey
  0 siblings, 1 reply; 19+ messages in thread
From: Amos Bird @ 2019-04-26 15:19 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 157 bytes --]


This patch adds "thread-exited" annotation so that annotation 
based clients like cgdb could currently handle thread exit.

--
Amos Bird
amosbird@gmail.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-thread-exit-annotation.patch --]
[-- Type: text/x-patch, Size: 1461 bytes --]

From 890aa5099b92b5c05bd03b1084926460f6aa0d7a Mon Sep 17 00:00:00 2001
From: Amos Bird <amosbird@gmail.com>
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  <amosbird@gmail.com>
+
+	* annotate.c (annotate_thread_exited): Add "thread-exited"
+	annotation.
+
 2019-04-25  Keith Seitz  <keiths@redhat.com>
 
 	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


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

end of thread, other threads:[~2019-06-06 17:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-26 15:19 [PATCH] Add "thread-exited" annotation Amos Bird
2019-04-30 15:45 ` Tom Tromey
2019-04-30 17:09   ` Amos Bird
2019-05-16 13:14     ` Gary Benson
2019-05-16 14:10       ` Amos Bird
2019-05-16 14:35         ` Eli Zaretskii
2019-05-16 14:45           ` Amos Bird
2019-05-17  9:59             ` Gary Benson
2019-05-17 10:55               ` Amos Bird
2019-05-17 13:08             ` Simon Marchi
2019-05-17 13:23               ` Amos Bird
2019-05-17 14:22                 ` Simon Marchi
2019-05-17 15:50                   ` Amos Bird
2019-05-17 16:26                     ` Pedro Alves
2019-05-17 17:13                       ` Amos Bird
2019-06-06 15:37                         ` Amos Bird
2019-06-06 16:32                         ` Pedro Alves
2019-06-06 17:11                           ` Amos Bird
2019-06-06 17:37                             ` Tom Tromey

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).