This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: fix two field name completion bugs


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]