From: Joel Brobecker <brobecker@adacore.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: Hui Zhu <teawater@gmail.com>,
gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [RFA] Make the prec support signal better[0/4]
Date: Fri, 11 Sep 2009 23:43:00 -0000 [thread overview]
Message-ID: <20090911234317.GT20694@adacore.com> (raw)
In-Reply-To: <4AAAAD82.50300@vmware.com>
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
next prev parent reply other threads:[~2009-09-11 23:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-09 13:28 Hui Zhu
2009-09-10 19:43 ` Michael Snyder
2009-09-10 23:30 ` Joel Brobecker
2009-09-11 0:30 ` Michael Snyder
2009-09-11 20:07 ` Michael Snyder
2009-09-11 23:43 ` Joel Brobecker [this message]
2009-09-12 0:43 ` Michael Snyder
2009-09-12 1:02 ` Joel Brobecker
2009-09-13 0:29 ` Michael Snyder
2009-09-11 21:52 ` Tom Tromey
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=20090911234317.GT20694@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.com \
--cc=teawater@gmail.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