b) The information len=3 is correct but it is a three dimensional array.
Now you can chose to have either
Test: array [0..2,0..1] of integer;
Len=(3, 2): ((99, 0), (0, 0), (0, 0))
Len=3: (Len=2: (99, 0), Len=2: (0, 0), Len=2: (0, 0))
Len=3: ((99, 0), (0, 0), (0, 0))
((99, 0), (0, 0), (0, 0))
Or, if you have something like
Test2: array [0..2,0..1] of record
Foo: array [0..2,0..1] of integer;
end;
Len=(3, 2):
(((Foo: Len=(3, 2): ((0, 0), (0, 99), (0, 0));), (Foo: Len=(3, 2): ((0, 0), (0, 0), (0, 0));)),
((Foo: Len=(3, 2): ((0, 0), (0, 0), (0, 0));), (Foo: Len=(3, 2): ((0, 0), (0, 0), (0, 0));)),
((Foo: Len=(3, 2): ((0, 0), (0, 0), (0, 0));), (Foo: Len=(3, 2): ((0, 0), (0, 0), (0, 0));))
)
The "multi-dim array len" start for eache multi-dim array.
Now one issue is setting up a default.
The "combined len" will always cover all dimensions.
But in the top example the repeated "Len=2" may be too much, after all it is easily visible that there are just 2 elements. And even worse, for a list of empty arrays.
So, yes you can custom configure that when the data has been retrieved from the debuggee. But that means constant changing.
So I am about to add: "If the innermost array has a length less than <config> then hide the "Len=" header".
Actually even allow hiding for several levels, if overall the element count, and printed text length is below configurable limits.
Similar for line-breaks.
You may normally want each item in an array (or field in struct) to be on its own line. Except if you have "array of integer".
Or maybe, also not if you have "array of array of TPoint. The inner list op points could be on a single line?
Configurable, but such that a default can have criteria when to go which way.
Test3: array [0..3,0..5] of TPoint;
Len=(4, 6):
(((x: 99;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;)),
((x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;)),
((x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;)),
((x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;), (x: 0;y: 0;))
)
So currently I am thinking of the following options to configure how the debugger decides.The simple form is to just say
- Multi dim array len : Always covers the entire depth.
- Cover N-levels: Covers the outer most N levels (of each individual multi-dim array / i.e. "Test2" restarts counting for "Foo".
And for multiline:
- For the outer N levels display each entry on a new line (level can be array, or structure) (pointer may increase the level, even though it does not add linebreaks)
In both cases there will be similar "rules" to hide the len or go single-line, if the data is "simple enough". Those rules can for example be used to setup defaults.
Array
- Only if more than N levels depth (per multi dim array)
- Only if the array at the current level has a LEN < N
- Only if each element is either "simple" or has less than N simple value (e.g in fields or arrays)
- Only if each value as text is shorter than N chars
Multi line
- Only if within the N innermost levels
- Only if less than N fields for struct
- Only if less than N Len for array (this may not be applied to the innermost array in all cases, since an "array of integer" probably does not need this)
- Only if each element is either "simple" or has less than N simple value (e.g in fields or arrays)
- Only if each value as text is shorter than N chars