Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@cygnus.com>
To: Keith Seitz <keiths@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC/A] testsuite/gdb.c++/ref-types.exp "cleanup"
Date: Fri, 19 Oct 2001 12:36:00 -0000	[thread overview]
Message-ID: <3BD07EBA.1F02F0E8@cygnus.com> (raw)
In-Reply-To: <Pine.GSO.4.33.0110182051300.13132-100000@makita.cygnus.com>

Keith Seitz wrote:
> 
> Hi,
> 
> I will be submitting some additional tests to ref-types.exp in the next
> day or so, and I thought that it would be nice to clean up ref-types.exp a
> little beforehand.
> 
> The following "patch" (which is bigger than the file) uses gdb_test and
> gdb_test_exact when appropriate, and it cleans up some common tcl "errors"
> (not really syntax errors, but common syntax usages which are, umm,
> offensive).
> 
> I think this is much easier to read than the "normal" things that are done
> in the testsuite.
> 
> I have only tested this on linux native and solaris native. If more are
> required, just name them.
> 
> What do others think?

Oh boy!  Nit pick fest!   ;-)
[Thanks for doing this, Keith, you probably know more about
Tcl than the rest of us put together.]

> +gdb_test {print s} {.[0-9]* = -1} {print value of s}
> +gdb_test {ptype s} {type = short (int)?} {ptype s}

I'm just curious why these would not be:

   gdb_test "print s" ".[0-9]* = -1" "print value of s"
   gdb_test "ptype s" "type = short (int?)" "ptype s"

Seems like the use of quotes in this context is ubiquitous
throughout the rest of the testsuite.  Is there any reason
for switching to curly braces here?  Is consistancy good?

Also I agree with the suggestion by Fernando to make the pattern
"short( int)?".


> +set pattern {.[0-9]* = \(short (int)? &\) @}
> +append pattern "$hex: -1"
>  send_gdb "print rs\n"
>  gdb_expect {
> -    -re ".\[0-9\]* = \\(short &\\) @$hex: -1.*$gdb_prompt $" {
> -        pass "print value of rs"
> -    }
> -    -re ".\[0-9\]* = \\(short int &\\) @$hex: -1.*$gdb_prompt $" {
> -        pass "print value of rs"
> -    }
> -    -re ".*$gdb_prompt $" { fail "print value of rs" }
> -    timeout           { fail "(timeout) print value of rs" }
> -    eof { fail "print rs ($GDB dumped core) (FIXME)" ; gdb_start_again ; }
> -
> +  -re $pattern {
> +    pass "print value of rs"
>    }

Would it be possible to accomplish the same thing by 
combining the two "pass" regexps thusly?

	-re ".\[0-9\]* = \\(short( int)? &\) @$hex: -1.*$gdb_prompt $" {


Michael


  parent reply	other threads:[~2001-10-19 12:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-18 22:52 Keith Seitz
2001-10-19  8:28 ` Andrew Cagney
2001-10-19 11:29   ` Keith Seitz
2001-10-19 15:12     ` Andrew Cagney
2001-10-21 12:15       ` Keith Seitz
2001-10-19 12:36 ` Michael Snyder [this message]
2001-10-19 12:58   ` Keith Seitz
2001-10-19  9:08 Keith Seitz

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=3BD07EBA.1F02F0E8@cygnus.com \
    --to=msnyder@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=keiths@cygnus.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