Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Tom Tromey'" <tromey@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: [Commit]: small test suite cleanup
Date: Fri, 13 Feb 2009 23:49:00 -0000	[thread overview]
Message-ID: <000601c98e34$09bc0390$1d340ab0$@u-strasbg.fr> (raw)
In-Reply-To: <m3tz6yc4i8.fsf@fleche.redhat.com>

After Tom's approval,

this is what I finally committed



Pierre Muller
Pascal language support maintainer for GDB






2009-02-14  Pierre Muller  <muller@ics.u-strasbg.fr>
 
     * lib/gdb.exp (get_valueof): Accept anything as a return value.
      (get_integer_valueof): New procedure.
      (get_sizeof): Use new get_integer_value_of.
      * gdb.base/sizeof.exp: Replace all uses of get_valueof
      by get_integer_valueof.


$ cvs diff -up lib/gdb.exp gdb.base/sizeof.exp ChangeLog
Index: lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.110
diff -u -p -r1.110 gdb.exp
--- lib/gdb.exp 13 Feb 2009 16:13:47 -0000      1.110
+++ lib/gdb.exp 13 Feb 2009 23:34:28 -0000
@@ -2885,19 +2885,36 @@ proc get_valueof { fmt exp default } {
     set test "get valueof \"${exp}\""
     set val ${default}
     gdb_test_multiple "print${fmt} ${exp}" "$test" {
+       -re "\\$\[0-9\]* = (.*)\[\r\n\]*$gdb_prompt $" {
+           set val $expect_out(1,string)
+           pass "$test ($val)"
+       }
+       timeout {
+           fail "$test (timeout)"
+       }
+    }
+    return ${val}
+}
+
+proc get_integer_valueof { exp default } {
+    global gdb_prompt
+
+    set test "get integer valueof \"${exp}\""
+    set val ${default}
+    gdb_test_multiple "print /d ${exp}" "$test" {
        -re "\\$\[0-9\]* = (\[-\]*\[0-9\]*).*$gdb_prompt $" {
            set val $expect_out(1,string)
            pass "$test ($val)"
        }
        timeout {
-           set size ${default}
-           fail "get value of ${exp} (timeout)"
+           fail "$test (timeout)"
        }
     }
     return ${val}
 }

+
 proc get_sizeof { type default } {
-    return [get_valueof "/d" "sizeof (${type})" $default]
+    return [get_integer_valueof "sizeof (${type})" $default]
 }

Index: gdb.base/sizeof.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/sizeof.exp,v
retrieving revision 1.14
diff -u -p -r1.14 sizeof.exp
--- gdb.base/sizeof.exp 13 Feb 2009 16:13:47 -0000      1.14
+++ gdb.base/sizeof.exp 13 Feb 2009 23:34:28 -0000
@@ -109,10 +109,10 @@ proc check_valueof { exp val } {

 # Check that GDB and the target agree over the sign of a character.

-set signof_byte [get_valueof "/d" "'\\377'" -1]
-set signof_char [get_valueof "/d" "(int) (char) -1" -1]
-set signof_signed_char [get_valueof "/d" "(int) (signed char) -1" -1]
-set signof_unsigned_char [get_valueof "/d" "(int) (unsigned char) -1" -1]
+set signof_byte [get_integer_valueof "'\\377'" -1]
+set signof_char [get_integer_valueof "(int) (char) -1" -1]
+set signof_signed_char [get_integer_valueof "(int) (signed char) -1" -1]
+set signof_unsigned_char [get_integer_valueof "(int) (unsigned char) -1"
-1]

 check_valueof "'\\377'" ${signof_byte}
 check_valueof "(int) (char) -1" ${signof_char}


      reply	other threads:[~2009-02-13 23:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-13 16:36 FYI: " Tom Tromey
2009-02-13 16:57 ` Pierre Muller
2009-02-13 18:42   ` Tom Tromey
2009-02-13 23:16     ` Pierre Muller
2009-02-13 23:38       ` Tom Tromey
2009-02-13 23:49         ` Pierre Muller [this message]

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='000601c98e34$09bc0390$1d340ab0$@u-strasbg.fr' \
    --to=muller@ics.u-strasbg.fr \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.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