From: Michael Snyder <msnyder@vmware.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFA] gdb.base a*.exp b*.exp send_gdb vs gdb_test
Date: Wed, 26 May 2010 17:41:00 -0000 [thread overview]
Message-ID: <4BFD5CA5.9070605@vmware.com> (raw)
In-Reply-To: <20100526173247.GA3019@adacore.com>
Joel Brobecker wrote:
>> 2010-05-22 Michael Snyder <msnyder@vmware.com>
>>
>> * gdb.base/a2-run.exp: Replace send_gdb with gdb_test.
>> * gdb.base/all-bin.exp: Replace send_gdb with gdb_test.
>> * gdb.base/annota1.exp: Replace send_gdb with gdb_test.
>> * gdb.base/annota3.exp: Replace send_gdb with gdb_test.
>> * gdb.base/assign.exp: Replace send_gdb with gdb_test.
>> * gdb.base/attach.exp: Replace send_gdb with gdb_test.
>> * gdb.base/bitfields.exp: Replace send_gdb with gdb_test.
>> * gdb.base/bitfields2.exp: Replace send_gdb with gdb_test.
>> * gdb.base/bitops.exp: Replace send_gdb with gdb_test.
>
> One general question:
>
>> -gdb_expect {
>> +gdb_test_multiple "run" "run until main breakpoint" {
>> -re "\r\n\032\032post-prompt\r\nStarting program: $binexp \(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)+\r\n\r\n\032\032starting\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota1.c\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped.*$gdb_prompt$" {
>> pass "run until main breakpoint"
>> }
>> - -re ".*$gdb_prompt$" {
>> - fail "run until main breakpoint"
>> - }
>> - timeout {
>> - fail "run until main breakpoint (timeout)"
>> - }
>> - }
>> +}
>
> It looks to me that this one could have been written using a simple
> gdb_test, since I don't see us using the output at all?
>
>> -send_gdb "next\n"
>> -gdb_expect {
>> - -re ".*$gdb_prompt$" { pass "go after array init line" }
>> - timeout { fail "go after array init line (timeout)" }
>> +gdb_test_multiple "next" "go after array init line" {
>> + -re "source .*annota1.c.*$gdb_prompt$" {
>> + pass "go after array init line"
>> + }
>> }
>
> Same for this one?
>
> In fact, starting from here, you suddendly started using gdb_test_multiple
> even when there was only one regexp used. I'm probably missing someting...?
> Is it something in the output that make it unsuitable for gdb_test?
No, it's the regexp. It ends with "$gdb_prompt$", with no trailing
space. gdb_test requires the output to end with "$gdb_prompt $",
including the trailing space.
Subtle but critical. ;-))
next prev parent reply other threads:[~2010-05-26 17:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-24 22:04 Michael Snyder
2010-05-26 17:38 ` Joel Brobecker
2010-05-26 17:41 ` Michael Snyder [this message]
2010-05-26 17:51 ` Joel Brobecker
2010-05-26 21:59 ` Michael Snyder
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=4BFD5CA5.9070605@vmware.com \
--to=msnyder@vmware.com \
--cc=brobecker@adacore.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