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.
This commit is contained in:
Amos Bird
2019-06-07 01:10:14 +08:00
committed by Tom Tromey
parent dd455cf51d
commit 1a3da2cd61
9 changed files with 70 additions and 7 deletions

View File

@ -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);
}