diff options
author | Maciej W. Rozycki <macro@embecosm.com> | 2022-01-19 21:55:10 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@embecosm.com> | 2022-01-19 21:55:10 +0000 |
commit | 5d4c63a635546c77bfa7ebabf944cb1d93f5c6fe (patch) | |
tree | 24578c89a2818792cb8ded824abc1118d26edfc7 /gdb/f-lang.h | |
parent | 6b4338c868e96a549af44fdf17141f4eac77e225 (diff) | |
download | gdb-5d4c63a635546c77bfa7ebabf944cb1d93f5c6fe.zip gdb-5d4c63a635546c77bfa7ebabf944cb1d93f5c6fe.tar.gz gdb-5d4c63a635546c77bfa7ebabf944cb1d93f5c6fe.tar.bz2 |
Respect `set print array-indexes' with Fortran arrays
Add `set print array-indexes' handling for Fortran arrays. Currently
the setting is ignored and indices are never shown.
Keep track of the most recent index handled so that any outstanding
repeated elements printed when the limit set by `set print elements' is
hit have the correct index shown.
Output now looks like:
(gdb) set print array-indexes on
(gdb) print array_1d
$1 = ((-2) = 1, (-1) = 1, (0) = 1, (1) = 1, (2) = 1)
(gdb) set print repeats 4
(gdb) set print elements 12
(gdb) print array_2d
$2 = ((-2) = ((-2) = 2, <repeats 5 times>) (-1) = ((-2) = 2, <repeats 5 times>) (0) = ((-2) = 2, (-1) = 2, ...) ...)
(gdb)
for a 5-element vector and a 5 by 5 array filled with the value of 2.
Diffstat (limited to 'gdb/f-lang.h')
-rw-r--r-- | gdb/f-lang.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/f-lang.h b/gdb/f-lang.h index 26b2c09..11debd5 100644 --- a/gdb/f-lang.h +++ b/gdb/f-lang.h @@ -59,6 +59,12 @@ public: } /* See language.h. */ + void print_array_index (struct type *index_type, + LONGEST index, + struct ui_file *stream, + const value_print_options *options) const override; + + /* See language.h. */ void language_arch_info (struct gdbarch *gdbarch, struct language_arch_info *lai) const override; |