diff options
author | Amos Bird <amosbird@gmail.com> | 2019-06-07 01:10:14 +0800 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-06-06 11:35:15 -0600 |
commit | 1a3da2cd6175e8f25cec95fc685d4f0f43bf6807 (patch) | |
tree | 1509d1aead61942dd99e013c10d8938f173e9317 /gdb/annotate.c | |
parent | dd455cf51d2b273edf6173fcb25fc1e3c5b966b2 (diff) | |
download | gdb-1a3da2cd6175e8f25cec95fc685d4f0f43bf6807.zip gdb-1a3da2cd6175e8f25cec95fc685d4f0f43bf6807.tar.gz gdb-1a3da2cd6175e8f25cec95fc685d4f0f43bf6807.tar.bz2 |
Add thread-exit annotation.
gdb/ChangeLog
2019-04-26 Amos Bird <amosbird@gmail.com>
* annotate.c (annotate_thread_exited): Add "thread-exited"
annotation.
gdb/doc/ChangeLog
2019-06-06 Amos Bird <amosbird@gmail.com>
* annotate.texinfo (Multi-threaded Apps): Add entry for thread-exited
annotation.
gdb/testsuite/ChangeLog
2019-06-06 Amos Bird <amosbird@gmail.com>
* gdb.base/annota1.exp (thread_switch): Add test for
thread-exited annotation.
Diffstat (limited to 'gdb/annotate.c')
-rw-r--r-- | gdb/annotate.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/annotate.c b/gdb/annotate.c index 088f7c9..e6e8084 100644 --- a/gdb/annotate.c +++ b/gdb/annotate.c @@ -241,6 +241,19 @@ annotate_thread_changed (void) } } +/* Emit notification on thread exit. */ + +static 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 +608,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); } |