So I think it's the error of debugger (may be a debugger's bug)
Yes, as I pointed out in my previous post:
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Strings
The Debug info does not contain any info what the low index is.
It is a debugger limitation. If you will a bug, that is known and that cannot be fixed (at current).
This is, why (unless you play with the settings) you get shown 2 values.
-------------------
You actually can get the correct result in the debugger, but you need:
- to use "dwarf3 beta (-gw3)"
- gdb 8.1 (maybe 8.0, not tested with that)
- Probably Lazarus svn trunk (not tested with 1.8.4)
However, using dwarf3 increases the risk of gdb crashing, which means the entire debug session will be stopped and lost.
-------------------
You can also use "fpdebug" (under Tools > Debugger), requires package LazDebuggerFp
For this you need
- Definitely latest Lazarus svn
- Set debugger type to "fpdebug"
- Dwarf3
- Maybe compile with -Xe
- no gdb required
This will show S[ i ] correct, but it will show "s" as an array, instead of as a string.