[Dwarf-discuss] Idea/Question: Add DW_AT_LowerBound to DW_TAG_String
Martin
lists@mfriebe.de
Sun Apr 19 20:03:28 GMT 2026
A string is a sequence of chars...
And usually a string allows access to those chars by index.
This index can be 0 or 1 based. If a debugger is asked to evaluate
"MyString[1]" this could be the first or 2nd char.
It is possible to have defaults per language for this.
But that is not always enough.
In Pascal the index normally is 1 based.
But compilers like FPC and Delphi support a directive "{$ZEROBASEDSTRINGS}"
https://gitlab.com/freepascal.org/fpc/documentation/-/work_items/39484
which changes this to 0 based.
It might be desire-able to add this to DWARF.
Also Pascal strings (some of them) are ref-counted and have other fields
(like encoding).
Ref-count may be something generic (also applies to some arrays). And
may therefore deserve an attribute of its own?
More information about the Dwarf-discuss
mailing list