This is the mail archive of the 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: [PATCH] Fix gdb.linespec/explicit.exp

On 01/30/2017 02:32 PM, Keith Seitz wrote:
On 01/27/2017 01:30 PM, Luis Machado wrote:

Keith, is this an oversight or did you really intend to use this construct?

I think I remember something about this from Sandra... I spent some time
tracking this down, and IIRC, this was attributed to some sloppy test
writing. The hex character is "output" whenever we have multiple
matches. On my machine, "mai" gave multiple matches. On others it did
not. So somewhere, sometime in the past, I had a patch lying around to
ensure that we had multiple (or unique) matches entirely within our test
program, i.e., stopped testing main() in favor of
"my_unique_test_function" or some such silliness.

Again, all that *if* I remember correctly, and that's a might big "if"

It sounds reasonable to assume the lack of -re was an oversight from the past then.

In case of an oversight, i've fixed the other occurrences in

After the adjustments, i've made x07 optional like so:

"break -function mai\[\x07\]*n "

I would think "?" would be (minutely) more appropriate than "*," but the
same is accomplished. In the end, that's all that really matters.

Yeah. I thought about this after submitting it.

I've tried this patch locally, and there is a problem on my local machine:

break -function mai^GnFAIL: gdb.linespec/explicit.exp: complete unique
function name (timeout)

I'm not 100% sure what's going on, but the following revision fixes this:

diff --git a/gdb/testsuite/gdb.linespec/explicit.exp
index 6a44bd1..e680a2e 100644
--- a/gdb/testsuite/gdb.linespec/explicit.exp
+++ b/gdb/testsuite/gdb.linespec/explicit.exp
@@ -187,7 +187,7 @@ namespace eval $testfile {
 	set tst "complete unique function name"
 	send_gdb "break -function mai\t"
 	gdb_test_multiple "" $tst {
-	    -re "break -function mai\[\x07\]*n " {
+	    -re "break -function mai(\\\x07)?n" {
 		send_gdb "\n"
 		gdb_test "" ".*Breakpoint \[0-9\]+.*" $tst
 		gdb_test_no_output "delete \$bpnum" "delete $tst breakpoint"

Seems like the trailing whitespace that I see when running this manually
isn't liked by the automated test suite run. For some reason. Yikes.

Thanks for the feedback. I've now adjusted the regular expression to match the above. I get full passes as well.

I'll send an updated version soon.

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