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]

[commit] Fix completion.exp and varargs.exp for Symbian


completion.exp fails because there are very few extraneous symbols in
a Symbian application.  I do not have symbol files for the C library,
so GDB does not see anything outside the application.  The net result
of all this is that the tests which expect "p 'a<tab>" to expand to
enough symbols for various prompts do not work; argc and argv are the
only matches!

Also, the target_compile implementation for Symbian is picky about
unknown options.  I discovered the option "" was being passed by
varargs.exp; the quoting is scrogged.

Both of these are straightforward.  Tested on arm-symbianelf,
arm-eabi, x86_64-linux.  Checked in.

-- 
Daniel Jacobowitz
CodeSourcery

2008-05-02  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.base/completion.exp: Handle lack of other symbols beginning
	with "a".

	* gdb.base/varargs.exp: Correct quoting for options to gdb_compile.

--- gdb/testsuite/gdb.base/completion.exp	(revision 197177)
+++ gdb/testsuite/gdb.base/completion.exp	(revision 197186)
@@ -41,8 +41,8 @@
 #   "p \"break1" unambiguous (completes to filename "break1.c")
 #   "p \"break1." unambiguous (should complete to "break1.c" but does not,
 #	due to readline limitations)
-#   "p 'a" ambiguous (all symbols starting with a)
-#   "p b-a" ambiguous (all symbols starting with a)
+#   "p 'arg" ambiguous (all symbols starting with arg)
+#   "p b-arg" ambiguous (all symbols starting with arg)
 #   "p b-" ambiguous (all symbols)
 #   "file Make" "file" (word break hard to screw up here)
 #   "file ../gdb.stabs/we" "ird" (needs to not break word at slash)
@@ -421,63 +421,63 @@ gdb_expect  {
         timeout         { fail "(timeout) complete 'p \"break1.'" }
         }
 
-send_gdb "p 'a\t"
+send_gdb "p 'arg\t"
 sleep 1
 gdb_expect  {
-        -re "^p 'a\\\x07$"\
+        -re "^p 'arg\\\x07$"\
             { send_gdb "\n"
               gdb_expect {
                       -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $"\
-                                        { pass "complete 'p \'a'"}
-                      -re ".*$gdb_prompt $" { fail "complete 'p \'a'"}
-                      timeout           {fail "(timeout) complete 'p \'a'"}
+                                        { pass "complete 'p \'arg'"}
+                      -re ".*$gdb_prompt $" { fail "complete 'p \'arg'"}
+                      timeout           {fail "(timeout) complete 'p \'arg'"}
                      }
             }
-        -re ".*$gdb_prompt $"       { fail "complete 'p \'a'" }
-        timeout         { fail "(timeout) complete 'p \'a'" }
+        -re ".*$gdb_prompt $"       { fail "complete 'p \'arg'" }
+        timeout         { fail "(timeout) complete 'p \'arg'" }
         }
 
-send_gdb "p 'a\t"
+send_gdb "p 'arg\t"
 sleep 1
 gdb_expect {
-    -re "^p 'a\\\x07$" {
+    -re "^p 'arg\\\x07$" {
 	send_gdb "\t"
 	gdb_expect {
-	    -re ".*argv.*$gdb_prompt p .a$" {
+	    -re ".*argv.*$gdb_prompt p 'arg$" {
 		send_gdb "\n"
 		gdb_expect {
 		    -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
-			pass "complete (2) 'p \'a'"
+			pass "complete (2) 'p \'arg'"
 		    }
-		    -re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
-		    timeout { fail "(timeout) complete (2) 'p \'a'" }
+		    -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
+		    timeout { fail "(timeout) complete (2) 'p \'arg'" }
 		}
 	    }
 	    -re "(There are $decimal possibilities\\.  Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
 		send_gdb "n"
 		gdb_expect {
-		    -re "\\(gdb\\) p 'a$" {
+		    -re "\\(gdb\\) p 'arg$" {
 			send_gdb "\n"
 			gdb_expect {
 			    -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
-				pass "complete (2) 'p \'a'"
+				pass "complete (2) 'p \'arg'"
 			    }
 			    -re ".*$gdb_prompt $" { 
-				fail "complete (2) 'p \'a'"
+				fail "complete (2) 'p \'arg'"
 			    }
-			    timeout { fail "(timeout) complete (2) 'p \'a'" }
+			    timeout { fail "(timeout) complete (2) 'p \'arg'" }
 			}
 		    }
-		    -re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
-		    timeout { fail "(timeout) complete (2) 'p \'a'" }
+		    -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
+		    timeout { fail "(timeout) complete (2) 'p \'arg'" }
 		}
 	    }
-	    -re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
-	    timeout { fail "(timeout) complete (2) 'p \'a'" }
+	    -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
+	    timeout { fail "(timeout) complete (2) 'p \'arg'" }
 	}
     }
-    -re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
-    timeout { fail "(timeout) complete (2) 'p \'a'" }
+    -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
+    timeout { fail "(timeout) complete (2) 'p \'arg'" }
 }
 
 
@@ -502,84 +502,84 @@ gdb_expect {
 #
 # So, I'm hoping that there is no system with a static library variable named
 # `no_var_by_this_name'.
-send_gdb "p no_var_named_this-a\t"
+send_gdb "p no_var_named_this-arg\t"
 sleep 1
 gdb_expect {
-    -re "^p no_var_named_this-a\\\x07$" {
+    -re "^p no_var_named_this-arg\\\x07$" {
         send_gdb "\n"
         gdb_expect {
             -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
-                pass "complete 'p no_var_named_this-a'"
+                pass "complete 'p no_var_named_this-arg'"
             }
             -re ".*$gdb_prompt $" {
-                fail "complete 'p no_var_named_this-a'"
+                fail "complete 'p no_var_named_this-arg'"
             }
             timeout {
-                fail "(timeout) complete 'p no_var_named_this-a'"
+                fail "(timeout) complete 'p no_var_named_this-arg'"
             }
         }
     }
     -re ".*$gdb_prompt $" {
-        fail "complete 'p no_var_named_this-a'"
+        fail "complete 'p no_var_named_this-arg'"
     }
     timeout {
-        fail "(timeout) complete 'p no_var_named_this-a'"
+        fail "(timeout) complete 'p no_var_named_this-arg'"
     }
 }
 
-send_gdb "p no_var_named_this-a\t"
+send_gdb "p no_var_named_this-arg\t"
 sleep 1
 gdb_expect {
-    -re "^p no_var_named_this-a\\\x07$" {
+    -re "^p no_var_named_this-arg\\\x07$" {
 	send_gdb "\t"
 	gdb_expect {
-	    -re ".*argv.*$gdb_prompt p no_var_named_this-a$" {
+	    -re ".*argv.*$gdb_prompt p no_var_named_this-arg$" {
 		send_gdb "\n"
 		gdb_expect {
 		    -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
-			pass "complete (2) 'p no_var_named_this-a'"
+			pass "complete (2) 'p no_var_named_this-arg'"
 		    }
 		    -re ".*$gdb_prompt $" {
-                        fail "complete (2) 'p no_var_named_this-a'"
+                        fail "complete (2) 'p no_var_named_this-arg'"
                     }
 		    timeout {
-                        fail "(timeout) complete (2) 'p no_var_named_this-a'"
+                        fail "(timeout) complete (2) 'p no_var_named_this-arg'"
                     }
 		}
 	    }
 	    -re "(There are $decimal possibilities\\.  Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
 		send_gdb "n"
 		gdb_expect {
-		    -re "\\(gdb\\) p no_var_named_this-a$" {
+		    -re "\\(gdb\\) p no_var_named_this-arg$" {
 			send_gdb "\n"
 			gdb_expect {
 			    -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
-				pass "complete (2) 'p no_var_named_this-a'"
+				pass "complete (2) 'p no_var_named_this-arg'"
 			    }
 			    -re ".*$gdb_prompt $" {
-				fail "complete (2) 'p no_var_named_this-a'"
+				fail "complete (2) 'p no_var_named_this-arg'"
 			    }
 			    timeout {
-                                fail "(timeout) complete (2) 'p no_var_named_this-a'"
+                                fail "(timeout) complete (2) 'p no_var_named_this-arg'"
                             }
 			}
 		    }
 		    -re ".*$gdb_prompt $" {
-                        fail "complete (2) 'p no_var_named_this-a'"
+                        fail "complete (2) 'p no_var_named_this-arg'"
                     }
 		    timeout {
-                        fail "(timeout) complete (2) 'p no_var_named_this-a'"
+                        fail "(timeout) complete (2) 'p no_var_named_this-arg'"
                     }
 		}
 	    }
 	    -re ".*$gdb_prompt $" {
-                fail "complete (2) 'p no_var_named_this-a'"
+                fail "complete (2) 'p no_var_named_this-arg'"
             }
-	    timeout { fail "(timeout) complete (2) 'p no_var_named_this-a'" }
+	    timeout { fail "(timeout) complete (2) 'p no_var_named_this-arg'" }
         }
     }
-    -re ".*$gdb_prompt $" { fail "complete (2) 'p no_var_named_this-a'" }
-    timeout { fail "(timeout) complete (2) 'p no_var_named_this-a'" }
+    -re ".*$gdb_prompt $" { fail "complete (2) 'p no_var_named_this-arg'" }
+    timeout { fail "(timeout) complete (2) 'p no_var_named_this-arg'" }
 }
 
 send_gdb "p no_var_named_this-\t"
@@ -613,6 +613,20 @@ gdb_expect  {
                     }
 		}
 	    }
+	    -re ".*argv.*$gdb_prompt p no_var_named_this-$" {
+		send_gdb "\n"
+		gdb_expect {
+		    -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
+			pass "complete (2) 'p no_var_named_this-'"
+		    }
+		    -re ".*$gdb_prompt $" {
+			fail "complete (2) 'p no_var_named_this-'"
+		    }
+		    timeout {
+			fail "(timeout) complete (2) 'p no_var_named_this-'"
+		    }
+		}
+	    }
 	    -re ".*$gdb_prompt $" {
                 fail "complete (2) 'p no_var_named_this-'"
             }
--- gdb/testsuite/gdb.base/varargs.exp	(revision 197177)
+++ gdb/testsuite/gdb.base/varargs.exp	(revision 197186)
@@ -47,14 +47,15 @@ if [get_compiler_info ${binfile}] {
     return -1
 }
 
+set additional_flags {debug}
+
 if {$hp_cc_compiler} {
-    set additional_flags "additional_flags=-Ae"
-} else {
-    set additional_flags ""
+    lappend additional_flags "additional_flags=-Ae"
 }
 
 # build the first test case
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug ${additional_flags}}] != "" } {
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+	   executable ${additional_flags}] != "" } {
      untested varargs.exp
      return -1
 }


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