<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="moz-cite-prefix">Martin,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">The default lower bound is just a default. An array always can just specify the DW_AT_lower_bound if it differs from the language-defined default. In Ada, for example, lower bounds always are explicit. The choice of 1 as its
default was a guess about what coders would be most likely to use. (And probably Ada's similarities to Pascal was a factor.)</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Todd</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 4/19/26 14:03, Martin via Dwarf-discuss wrote:<br>
</div>
<blockquote type="cite" cite="mid:303b865d-01ec-43d9-a3d6-0987670f3acd@mfriebe.de">
<div>A string is a sequence of chars...<br>
And usually a string allows access to those chars by index.<br>
<br>
This index can be 0 or 1 based. If a debugger is asked to evaluate <br>
"MyString[1]" this could be the first or 2nd char.<br>
<br>
It is possible to have defaults per language for this.<br>
But that is not always enough.<br>
<br>
In Pascal the index normally is 1 based.<br>
But compilers like FPC and Delphi support a directive "{$ZEROBASEDSTRINGS}"<br>
<a href="https://gitlab.com/freepascal.org/fpc/documentation/-/work_items/39484" moz-do-not-send="true">https://gitlab.com/freepascal.org/fpc/documentation/-/work_items/39484</a>
<br>
which changes this to 0 based.<br>
<br>
It might be desire-able to add this to DWARF.<br>
<br>
<br>
Also Pascal strings (some of them) are ref-counted and have other fields <br>
(like encoding).<br>
<br>
Ref-count may be something generic (also applies to some arrays). And <br>
may therefore deserve an attribute of its own?<br>
<br>
<br>
<br>
<br>
-- <br>
Dwarf-discuss mailing list<br>
<a class="moz-txt-link-abbreviated" href="mailto:Dwarf-discuss@lists.dwarfstd.org">Dwarf-discuss@lists.dwarfstd.org</a><br>
<a href="https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss" moz-do-not-send="true">https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss</a><br>
</div>
</blockquote>
<p><br>
</p>
</body>
</html>