<div dir="ltr">What sort of string-like behavior would one want on a bit-string? Seems like array would be the better fit to me... </div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Dec 18, 2024 at 9:03 AM pogo 59 via Dwarf-discuss <<a href="mailto:dwarf-discuss@lists.dwarfstd.org">dwarf-discuss@lists.dwarfstd.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">My first thought would be that DW_TAG_string_type with a one-bit base type, but it's not clear that the other attributes would be interpreted in a way that correctly navigated the bit string. You could try using DW_TAG_packed_type pointing to a DW_TAG_string_type, in the hopes that consumers would figure out that it was a "packed" string of bits, and that the element stride and sizes should be bits. I believe Pascal would describe "packed array of boolean" that way, or however Pascal spells that type.<div><br></div><div>If that doesn't pan out, DW_TAG_array_type can certainly describe bit-sized elements, with DW_AT_bit_stride of 1. This might not get you string-like semantics in the consumer, but it would describe the data accurately.</div><div>--paulr</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 18, 2024 at 8:50 AM Thomas David Rivers via Dwarf-discuss <<a href="mailto:dwarf-discuss@lists.dwarfstd.org" target="_blank">dwarf-discuss@lists.dwarfstd.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
PL/I has the concept of a "string", which can be a fixed-length<br>
(possibly not known at compile time), or a fixed size with a 4-byte or 2-byte<br>
runtime length prefix, or, depending on the consituents, a NULL (zero-byte)<br>
terminated string.<br>
<br>
For "character-like" strings, the constituents can be 1-byte, 2-byte,<br>
4-byte strings, or UTF-8 values.  (e.g. strings of characters, or strings<br>
of UTF-8 values, or strings of 4-byte unicode values.)<br>
<br>
All of these seem to be straightforwardly handled by DWARF-5.<br>
<br>
However, PL/I also has a "BIT string", which is a left-adjusted string<br>
of bits, either of a fixed length (# of bits) or of a fixed size<br>
with a either a 2-byte or 4-byte length prefix. Of course, there isn't<br>
a NULL-terminated variant of this string, because a zero-bit is part of<br>
the data.  The sizes may not be known at compile time.<br>
<br>
I've gone thru the DWARF-5 standard a few times, but can't seem to<br>
envision a straight-forward way to represent this.<br>
<br>
Furthermore, an un-prefixed bit-string doesn't necessarily begin <br>
on a byte boundary, and, depending on the environment, needs to<br>
be represented as a bit-offset which may be composed (even at runtime)<br>
of (byte-location + bit-offset-in-byte).<br>
<br>
Any suggestions on how to represent this in DWARF (5 or later) would<br>
be appreciated!   Perhaps it's just something obvious I'm overlooking??<br>
<br>
        - Many Thanks! -<br>
        - Dave Rivers <br>
<br>
--<br>
<a href="mailto:rivers@dignus.com" target="_blank">rivers@dignus.com</a> <br>
-- <br>
Dwarf-discuss mailing list<br>
<a href="mailto:Dwarf-discuss@lists.dwarfstd.org" target="_blank">Dwarf-discuss@lists.dwarfstd.org</a><br>
<a href="https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss" rel="noreferrer" target="_blank">https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss</a><br>
</blockquote></div>
-- <br>
Dwarf-discuss mailing list<br>
<a href="mailto:Dwarf-discuss@lists.dwarfstd.org" target="_blank">Dwarf-discuss@lists.dwarfstd.org</a><br>
<a href="https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss" rel="noreferrer" target="_blank">https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss</a><br>
</blockquote></div>