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: [PATCH] Share the "multi_line" helper among all Ada testcases


On Friday, March 20 2015, Pierre-Marie de Rodat wrote:

> On 03/18/2015 03:12 PM, Joel Brobecker wrote:
>>> How about making multi_line join with strict "\r\n" too? Then if
>>> you need to match one empty line, you can do:
>>>
>>>           [multi_line "line1" \
>>> 	             ""
>>>                       "line3"]
>>>
>>> and if you need multiple, you can always do:
>>>
>>>           [multi_line "line1" \
>>> 	             "\[\r\n\]*"
>>>                       "lineNN"]
>>
>> Very good suggestion, I like it! Pierre-Marie?
>
> I do like it too: thank you for the suggestion! Here is the updated
> patch: I moved multi_line to gdb.exp, updated it according to what you
> said and updated all testcases matching "[join [list" to use it. The
> good news is that it seems no testcase actually needs the [\r\n]*
> laxism.

Hmm, I am seeing a regression on gdb.ada/info_exc.exp because of this
patch.  Because of the way multi_line was rewritten it is not possibe
anymore to mean "anything" again; it will always be at least a newline
(\r\n).

I've rewritten the test to expect the exact output from "info
exceptions" (i.e., removing the ".*" parts), but I am not sure this is
the right thing to do.  Joel/Pierre?

This was a regression introduced in the 7.10 branch, BTW.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

gdb/testsuite/ChangeLog:
2015-07-17  Sergio Durigan Junior  <sergiodj@redhat.com>

	* gdb.ada/info_exc.exp (info exceptions): Remove ".*" match.

diff --git a/gdb/testsuite/gdb.ada/info_exc.exp b/gdb/testsuite/gdb.ada/info_exc.exp
index add83c5..4f7b1d4 100644
--- a/gdb/testsuite/gdb.ada/info_exc.exp
+++ b/gdb/testsuite/gdb.ada/info_exc.exp
@@ -34,9 +34,7 @@ gdb_test "info exceptions" \
                 "program_error: $hex" \
                 "storage_error: $hex" \
                 "tasking_error: $hex" \
-                ".*" \
-                "const.aint_global_gdb_e: $hex" \
-                ".*"]
+                "const.aint_global_gdb_e: $hex"]
 
 gdb_test "info exceptions task" \
     [multi_line "All Ada exceptions matching regular expression \"task\":" \


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