diff options
author | Jim Blandy <jimb@codesourcery.com> | 2004-08-25 15:41:54 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2004-08-25 15:41:54 +0000 |
commit | e6742ace8b317c9fa9b115d6623bd9369b1b9cd0 (patch) | |
tree | e280fac5dcf057748a5cb466eced8764646e5f3b /gdb | |
parent | b04e311dda777ef0f0cd926139e89ba8f2a46c38 (diff) | |
download | gdb-e6742ace8b317c9fa9b115d6623bd9369b1b9cd0.zip gdb-e6742ace8b317c9fa9b115d6623bd9369b1b9cd0.tar.gz gdb-e6742ace8b317c9fa9b115d6623bd9369b1b9cd0.tar.bz2 |
* gdbtypes.h (TYPE_CODE_ARRAY): Doc fix.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/gdbtypes.h | 22 |
2 files changed, 25 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 90ebbe5..7decaad 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2004-08-25 Jim Blandy <jimb@redhat.com> + + * gdbtypes.h (TYPE_CODE_ARRAY): Doc fix. + 2004-08-25 Andrew Cagney <cagney@gnu.org> * infrun.c (struct execution_control_state): Delete field diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 3f90f6c..4f95e13 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -82,7 +82,27 @@ enum type_code { TYPE_CODE_UNDEF, /* Not used; catches errors */ TYPE_CODE_PTR, /* Pointer type */ - TYPE_CODE_ARRAY, /* Array type with lower & upper bounds. */ + + /* Array type with lower & upper bounds. + + Regardless of the language, GDB represents multidimensional + array types the way C does: as arrays of arrays. So an + instance of a GDB array type T can always be seen as a series + of instances of TYPE_TARGET_TYPE (T) laid out sequentially in + memory. + + Row-major languages like C lay out multi-dimensional arrays so + that incrementing the rightmost index in a subscripting + expression results in the smallest change in the address of the + element referred to. Column-major languages like Fortran lay + them out so that incrementing the leftmost index results in the + smallest change. + + This means that, in column-major languages, working our way + from type to target type corresponds to working through indices + from right to left, not left to right. */ + TYPE_CODE_ARRAY, + TYPE_CODE_STRUCT, /* C struct or Pascal record */ TYPE_CODE_UNION, /* C union or Pascal variant part */ TYPE_CODE_ENUM, /* Enumeration type */ |