From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1370 invoked by alias); 11 Sep 2009 23:43:27 -0000 Received: (qmail 1361 invoked by uid 22791); 11 Sep 2009 23:43:27 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Sep 2009 23:43:22 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C231A2BAC5E; Fri, 11 Sep 2009 19:43:20 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7Q7ttT8ZDYxv; Fri, 11 Sep 2009 19:43:20 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 664602BAC29; Fri, 11 Sep 2009 19:43:20 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 3FEEBF589B; Fri, 11 Sep 2009 16:43:17 -0700 (PDT) Date: Fri, 11 Sep 2009 23:43:00 -0000 From: Joel Brobecker To: Michael Snyder Cc: Hui Zhu , gdb-patches ml Subject: Re: [RFA] Make the prec support signal better[0/4] Message-ID: <20090911234317.GT20694@adacore.com> References: <4AA95648.10605@vmware.com> <20090910232952.GP20694@adacore.com> <4AAAAD82.50300@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AAAAD82.50300@vmware.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2009-09/txt/msg00348.txt.bz2 I cannot really claim that I'm an expert, but this definitely looks a lot better. The C file needs a copyright header as well. I also noticed that your C file handles K&R syntax (was it actually K&R where the type of the function arguments is provided separately after the function name and parameters are specified?), which I think is superfluous. But I think you inherited it, and I wouldn't worry about it. > gdb_test_multiple "continue" "get signal" { > -re "Program received signal SIG$thissig.*handle_$thissig.*$gdb_prompt $" { > fail "get signal $thissig (wrong location)" > } > -re "Program received signal SIG$thissig.*$gdb_prompt $" { > pass "get signal $thissig" > } > -re "Breakpoint.* handle_$thissig.*$gdb_prompt $" { > xfail "get signal $thissig" > set need_another_continue 0 > } > -re ".*$gdb_prompt $" { > fail "get signal $thissig" > set need_another_continue 0 > } > default { > fail "get signal $thissig (eof or timeout)" > } As far as I know, you do not need the "default" section. This is already handled by gdb_test_multiple. There is at least one more default in your testcase that you can probably remove. In terms of style, most tests I've seen are written with the name of the test stored in a variable, so that they don't have to copy that name around inside very case of the test_multiple: set test "$prefix; leave handler" gdb_test_multiple "$i" "${test}" { -re "Could not insert single-step breakpoint.*$gdb_prompt $" { fail "$test (could not insert single-step breakpoint)" } -re "Program exited normally.*${gdb_prompt} $" { fail "$test (program exited)" } -re "(while ..done|done = 0).*${gdb_prompt} $" { pass "$test" } > # gdb_continue_to_end "continue to sigall exit" I am guessing that you did not mean to leave this commented-out code :-) > gdb_test_multiple "echo foo\n" "test echo foo" { > -re ".*foo.*$gdb_prompt " { > pass "echo foo" > } > -re ".*$gdb_prompt " { > fail "echo foo" > } Great test! ;-) At first, I wasn't really paying attention, and I was going to say that you don't need gdb_test_multiple, since gdb_test would have been perfectly sufficient. And then, Ooooohhhhw... > return 0 I think this one can go as well. -- Joel