From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8448 invoked by alias); 20 May 2008 07:54:56 -0000 Received: (qmail 8439 invoked by uid 22791); 20 May 2008 07:54:55 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.25) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 20 May 2008 07:54:26 +0000 Received: from kahikatea.snap.net.nz (173.63.255.123.dynamic.snap.net.nz [123.255.63.173]) by viper.snap.net.nz (Postfix) with ESMTP id 21AC73DA03E; Tue, 20 May 2008 19:54:23 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 0471B8FC6D; Tue, 20 May 2008 19:54:17 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18482.33700.236263.655308@kahikatea.snap.net.nz> Date: Tue, 20 May 2008 16:43:00 -0000 To: Joel Brobecker , Eli Zaretskii , gdb-patches@sources.redhat.com Subject: Re: [PATCH] New annotation for threads In-Reply-To: <18482.29129.410026.264704@kahikatea.snap.net.nz> References: <18440.29531.916381.569346@kahikatea.snap.net.nz> <20080429023735.GD841@adacore.com> <18454.43094.168458.742737@kahikatea.snap.net.nz> <20080501181758.GD3801@adacore.com> <18458.21177.959458.278174@kahikatea.snap.net.nz> <20080501233703.GF3801@adacore.com> <18458.23326.25887.70597@kahikatea.snap.net.nz> <18478.48682.13900.951343@kahikatea.snap.net.nz> <18479.62120.536436.427524@kahikatea.snap.net.nz> <20080520035226.GA4669@adacore.com> <18482.29129.410026.264704@kahikatea.snap.net.nz> X-Mailer: VM 7.19 under Emacs 22.2.50.2 X-IsSubscribed: yes 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 X-SW-Source: 2008-05/txt/msg00592.txt.bz2 > I'll put it inside a function. I don't want to create a separate script > because I think this test belongs with all the other tests for level 2 > annotations. Like below. -- Nick http://www.inet.net.nz/~nickrob 2008-05-20 Nick Roberts * gdb.base/annota1.exp (thread_test): Test for new annotation. --- annota1.exp 17 May 2008 21:09:09 +1200 1.29 +++ annota1.exp 20 May 2008 18:48:14 +1200 @@ -490,6 +490,45 @@ if [ regexp "core not found" $exec_outpu } } +proc thread_test {} { + global objdir subdir srcdir + global gdb_prompt old_gdb_prompt + set testfile "watch_thread_num" + set srcfile ${testfile}.c + set binfile ${objdir}/${subdir}/${testfile} + set gdb_prompt $old_gdb_prompt + + if { ![get_compiler_info ${binfile}] && [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] == "" } { + + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + gdb_load ${binfile} + if { ![runto main] } then { + fail "run to main" + return + } + + set gdb_prompt \ + "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n" + + send_gdb "set annotate 2\n" + gdb_expect { + -re "set annotate 2\r\n$gdb_prompt$" {} + } + + send_gdb "next 2\n" + gdb_expect { + -re ".*\032\032new-thread" { + pass "new thread" + } + timeout { fail "new thread (timeout)" } + } + } +} + +thread_test + # restore the original prompt for the rest of the testsuite set gdb_prompt $old_gdb_prompt