Re: [PATCHv4 3/3] gdb/fortran: Add support for Fortran array slices at the GDB prompt

Eli Zaretskii via Gdb-patches
2020-09-28T09:53:12Z

> From: Andrew Burgess <andrew.burgess@embecosm.com>
> Date: Mon, 28 Sep 2020 10:40:49 +0100
>
> gdb/ChangeLog:
>
> * Makefile.in (HFILES_NO_SRCDIR): Add f-array-walker.h.
> * NEWS: Mention new options.
> * expprint.c (dump_subexp_body_standard): Print RANGE_HAS_STRIDE.
> * expression.h (enum range_type): Add RANGE_HAS_STRIDE.
> * f-array-walker.h: New file.
> * f-exp.y (arglist): Allow for a series of subranges.
> (subrange): Add cases for subranges with strides.
> * f-lang.c: Include 'gdbcmd.h' and 'f-array-walker.h'.
> (repack_array_slices): New static global.
> (show_repack_array_slices): New function.
> (fortran_array_slicing_debug): New static global.
> (show_fortran_array_slicing_debug): New function.
> (value_f90_subarray): Delete.
> (skip_undetermined_arglist): Delete.
> (class fortran_array_repacker_base_impl): New class.
> (class fortran_lazy_array_repacker_impl): New class.
> (class fortran_array_repacker_impl): New class.
> (fortran_value_subarray): Complete rewrite.
> (set_fortran_list): New static global.
> (show_fortran_list): Likewise.
> (_initialize_f_language): Register new commands.
> (fortran_adjust_dynamic_array_base_address_hack): New function.
> * f-lang.h (fortran_adjust_dynamic_array_base_address_hack):
> Declare.
> * f-valprint.c: Include 'f-array-walker.h'.
> (class fortran_array_printer_impl): New class.
> (f77_print_array_1): Delete.
> (f77_print_array): Delete.
> (fortran_print_array): New.
> (f_value_print_inner): Update to call fortran_print_array.
> * gdbtypes.c: Include 'f-lang.h'.
> (resolve_dynamic_type_internal): Call
> fortran_adjust_dynamic_array_base_address_hack.
> * parse.c (operator_length_standard): Handle RANGE_HAS_STRIDE.
>
> gdb/testsuite/ChangeLog:
>
> * gdb.fortran/array-slices-bad.exp: New file.
> * gdb.fortran/array-slices-bad.f90: New file.
> * gdb.fortran/array-slices-sub-slices.exp: New file.
> * gdb.fortran/array-slices-sub-slices.f90: New file.
> * gdb.fortran/array-slices.exp: Rewrite tests.
> * gdb.fortran/array-slices.f90: Rewrite tests.
> * gdb.fortran/vla-sizeof.exp: Correct expected results.
>
> gdb/doc/ChangeLog:
>
> * gdb.texinfo (Debugging Output): Document 'set/show debug
> fotran-array-slicing'.
> (Special Fortran Commands): Document 'set/show fortran
> repack-array-slices'.

OK for the documentation parts.

Thanks.