From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13704 invoked by alias); 11 Feb 2011 15:57:18 -0000 Received: (qmail 13696 invoked by uid 22791); 11 Feb 2011 15:57:17 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Feb 2011 15:56:55 +0000 Received: (qmail 7000 invoked from network); 11 Feb 2011 15:56:53 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 Feb 2011 15:56:53 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch] Support inferior events in python Date: Fri, 11 Feb 2011 15:57:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-25-generic; KDE/4.5.1; x86_64; ; ) Cc: sami wagiaalla , Jan Kratochvil , Tom Tromey References: <20110209163022.GA16069@host1.dyn.jankratochvil.net> <4D55559B.1090004@redhat.com> In-Reply-To: <4D55559B.1090004@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201102111556.42026.pedro@codesourcery.com> 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: 2011-02/txt/msg00213.txt.bz2 On Friday 11 February 2011 15:28:27, sami wagiaalla wrote: > +# This file is part of the GDB testsuite. It tests Python-based > +# pretty-printing for the CLI. Is this really about pretty-printing? > + > +# Skip all tests if Python scripting is not enabled. > + > +if $tracelevel then { > + strace $tracelevel > +} > + > +load_lib gdb-python.exp > + > +set testfile "py-evthreads" > +set srcfile ${testfile}.c > +set binfile ${objdir}/${subdir}/${testfile} > +set pyfile ${srcdir}/${subdir}/py-events.py > + > +gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings} You should check for the return here. Not all targets have . > +clean_restart $testfile > + > +if { [skip_python_tests] } { continue } > + > +gdb_test_no_output "python execfile ('${pyfile}')" "" > + > +gdb_test "Test_Events" "Event testers registered." > +gdb_test_no_output "set non-stop on" > +gdb_test_no_output "set target-async on" You're not checking if the target actually supported async/non-stop when first running, which means the following tests won't work on many targets. Actually, do you really need non-stop? > + > +gdb_breakpoint [gdb_get_line_number "end of main"] > + > +send_gdb "run\n" Do you really need literal "run" here? This doesn't work against gdbserver + target remote. > +gdb_expect { > + -re ".*stop reason: signal.* > +.*stop signal: SIGSEGV.* > +.*thread num: 3.*" { > + pass "thread 3 was signalled" > + } > + timeout { > + fail "thread 3 was not signalled" > + } > +} I wonder whether if you add an explicit -re for the prompt, you'll be able to use gdb_test_multiple. FYI, most tests that do non-stop are written in MI so that the expected output is easier to expect. -- Pedro Alves