Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] gdb.asm/*.exp send_gdb vs. gdb_test
@ 2010-05-25 19:25 Michael Snyder
  2010-05-26 17:47 ` Joel Brobecker
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2010-05-25 19:25 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 10 bytes --]

short one

[-- Attachment #2: asm.txt --]
[-- Type: text/plain, Size: 2858 bytes --]

2010-05-25  Michael Snyder  <msnyder@vmware.com>

	* gdb.asm/asm-source.exp: Replace send_gdb with gdb_test.

Index: asm-source.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v
retrieving revision 1.78
diff -u -p -r1.78 asm-source.exp
--- asm-source.exp	5 May 2010 18:06:57 -0000	1.78
+++ asm-source.exp	25 May 2010 19:22:57 -0000
@@ -297,24 +297,16 @@ gdb_test "s" "$line_foo2\[ 	\]*.*" "step
 
 # Test 'info target', and incidentally capture the entry point address.
 set entry_point 0
-send_gdb "info target\n"
-gdb_expect {
+gdb_test_multiple "info target" "info target" {
     -re "Symbols from .*asm-source.*Entry point: 0x(\[01232456789abcdefABCDEF\]+).*$gdb_prompt $" {
 	set entry_point $expect_out(1,string)
 	pass "info target"
     }
-    -re ".*$gdb_prompt $" {
-	fail "info target"
-    }
-    timeout {
-	fail "info target (timeout)"
-    }
 }
 
 # Capture the start symbol (may be '_start' or 'start')
 set entry_symbol ""
-send_gdb "info symbol 0x$entry_point\n"
-gdb_expect {
+gdb_test_multiple "info symbol 0x$entry_point" "info symbol" {
     -re "info symbol 0x$entry_point\[\r\n\]+(\[^\r\n\]*) in section .*$gdb_prompt $" {
         # We match the echoed `info symbol' command here, to help us
         # reliably identify the beginning of the start symbol in the
@@ -330,12 +322,6 @@ gdb_expect {
 	set entry_symbol $expect_out(1,string)
 	pass "info symbol"
     }
-    -re ".*$gdb_prompt $" {
-	fail "info symbol"
-    }
-    timeout {
-	fail "info symbol (timeout)"
-    }
 }
 
 # Now try a 'list' from the other source file.
@@ -388,10 +374,9 @@ gdb_test "info source" \
 # with dynamic linking, where the system's shared libc was compiled
 # with debugging info; for example, on Linux, this produces 47kb of
 # output.  So we consume it as we go.
-send_gdb "info sources\n"
 set seen_asmsrc_1 0
 set seen_asmsrc_2 0
-gdb_expect {
+gdb_test_multiple "info sources" "info sources" {
     -re "^\[^,\]*asmsrc1.s(, |\[\r\n\]+)" {
         set seen_asmsrc_1 1
         exp_continue
@@ -410,9 +395,6 @@ gdb_expect {
             fail "info sources"
         }
     }
-    timeout {
-            fail "info sources (timeout)"
-    }
 }
         
 
@@ -431,8 +413,7 @@ gdb_test "return" "\#0  main .*$line_mai
 # Disassemble something, check the output
 proc test_dis { command var } {
     global gdb_prompt
-    send_gdb "${command}\n"
-    gdb_expect {
+    gdb_test_multiple "${command}" "${command}" {
 	-re "${var}.*:.*(Cannot access|Bad address)" {
 	    # The "disassembler" was only accessing the local
 	    # executable and that would cause attempts to disassemble
@@ -442,9 +423,6 @@ proc test_dis { command var } {
 	-re "${var}.*:.*${gdb_prompt}" {
 	    pass "${command}"
 	}
-	timeout {
-	    fail "${command} (timeout)"
-	}
     }
 }
 

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

* Re: [RFA] gdb.asm/*.exp send_gdb vs. gdb_test
  2010-05-25 19:25 [RFA] gdb.asm/*.exp send_gdb vs. gdb_test Michael Snyder
@ 2010-05-26 17:47 ` Joel Brobecker
  2010-05-26 17:58   ` Michael Snyder
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2010-05-26 17:47 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

> 2010-05-25  Michael Snyder  <msnyder@vmware.com>
> 
> 	* gdb.asm/asm-source.exp: Replace send_gdb with gdb_test.

This is OK.   But as Volodya pointed out, we need to make sure that
the ChangeLog is a little more accurate, since you also used
gdb_test_multiple.

-- 
Joel


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

* Re: [RFA] gdb.asm/*.exp send_gdb vs. gdb_test
  2010-05-26 17:47 ` Joel Brobecker
@ 2010-05-26 17:58   ` Michael Snyder
  2010-05-26 18:06     ` Joel Brobecker
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2010-05-26 17:58 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

Joel Brobecker wrote:
>> 2010-05-25  Michael Snyder  <msnyder@vmware.com>
>>
>> 	* gdb.asm/asm-source.exp: Replace send_gdb with gdb_test.
> 
> This is OK.   But as Volodya pointed out, we need to make sure that
> the ChangeLog is a little more accurate, since you also used
> gdb_test_multiple.
> 

Urgh, I also used gdb_test_no_output in some places.

Can I just change all the changelogs to say "gdb_test, etc."?


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

* Re: [RFA] gdb.asm/*.exp send_gdb vs. gdb_test
  2010-05-26 17:58   ` Michael Snyder
@ 2010-05-26 18:06     ` Joel Brobecker
  0 siblings, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2010-05-26 18:06 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

> Urgh, I also used gdb_test_no_output in some places.
> Can I just change all the changelogs to say "gdb_test, etc."?

I don't think we are really supposed to do that, for the same reason
that we are asked to avoid contractions such as initialize_(foo|bar).
In this case, my suggestion would be to simply say:

        * avoid the use of send_gdb/gdb_expect wherever possible.

It's less complete, but it doesn't make gdb_test special compared to
the other routines. Others may have a different opinion...

-- 
Joel


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

end of thread, other threads:[~2010-05-26 18:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-25 19:25 [RFA] gdb.asm/*.exp send_gdb vs. gdb_test Michael Snyder
2010-05-26 17:47 ` Joel Brobecker
2010-05-26 17:58   ` Michael Snyder
2010-05-26 18:06     ` Joel Brobecker

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