This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Add "thread-exited" annotation
- From: Pedro Alves <palves at redhat dot com>
- To: Amos Bird <amosbird at gmail dot com>
- Cc: Simon Marchi <simark at simark dot ca>, Eli Zaretskii <eliz at gnu dot org>, gbenson at redhat dot com, gdb-patches at sourceware dot org, tom at tromey dot com
- Date: Thu, 6 Jun 2019 17:32:23 +0100
- Subject: Re: [PATCH] Add "thread-exited" annotation
- References: <87d0l8pzdz.fsf@gmail.com> <87ef5j33au.fsf@tromey.com> <87ftpzo1wa.fsf@gmail.com> <20190516131419.GA29999@blade.nx> <87ftpepk1l.fsf@gmail.com> <83d0kicvs6.fsf@gnu.org> <87ef4ypif5.fsf@gmail.com> <441e0b74-a391-2d68-e5d3-f43f1b8da188@simark.ca> <87r28xciz3.fsf@gmail.com> <a0024e90-a593-b4f1-4588-d391620799f1@simark.ca> <87pnohcc5t.fsf@gmail.com> <070c42f3-78bd-e605-3f9d-e708f3f0a65c@redhat.com> <87mujlc8bn.fsf@gmail.com>
On 5/17/19 6:14 PM, Amos Bird wrote:
> } else {
> gdb_test_multiple "signal SIGTRAP" "signal sent" {
> - -re ".*\032\032post-prompt\r\nContinuing with signal SIGTRAP.\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032signalled\r\n\r\nProgram terminated with signal \r\n\032\032signal-name\r\nSIGTRAP\r\n\032\032signal-name-end\r\n, \r\n\032\032signal-string\r\nTrace.breakpoint trap\r\n\032\032signal-string-end\r\n.\r\nThe program no longer exists.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" {
> +-re ".*\032\032post-prompt\r\nContinuing with signal SIGTRAP.\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032signalled\r\n\r\nProgram terminated with signal \r\n\032\032signal-name\r\nSIGTRAP\r\n\032\032signal-name-end\r\n, \r\n\032\032signal-string\r\nTrace.breakpoint trap\r\n\032\032signal-string-end\r\n.\r\nThe program no longer exists.\r\n\r\n\032\032thread-exited,id=\"${decimal}\",group-id=\"i${decimal}\"\r\n\r\n\032\032stopped\r\n$gdb_prompt$" {
> pass "signal sent"
That lost the tab before "-re" -- was that on purpose?
> }
> }
> @@ -450,6 +450,7 @@ if { [remote_file host exists core] } {
> proc thread_test {} {
> global subdir srcdir testfile srcfile binfile
> global gdb_prompt old_gdb_prompt
> + global decimal
> set srcfile watch_thread_num.c
> set binfile [standard_output_file ${testfile}-watch_thread_num]
> set gdb_prompt $old_gdb_prompt
> @@ -468,6 +469,9 @@ proc thread_test {} {
> set linenum [gdb_get_line_number "all threads started"]
> gdb_breakpoint "$linenum"
>
> + set linenum [gdb_get_line_number "first child thread exited"]
> + gdb_breakpoint "$linenum"
> +
> set gdb_prompt \
> "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n"
>
> @@ -481,6 +485,12 @@ proc thread_test {} {
> pass "new thread"
> }
> }
> +
> + gdb_test_multiple "continue" "thread exit" {
> + -re "\032\032thread-exited,id=\"${decimal}\",group-id=\"i${decimal}\"" {
> + pass "thread exit"
> + }
> + }
This should use the same indentation levels as the similar code above.
Also, this isn't expecting the prompt. Is there a reason for that?
Not matching/expecting the prompt is usually not desired, because it
leaves the prompt in the expect buffer, which can confuse following
tests.
Also, this causes some regressions:
Running src/gdb/testsuite/gdb.cp/annota2.exp ...
FAIL: gdb.cp/annota2.exp: continue until exit (timeout)
FAIL: gdb.cp/annota2.exp: delete bps
FAIL: gdb.cp/annota2.exp: break at main (got interactive prompt)
Please take a look at those and make sure to run the whole
testsuite (I only ran the "gdb.*/annota*.exp" tests).
Thanks,
Pedro Alves