From: Michael Snyder <msnyder@vmware.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [RFA] gdb.asm/*.exp send_gdb vs. gdb_test
Date: Tue, 25 May 2010 19:25:00 -0000 [thread overview]
Message-ID: <4BFC240A.20902@vmware.com> (raw)
[-- 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)"
- }
}
}
next reply other threads:[~2010-05-25 19:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 19:25 Michael Snyder [this message]
2010-05-26 17:47 ` Joel Brobecker
2010-05-26 17:58 ` Michael Snyder
2010-05-26 18:06 ` Joel Brobecker
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=4BFC240A.20902@vmware.com \
--to=msnyder@vmware.com \
--cc=gdb-patches@sourceware.org \
/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