Make gdb.base/foll-exec.exp test pattern more general

Message ID 1477600417-10278-1-git-send-email-lgustavo@codesourcery.com
State New, archived
Headers

Commit Message

Luis Machado Oct. 27, 2016, 8:33 p.m. UTC
  Testing a nios toolchain running gdbserver on the other end i noticed a
failure in gdb.base/foll-exec.exp.  Turns out gdb is outputting a slightly
different pattern due to the presence of debug information.

--
foll-exec is about to execlp(execd-prog)...^M
Continuing.^M
process 21222 is executing new program: gdb.d/outputs/gdb.base/foll-exec/execd-prog^M
^M
Catchpoint 2 (exec'd gdb.d/outputs/gdb.base/foll-exec/execd-prog), _start () at ../sysdeps/powerpc/powerpc32/dl-start.S:32^M
--

Notice the presence of source file information.

Now, on my local machine, i get this:

--
foll-exec is about to execlp(execd-prog)...^M
Continuing.^M
process 9285 is executing new program: gdb/testsuite/outputs/gdb.base/foll-exec/execd-prog^M
^M
Catchpoint 2 (exec'd gdb/testsuite/outputs/gdb.base/foll-exec/execd-prog), 0x00007ffff7dd7cc0 in ?? () from /lib64/ld-linux-x86-64.so.2^M
--

So the output differs slightly and the testcase is actually expecting only
the second form with the "in" anchor.

This patch removes the "in" pattern and lets the test match both kinds of
output.

OK?

gdb/testsuite/ChangeLog:

2016-10-27  Luis Machado  <lgustavo@codesourcery.com>

	* gdb.base/foll-exec.exp (do_exec_tests): Make test pattern more
	general.
---
 gdb/testsuite/gdb.base/foll-exec.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Yao Qi Oct. 28, 2016, 9:29 a.m. UTC | #1
On Thu, Oct 27, 2016 at 9:33 PM, Luis Machado <lgustavo@codesourcery.com> wrote:
> Testing a nios toolchain running gdbserver on the other end i noticed a
> failure in gdb.base/foll-exec.exp.  Turns out gdb is outputting a slightly
> different pattern due to the presence of debug information.
>
> --
> foll-exec is about to execlp(execd-prog)...^M
> Continuing.^M
> process 21222 is executing new program: gdb.d/outputs/gdb.base/foll-exec/execd-prog^M
> ^M
> Catchpoint 2 (exec'd gdb.d/outputs/gdb.base/foll-exec/execd-prog), _start () at ../sysdeps/powerpc/powerpc32/dl-start.S:32^M
> --

Is it a nios toolchain or ppc toolchain?  Patch is good to me.
  
Luis Machado Oct. 28, 2016, 1:47 p.m. UTC | #2
On 10/28/2016 04:29 AM, Yao Qi wrote:
> On Thu, Oct 27, 2016 at 9:33 PM, Luis Machado <lgustavo@codesourcery.com> wrote:
>> Testing a nios toolchain running gdbserver on the other end i noticed a
>> failure in gdb.base/foll-exec.exp.  Turns out gdb is outputting a slightly
>> different pattern due to the presence of debug information.
>>
>> --
>> foll-exec is about to execlp(execd-prog)...^M
>> Continuing.^M
>> process 21222 is executing new program: gdb.d/outputs/gdb.base/foll-exec/execd-prog^M
>> ^M
>> Catchpoint 2 (exec'd gdb.d/outputs/gdb.base/foll-exec/execd-prog), _start () at ../sysdeps/powerpc/powerpc32/dl-start.S:32^M
>> --
>
> Is it a nios toolchain or ppc toolchain?  Patch is good to me.
>

Sorry, it is obviously powerpc, as the source file above says. :-)

I was dealing with a nios problem before and ended up confusing both.

Pushed this as b129b0cacd4c8e982605b7c8d99e96c74155882a.

Thanks,
Luis
  

Patch

diff --git a/gdb/testsuite/gdb.base/foll-exec.exp b/gdb/testsuite/gdb.base/foll-exec.exp
index 952a71c..ed86c0f 100644
--- a/gdb/testsuite/gdb.base/foll-exec.exp
+++ b/gdb/testsuite/gdb.base/foll-exec.exp
@@ -191,7 +191,7 @@  proc do_exec_tests {} {
 
    send_gdb "continue\n"
    gdb_expect {
-     -re ".*xecuting new program:.*${testfile2}.*Catchpoint .*(exec\'d .*${testfile2}).*in .*$gdb_prompt $"\
+     -re ".*xecuting new program:.*${testfile2}.*Catchpoint .*(exec\'d .*${testfile2}).*$gdb_prompt $"\
                      {pass "hit catch exec"}
      -re "$gdb_prompt $" {fail "hit catch exec"}
      timeout         {fail "(timeout) hit catch exec"}