Editor hint.
a) Why is a horizontal scroll bar displayed?
Very good question. Ignoring that the overall presentation could/should be improved, currently IIRC the debugger prints this as ONE single line.
The IDE hint (not currently controlled by the debugger) should do the wrapping (or keep all in one line).
In any case, having wrapping and scrolling => wrong. (bug report please, if you can)
EDIT: scrap that.
The debugger is wrapping, for each sub-array.
The hint does not have word-wrap, so it adds a scrollbar.
This will eventually have to be changed, but at the moment there are 2 independent stages.
1) the debugger create a string (with line breaks). The debugger is not aware of where or how this string will be printed (it only gets told, that the target supports multi-line / but has no idea how long a line can be)
2) The hint prints that string. (same in the eval/mod window)
b) The information len=3 is correct but it is a three dimensional array.
Ok....
However, in general each nested array can have a different length.
So the first step would be to have a length in front of each nested (and sub nested) array
Len: 3 (Len: 10 (1,2o3...), Len:15 (.....
As an optimization, if all nested arrays have the same length, that could be pulled up to the top level.
That however only works if the length of the top level is within certain limits.
As you can see, if there are to many elements in an array, not all of them are fetched => and then any non-fetched could still have a different length.
(there are settings in Tools > options > debugger backend -> how many entries to fetch)
For static arrays, it should always be detectable.
Evaluate/Modify window Perfect useful display of the array information by entering img[1,4..9,6..9]
c) Why not a horizontal scrollbar?
Would a word-wrap checkbox be enough?
There are cases where people may want wordwrap. "array [1..99] of string;" (very long strings)
Watches window
d) Adding img[1,4..9,6..9] to the Watches didn't work.
Please create a bug report for that. Thanks.
As a workaround: x[1][4..9][6..9]
--- EDIT ---> Hopefully fixed in 3.99 (decision on merging to 3.4 still outstanding)
e) Would personally prefer the Evaluate/Modify behavior/format to be copied to the Watches. The Watches display of arrays look smart but to me less useful then the displayed format in Evaluate/Modify window.
The watches Window has an "inspect pane" (but only one watch at a time".
The idea for the watches window is to default to single line representation, unless the user expands that.
Would I be right to assume, you want the "multiline text" from eval/mod shown in watches, if you press the [ + ]?
If so, how many lines of text? (I mean an array [1..9999] would display a very large field, and all other watches below, would be hard to reach.
Keep in mind, that this is not only a display change.The current expansion creates a new watch for each (displayed) entry of the array.
- In case of nested data, the new watch goes one level deeper than its parent.
- You can drag/drop individual entries from that list to become a new watch at top level. So if you are interested in "yourarray[7]" you drop that outside the expanded list, and it stays visible when you collapse the list.
Outside this topic, but I would like have the possibility to enter in the Evaluate/Modify and Watches expressions like sin(x), pi, ord('A').
An intrinsic
https://wiki.freepascal.org/FpDebug-Watches-Intrinsic-Functions for ord seems plausible (even though you can do "byte('A')" already.
sin/pi => maybe... (mind as intrinsics they need the prefix, or if you switch that off, then they hide the real functions (if your rtl has debug info)
You can add a feature request to the bug tracker.
I added 2 of your points to the list. word-wrap awaits feedback. The rest is for the bug tracker, please. (if word wrap is ok, you may also report that as feature request)