Patchwork [testsuite] Allow function arguments in bp print match in selftest_setup

login
register
mail settings
Submitter Tom de Vries
Date June 12, 2018, 3:15 p.m.
Message ID <20180612151500.xgw27odexd5fgyww@localhost.localdomain>
Download mbox | patch
Permalink /patch/27753/
State New
Headers show

Comments

Tom de Vries - June 12, 2018, 3:15 p.m.
Hi,

atm selftest.exp fails for me.

One of the reasons is that setting the breakpoint on captured_main and running
to it gives us:
...
Breakpoint 1, captured_main (data=data@entry=0x7fffffffdb80) at main.c:1144
...
while the matching in selftest_setup only allows '()', like this:
...
Breakpoint 1, captured_main () at main.c:1144
...

The patch fixes this by allowing for random strings inbetween the parentheses.

Tested selftest.exp (with two other selftest.exp related fixes applied).

OK for trunk?

Thanks,
- Tom

[gdb] Allow function arguments in bp print match in selftest_setup

2018-06-12  Tom de Vries  <tdevries@suse.de>

	* lib/selftest-support.exp (selftest_setup): Allow function arguments in
	matching of breakpoint printing.

---
 gdb/testsuite/lib/selftest-support.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp
index f7169e0955..0542861e78 100644
--- a/gdb/testsuite/lib/selftest-support.exp
+++ b/gdb/testsuite/lib/selftest-support.exp
@@ -88,10 +88,10 @@  proc selftest_setup { executable function } {
 
     set description "run until breakpoint at $function"
     gdb_test_multiple "run $INTERNAL_GDBFLAGS" "$description" {
-        -re "Starting program.*Breakpoint \[0-9\]+,.*$function \\(\\).* at .*main.c:.*$gdb_prompt $" {
+        -re "Starting program.*Breakpoint \[0-9\]+,.*$function \\(.*\\).* at .*main.c:.*$gdb_prompt $" {
             pass "$description"
         }
-        -re "Starting program.*Breakpoint \[0-9\]+,.*$function \\(\\).*$gdb_prompt $" {
+        -re "Starting program.*Breakpoint \[0-9\]+,.*$function \\(.*\\).*$gdb_prompt $" {
             xfail "$description (line numbers scrambled?)"
         }
 	-re "Starting program.*Breakpoint \[0-9\]+,.* at .*main.c:.*$function.*$gdb_prompt $" {