From: Simon Marchi <simark@simark.ca>
To: Amos Bird <amosbird@gmail.com>, Eli Zaretskii <eliz@gnu.org>
Cc: gbenson@redhat.com, gdb-patches@sourceware.org, tom@tromey.com
Subject: Re: [PATCH] Add "thread-exited" annotation
Date: Fri, 17 May 2019 13:08:00 -0000 [thread overview]
Message-ID: <441e0b74-a391-2d68-e5d3-f43f1b8da188@simark.ca> (raw)
In-Reply-To: <87ef4ypif5.fsf@gmail.com>
Hi Amos,
Some comments related to the format of arguments passed with the annotation:
> + printf_filtered(("\n\032\032thread-exited,"
> + "id=\"%d\",group-id=\"i%d\"\n"),
> + t->global_num, t->inf->num);
Do we use this style of MI-like record anywhere else in the annotations interface?
Other annotations that have extra info seem to just pass magic numbers after the
annotation name, such as:
printf_filtered (("\n\032\032frame-begin %d %s\n"),
level, paddress (gdbarch, pc));
I don't mind if we start using MI-like syntax for annotation parameters, but it should
be a conscious decision to do so. And if we ever add more annotations in the future, it
should follow the same pattern.
> diff --git a/gdb/doc/annotate.texinfo b/gdb/doc/annotate.texinfo
> index b85b759f9a..fb7cbf7b77 100644
> --- a/gdb/doc/annotate.texinfo
> +++ b/gdb/doc/annotate.texinfo
> @@ -836,6 +836,11 @@ The selected thread has changed. This may occur at the request of the
> user with the @code{thread} command, or as a result of execution,
> e.g., another thread hits a breakpoint.
>
> +@findex thread-exited@r{, annotation}
> +@item ^Z^Zthread-exited
> +
> +This annotation is issued once for each thread that exits.
> +
> @end table
In any case, the documentation should describe the format and meaning of
information passed with the annotation.
> +proc thread_exit {} {
> + gdb_test_multiple "call (void)pthread_exit()" "thread exit" {
> + -re ".*\032\032thread-exited.*" {
> + pass "thread exit"
> + }
> + }
> +}
Please enhance the regex to include the extra information, like (untested):
-re ".*\032\032thread-exited,id=\"${decimal}\",group-id=\"i${decimal}\""
Simon
next prev parent reply other threads:[~2019-05-17 13:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-26 15:19 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 [this message]
[not found] ` <87r28xciz3.fsf@gmail.com>
2019-05-17 14:22 ` Simon Marchi
[not found] ` <87pnohcc5t.fsf@gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=441e0b74-a391-2d68-e5d3-f43f1b8da188@simark.ca \
--to=simark@simark.ca \
--cc=amosbird@gmail.com \
--cc=eliz@gnu.org \
--cc=gbenson@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox