Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Amos Bird <amosbird@gmail.com>
Cc: Simon Marchi <simark@simark.ca>, Eli Zaretskii <eliz@gnu.org>,
	gbenson@redhat.com, gdb-patches@sourceware.org, tom@tromey.com
Subject: Re: [PATCH] Add "thread-exited" annotation
Date: Thu, 06 Jun 2019 16:32:00 -0000	[thread overview]
Message-ID: <dda77568-d9a3-b695-7271-89d49aaf10a4@redhat.com> (raw)
In-Reply-To: <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


  parent reply	other threads:[~2019-06-06 16:32 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
     [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 [this message]
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=dda77568-d9a3-b695-7271-89d49aaf10a4@redhat.com \
    --to=palves@redhat.com \
    --cc=amosbird@gmail.com \
    --cc=eliz@gnu.org \
    --cc=gbenson@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --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