[PATCH] [testsuite] Make the testsuite work on mingw

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] [testsuite] Make the testsuite work on mingw

Sourceware - gdb-patches mailing list
Dejagnu produces an objdir like /c/, but GDB expects something like c:/.
So fix it up in lib/gdb.exp.

gdb/testsuite/ChangeLog:

2019-08-14  Christian Biesinger  <[hidden email]>

        * lib/gdb.exp: When running on a mingw target, replace
        /x/ with x:/.
---
 gdb/testsuite/lib/gdb.exp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index edc8dfcdfd..af56e8aa12 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4724,6 +4724,10 @@ proc standard_output_file {basename} {
 
     set dir [make_gdb_parallel_path outputs $subdir $gdb_test_file_name]
     file mkdir $dir
+    # If running on MinGW, replace /c/foo with c:/foo
+    if { [ishost *-*-mingw*] } {
+        set dir [regsub {^/([a-z])/} $dir {\1:/}]
+    }
     return [file join $dir $basename]
 }
 
--
2.23.0.rc1.153.gdeed80330f-goog

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [testsuite] Make the testsuite work on mingw

Kevin Buettner
On Wed, 14 Aug 2019 18:15:02 -0500
"Christian Biesinger via gdb-patches" <[hidden email]> wrote:

> Dejagnu produces an objdir like /c/, but GDB expects something like c:/.
> So fix it up in lib/gdb.exp.
>
> gdb/testsuite/ChangeLog:
>
> 2019-08-14  Christian Biesinger  <[hidden email]>
>
> * lib/gdb.exp: When running on a mingw target, replace
> /x/ with x:/.

LGTM.

Kevin
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [testsuite] Make the testsuite work on mingw

Pedro Alves-7
In reply to this post by Sourceware - gdb-patches mailing list
On 8/15/19 12:15 AM, Christian Biesinger via gdb-patches wrote:

> Dejagnu produces an objdir like /c/, but GDB expects something like c:/.
> So fix it up in lib/gdb.exp.
>
> gdb/testsuite/ChangeLog:
>
> 2019-08-14  Christian Biesinger  <[hidden email]>
>
> * lib/gdb.exp: When running on a mingw target, replace
> /x/ with x:/.
> ---
>  gdb/testsuite/lib/gdb.exp | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index edc8dfcdfd..af56e8aa12 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -4724,6 +4724,10 @@ proc standard_output_file {basename} {
>  
>      set dir [make_gdb_parallel_path outputs $subdir $gdb_test_file_name]
>      file mkdir $dir
> +    # If running on MinGW, replace /c/foo with c:/foo

OOC, does "on MinGW" mean using a Cygwin or MSYS2 dejagnu?

Or are you really using a native MinGW expect/dejagnu?

> +    if { [ishost *-*-mingw*] } {
> +        set dir [regsub {^/([a-z])/} $dir {\1:/}]
> +    }
>      return [file join $dir $basename]
>  }
>  
>

Thanks,
Pedro Alves
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] [testsuite] Make the testsuite work on mingw

Sourceware - gdb-patches mailing list
On Thu, Aug 15, 2019 at 10:56 AM Pedro Alves <[hidden email]> wrote:

> On 8/15/19 12:15 AM, Christian Biesinger via gdb-patches wrote:
> > Dejagnu produces an objdir like /c/, but GDB expects something like c:/.
> > So fix it up in lib/gdb.exp.
> >
> > gdb/testsuite/ChangeLog:
> >
> > 2019-08-14  Christian Biesinger  <[hidden email]>
> >
> >       * lib/gdb.exp: When running on a mingw target, replace
> >       /x/ with x:/.
> > ---
> >  gdb/testsuite/lib/gdb.exp | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> > index edc8dfcdfd..af56e8aa12 100644
> > --- a/gdb/testsuite/lib/gdb.exp
> > +++ b/gdb/testsuite/lib/gdb.exp
> > @@ -4724,6 +4724,10 @@ proc standard_output_file {basename} {
> >
> >      set dir [make_gdb_parallel_path outputs $subdir $gdb_test_file_name]
> >      file mkdir $dir
> > +    # If running on MinGW, replace /c/foo with c:/foo
>
> OOC, does "on MinGW" mean using a Cygwin or MSYS2 dejagnu?
>
> Or are you really using a native MinGW expect/dejagnu?

This was an MSYS dejagnu. (Hmm, I guess a cygwin one would require a
different patch, to also match and remove /cygdrive... but I'll leave
that to another time)

I pushed this patch.

Christian

> > +    if { [ishost *-*-mingw*] } {
> > +        set dir [regsub {^/([a-z])/} $dir {\1:/}]
> > +    }
> >      return [file join $dir $basename]
> >  }
> >
> >
>
> Thanks,
> Pedro Alves