[PATCH] gdb/fortran: Allow Flang MAIN_ in Fortran testing

Sharma, Alok Kumar AlokKumar.Sharma@amd.com
Fri Apr 24 15:54:15 GMT 2020


Thanks a lot Tom and Andrew for your reviews.

Please find the updated patch as an attachment. 
Now fortran specific runto_main is renamed as fortran_runto_main, which is inline with the other such procedures as go_runto_main etc.

    gdb/testsuite/ChangeLog

            * lib/fortran.exp (fortran_main): New Proc, handle flang MAIN_,
            (fortran_runto_main): New Proc, fortran version of runto_main.
            * gdb.fortran/array-bounds-high.exp: Handle flang MAIN_.
            * gdb.fortran/array-bounds.exp: Likewise.
            * gdb.fortran/array-slices.exp: Likewise.
            * gdb.fortran/block-data.exp: Likewise.
            * gdb.fortran/charset.exp: Likewise.
            * gdb.fortran/common-block.exp: Likewise.
            * gdb.fortran/complex.exp: Likewise.
            * gdb.fortran/derived-type-function.exp: Likewise.
            * gdb.fortran/derived-type.exp: Likewise.
            * gdb.fortran/info-modules.exp: Likewise.
            * gdb.fortran/info-types.exp: Likewise.
            * gdb.fortran/intrinsics.exp: Likewise.
            * gdb.fortran/library-module.exp: Likewise.
            * gdb.fortran/logical.exp: Likewise.
            * gdb.fortran/max-depth.exp: Likewise.
            * gdb.fortran/module.exp: Likewise.
            * gdb.fortran/multi-dim.exp: Likewise.
            * gdb.fortran/nested-funcs.exp: Likewise.
            * gdb.fortran/print-formatted.exp: Likewise.
            * gdb.fortran/print_type.exp: Likewise.
            * gdb.fortran/printing-types.exp: Likewise.
            * gdb.fortran/ptr-indentation.exp: Likewise.
            * gdb.fortran/ptype-on-functions.exp: Likewise.
            * gdb.fortran/subarray.exp: Likewise.
            * gdb.fortran/vla-alloc-assoc.exp: Likewise.
            * gdb.fortran/vla-datatypes.exp: Likewise.
            * gdb.fortran/vla-history.exp: Likewise.
            * gdb.fortran/vla-ptr-info.exp: Likewise.
            * gdb.fortran/vla-ptype-sub.exp: Likewise.
            * gdb.fortran/vla-ptype.exp: Likewise.
            * gdb.fortran/vla-sizeof.exp: Likewise.
            * gdb.fortran/vla-type.exp: Likewise.
            * gdb.fortran/vla-value-sub-arbitrary.exp: Likewise.
            * gdb.fortran/vla-value-sub-finish.exp: Likewise.
            * gdb.fortran/vla-value-sub.exp: Likewise.
            * gdb.fortran/vla-value.exp: Likewise.
            * gdb.fortran/whatis_type.exp: Likewise.
            * gdb.mi/mi-var-child-f.exp: Likewise.

Please let me know your comments.

Regards,
Alok

-----Original Message-----
From: Andrew Burgess <andrew.burgess@embecosm.com> 
Sent: Friday, April 24, 2020 7:08 PM
To: Tom Tromey <tom@tromey.com>
Cc: Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; George, Jini Susan <JiniSusan.George@amd.com>; Achra, Nitika <Nitika.Achra@amd.com>; gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/fortran: Allow Flang MAIN_ in Fortran testing

[CAUTION: External Email]

* Tom Tromey <tom@tromey.com> [2020-04-24 06:56:13 -0600]:

> >>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:
>
> Andrew> And my main thought is that what we should do is override 
> Andrew> runto_main in lib/fortran.exp, and then switch all of the test 
> Andrew> over to using that instead, this would be more consistent with 
> Andrew> how the C/C++ tests work then.
>
> Redefining procs is a bit dangerous because it can change the test 
> environment for subsequent tests, which may not be Fortran tests.  I'm 
> not sure if that's what you were proposing but I figured I'd point it 
> out just in case.

OK, that's a valid point.

Maybe we should just make 'proc runto_main' smarter then?  Add some logic to pick a suitable name for the main function per-language?

Or maybe we should do 'proc fortran_runto_main' .... ?

I'd just like something that's more inline with the existing 'runto_main' in style I think..

Thanks,
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gdb-fortran-Allow-Flang-MAIN_-in-Fortran-testing.patch
Type: application/octet-stream
Size: 29869 bytes
Desc: 0001-gdb-fortran-Allow-Flang-MAIN_-in-Fortran-testing.patch
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20200424/a12e3c1f/attachment-0001.obj>


More information about the Gdb-patches mailing list