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] testsuite: Avoid buffer overrun in gdb.base/default.exp


On Fri, 06 Aug 2010 17:00:18 +0200, Pierre Muller wrote:

When using attachments please use:
	Content-Disposition: inline
and not
	Content-Disposition: attachment


+gdb_test_multiple "info set" "info set" {
+    -re "confirm:  Whether to confirm potentially dangerous operations is o\[a-z\]*.(\[^\r\n\]*\[\r\n\])+history filename:  The filename in which to record the command history is (\[^\r\n\]*\[\r\n\])+listsize:  Number of source lines gdb will list by default is 10.*" {
+	verbose "Confirm dislayed"
+	set set_confirm_seen 1
+	exp_continue
+    }
+    -re "Gdb's prompt is \"$gdb_prompt \"" {
+	verbose "GDB prompt displayed"
+	set set_prompt_seen 1
+	exp_continue
+    }
+    -re "Writing into executable.*$gdb_prompt $" {
+	verbose "write displayed"
+	if { $set_prompt_seen && $set_confirm_seen } {
+	    pass "info set"
+	} else {
+	    verbose "prompt $set_prompt_seen confirm $set_confirm_seen"
+	    fail "info set (incomplete output)"
+	}
+    }
+}

The first pattern can eat up the text expected to be matched by the third
pattern.  This way the loop will never finish.  Or do I miss something?

The first pattern can match at once something like:
confirm:  Whether to confirm potentially dangerous operations is o history filename:  The filename in which to record the command history is listsize:  Number of source lines gdb will list by default is 10 Writing into executable (gdb) 


Thanks,
Jan


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