From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12233 invoked by alias); 13 Feb 2009 23:53:54 -0000 Received: (qmail 12224 invoked by uid 22791); 13 Feb 2009 23:53:53 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.155) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Feb 2009 23:53:49 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n1DNrSrq099626 ; Sat, 14 Feb 2009 00:53:28 +0100 (CET) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402:d::11]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n1DNrS4B072931 ; Sat, 14 Feb 2009 00:53:28 +0100 (CET) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n1DNrRxC000899 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Sat, 14 Feb 2009 00:53:28 +0100 (CET) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: , "'Tom Tromey'" Subject: [RFA] testsuite, add get_hexadecimal_valueof proc to lib/gdb.exp Date: Sat, 14 Feb 2009 00:00:00 -0000 Message-ID: <000701c98e36$466ebb50$d34c31f0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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-02/txt/msg00316.txt.bz2 Following our discussion by email and on IRC, I submit here one more patch corresponding to a new gdb.exp proc that reads an hexadecimal number. Tom, could you please run your patch tester on this? Thanks in advance, Pierre Muller Pascal language support maintainer for GDB 2009-02-14 Pierre Muller * lib/gdb.exp (get_hexadecimal_valueof): New procedure. * gdb.base/pc-fp.exp (get_valueofx): Remove. Replace calls to get_valueofx by get_hexadecimal_valueof. $ cvs diff -up gdb.base/pc-fp.exp lib/gdb.exp Index: gdb.base/pc-fp.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/pc-fp.exp,v retrieving revision 1.11 diff -u -p -r1.11 pc-fp.exp --- gdb.base/pc-fp.exp 3 Jan 2009 05:58:03 -0000 1.11 +++ gdb.base/pc-fp.exp 13 Feb 2009 23:48:20 -0000 @@ -53,26 +53,11 @@ if ![runto_main] then { continue } -proc get_valueofx { fmt exp default } { - global gdb_prompt - send_gdb "print${fmt} ${exp}\n" - gdb_expect { - -re "\\$\[0-9\]* = (0x\[0-9a-zA-Z\]+).*$gdb_prompt $" { - set val $expect_out(1,string) - pass "get value of ${exp}" - } - timeout { - set val ${default} - fail "get value of ${exp} (timeout)" - } - } - return ${val} -} # Get the value of PC and FP -set valueof_pc [get_valueofx "/x" "\$pc" "0"] -set valueof_fp [get_valueofx "/x" "\$fp" "0"] +set valueof_pc [get_hexadecimal_valueof "\$pc" "0"] +set valueof_fp [get_hexadecimal_valueof "\$fp" "0"] # Check that the sequence $REGNAME -> REGNUM -> $REGNAME works. Use # display since that encodes and then decodes the expression parameter Index: lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.111 diff -u -p -r1.111 gdb.exp --- lib/gdb.exp 13 Feb 2009 23:37:24 -0000 1.111 +++ lib/gdb.exp 13 Feb 2009 23:48:21 -0000 @@ -2913,6 +2913,22 @@ proc get_integer_valueof { exp default } return ${val} } +proc get_hexadecimal_valueof { exp default } { + global gdb_prompt + send_gdb "print /x ${exp}\n" + set test "get hexadecimal valueof \"${exp}\"" + gdb_expect { + -re "\\$\[0-9\]* = (0x\[0-9a-zA-Z\]+).*$gdb_prompt $" { + set val $expect_out(1,string) + pass "$test" + } + timeout { + set val ${default} + fail "$test (timeout)" + } + } + return ${val} +} proc get_sizeof { type default } { return [get_integer_valueof "sizeof (${type})" $default]