[Dwarf-discuss] Discussion: string encoding as part of the type (Pascal)

Martin lists@mfriebe.de
Fri Apr 24 10:55:00 GMT 2026


In Pascal (free pascal) the string type (some of them) have an internal 
field (not accessible to user code) that stores the encoding.

That can be an ASCII-page, or utf8, or raw (just bytes as they are)....

For a debugger this info is useful to display the string correctly. A 
debugger would want to convert the string to the encoding used by the 
terminal before printing it).

I am looking for ways how that could be encoded in DWARF?

The first step would be e.g. some attributes to describe the location 
and size of that field.

The 2nd part would be a mapping of the values in that field.

That 2nd part may not need to be part of the encoded DWARF description.
It could be just per language defaults (a debugger would have to know 
the values that each compiler may use).
I.e. I am not sure, but this may be compiler rather than language dependent.

Optional, compliers could add a global list of mapping to pre-defined 
DWARF constants.
That would be some form of list with pairs of
- "compiler encoding value"
- DWARF constant


This may affect the encoding used in the base type for the char.




More information about the Dwarf-discuss mailing list