Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: Re: RFA: fix two field name completion bugs
Date: Mon, 09 Jun 2008 19:26:00 -0000	[thread overview]
Message-ID: <m3lk1e4e4g.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20080609184545.GB1378@caradoc.them.org> (Daniel Jacobowitz's message of "Mon\, 9 Jun 2008 14\:45\:45 -0400")

>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:

>> +send_gdb "p values\[0\] . a\t"
>> +sleep 3
>> +gdb_expect  {

Daniel> I know there's other tests in completion.exp that do this but are the
Daniel> sleeps really necessary?  Anywhere that we sleep, the testsuite
Daniel> becomes timing sensitive - not to mention slow.

I just copied and pasted this code.  FWIW completion.exp seems ripe
for refactoring into some procs ... but I don't plan to do that.

I looked at cvs annotate but it did not tell me much.  Many of the
sleeps in this file date to the initial revision.

I removed the new sleeps here, and it still worked.  This doesn't tell
us anything directly -- it could still fail on a slower machine.  But
if nobody complains after a while I suppose we can assume it was ok :)

I can commit that version if you prefer.  Just let me know.  I've
appended the new completion.exp patch.

Tom

Index: testsuite/gdb.base/completion.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/completion.exp,v
retrieving revision 1.30
diff -u -r1.30 completion.exp
--- testsuite/gdb.base/completion.exp	6 Jun 2008 20:58:08 -0000	1.30
+++ testsuite/gdb.base/completion.exp	9 Jun 2008 19:11:42 -0000
@@ -654,6 +654,36 @@
         timeout         { fail "(timeout) complete 'p values\[0\].a' 2" }
         }
 
+send_gdb "p values\[0\] . a\t"
+gdb_expect  {
+        -re "^p values.0. . a_field $"\
+            { send_gdb "\n"
+              gdb_expect {
+                      -re "^.* = 0.*$gdb_prompt $"\
+                                        { pass "complete 'p values\[0\] . a'"}
+                      -re ".*$gdb_prompt $" { fail "complete 'p values\[0\] . a'"}
+                      timeout           {fail "(timeout) complete 'p values\[0\] . a'"}
+                     }
+            }
+        -re ".*$gdb_prompt $"       { fail "complete 'p values\[0\] . a'" }
+        timeout         { fail "(timeout) complete 'p values\[0\] . a' 2" }
+        }
+
+send_gdb "p &values\[0\] -> a\t"
+gdb_expect  {
+        -re "^p &values.0. -> a_field $"\
+            { send_gdb "\n"
+              gdb_expect {
+                      -re "^.* = .*0x\[0-9a-fA-F\]*.*$gdb_prompt $"\
+                                        { pass "complete 'p &values\[0\] -> a'"}
+                      -re ".*$gdb_prompt $" { fail "complete 'p &values\[0\] -> a'"}
+                      timeout           {fail "(timeout) complete 'p &values\[0\] -> a'"}
+                     }
+            }
+        -re ".*$gdb_prompt $"       { fail "complete 'p &values\[0\] -> a'" }
+        timeout         { fail "(timeout) complete 'p &values\[0\] -> a' 2" }
+        }
+
 # The following tests used to simply try to complete `${objdir}/file',
 # and so on.  The problem is that ${objdir} can be very long; the
 # completed filename may be more than eighty characters wide.  When


  reply	other threads:[~2008-06-09 19:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-08 18:41 Tom Tromey
2008-06-09 19:15 ` Daniel Jacobowitz
2008-06-09 19:26   ` Tom Tromey [this message]
2008-06-09 22:40     ` Daniel Jacobowitz
2008-06-09 22:50       ` Tom Tromey

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=m3lk1e4e4g.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /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