From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81249 invoked by alias); 6 Jun 2019 16:32:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 81241 invoked by uid 89); 6 Jun 2019 16:32:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=interactive X-HELO: mail-wr1-f67.google.com Received: from mail-wr1-f67.google.com (HELO mail-wr1-f67.google.com) (209.85.221.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Jun 2019 16:32:27 +0000 Received: by mail-wr1-f67.google.com with SMTP id c2so3102796wrm.8 for ; Thu, 06 Jun 2019 09:32:27 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:4eeb:42ff:feef:f164? ([2001:8a0:f913:f700:4eeb:42ff:feef:f164]) by smtp.gmail.com with ESMTPSA id x9sm31448wmj.27.2019.06.06.09.32.23 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jun 2019 09:32:24 -0700 (PDT) Subject: Re: [PATCH] Add "thread-exited" annotation To: Amos Bird 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> <87pnohcc5t.fsf@gmail.com> <070c42f3-78bd-e605-3f9d-e708f3f0a65c@redhat.com> <87mujlc8bn.fsf@gmail.com> Cc: Simon Marchi , Eli Zaretskii , gbenson@redhat.com, gdb-patches@sourceware.org, tom@tromey.com From: Pedro Alves Message-ID: Date: Thu, 06 Jun 2019 16:32:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <87mujlc8bn.fsf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-06/txt/msg00145.txt.bz2 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