[Dwarf-discuss] bit-string
Thomas David Rivers
rivers@dignus.com
Wed Dec 18 13:50:08 GMT 2024
PL/I has the concept of a "string", which can be a fixed-length
(possibly not known at compile time), or a fixed size with a 4-byte or 2-byte
runtime length prefix, or, depending on the consituents, a NULL (zero-byte)
terminated string.
For "character-like" strings, the constituents can be 1-byte, 2-byte,
4-byte strings, or UTF-8 values. (e.g. strings of characters, or strings
of UTF-8 values, or strings of 4-byte unicode values.)
All of these seem to be straightforwardly handled by DWARF-5.
However, PL/I also has a "BIT string", which is a left-adjusted string
of bits, either of a fixed length (# of bits) or of a fixed size
with a either a 2-byte or 4-byte length prefix. Of course, there isn't
a NULL-terminated variant of this string, because a zero-bit is part of
the data. The sizes may not be known at compile time.
I've gone thru the DWARF-5 standard a few times, but can't seem to
envision a straight-forward way to represent this.
Furthermore, an un-prefixed bit-string doesn't necessarily begin
on a byte boundary, and, depending on the environment, needs to
be represented as a bit-offset which may be composed (even at runtime)
of (byte-location + bit-offset-in-byte).
Any suggestions on how to represent this in DWARF (5 or later) would
be appreciated! Perhaps it's just something obvious I'm overlooking??
- Many Thanks! -
- Dave Rivers
--
rivers@dignus.com
More information about the Dwarf-discuss
mailing list