Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] testsuite, add get_hexadecimal_valueof proc to lib/gdb.exp
@ 2009-02-14  0:00 Pierre Muller
  2009-02-14  0:09 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Pierre Muller @ 2009-02-14  0:00 UTC (permalink / raw)
  To: gdb-patches, 'Tom Tromey'

  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  <muller@ics.u-strasbg.fr>

	* 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]


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] testsuite, add get_hexadecimal_valueof proc to lib/gdb.exp
  2009-02-14  0:00 [RFA] testsuite, add get_hexadecimal_valueof proc to lib/gdb.exp Pierre Muller
@ 2009-02-14  0:09 ` Tom Tromey
  2009-02-14  0:28   ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2009-02-14  0:09 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

>>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:

Pierre> Tom, could you please run your patch tester on this?

I'm running it now.  I'll let you know when it is done.

Also, send me email when you have your compile farm account, and I
will send you what you need to do this yourself.

Tom


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] testsuite, add get_hexadecimal_valueof proc to lib/gdb.exp
  2009-02-14  0:09 ` Tom Tromey
@ 2009-02-14  0:28   ` Tom Tromey
  2009-02-14  0:38     ` Pierre Muller
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2009-02-14  0:28 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

Pierre> Tom, could you please run your patch tester on this?

Tom> I'm running it now.  I'll let you know when it is done.

It passed.
This patch is ok, please check it in.

Tom


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [RFA] testsuite, add get_hexadecimal_valueof proc to lib/gdb.exp
  2009-02-14  0:28   ` Tom Tromey
@ 2009-02-14  0:38     ` Pierre Muller
  0 siblings, 0 replies; 4+ messages in thread
From: Pierre Muller @ 2009-02-14  0:38 UTC (permalink / raw)
  To: 'Tom Tromey'; +Cc: gdb-patches

Thanks,
patch committed.

Pierre

> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé : Saturday, February 14, 2009 1:23 AM
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA] testsuite, add get_hexadecimal_valueof proc to
> lib/gdb.exp
> 
> Pierre> Tom, could you please run your patch tester on this?
> 
> Tom> I'm running it now.  I'll let you know when it is done.
> 
> It passed.
> This patch is ok, please check it in.
> 
> Tom


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-14  0:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-14  0:00 [RFA] testsuite, add get_hexadecimal_valueof proc to lib/gdb.exp Pierre Muller
2009-02-14  0:09 ` Tom Tromey
2009-02-14  0:28   ` Tom Tromey
2009-02-14  0:38     ` Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox