DWARF output, type of char[]?
Cristian Vlasceanu
cristian at zero-bugs.com
Tue Apr 3 09:53:18 PDT 2007
BCS wrote:
> Cristian Vlasceanu wrote:
>> BCS Wrote:
>>
>>
>>> Reply to Cristian,
>>>
>>>
>>>> What is the DWARF type of char[], as output by the DMD backend?
>>>
>>> The expression that gets the content of a char[] as something gdb can
>>> read is several inches long.
>>>
>>
>> I am not sure that I understand this? Is there is a way of
>> transforming the unsigned long long into something meaningful?
>>
>
> yes
>
> given T[] arr;
>
> the contents are: *(cast(T*)(cast(void*)(&arr)[1])
> the length is: *cast(size_t*)(&arr)
>
> and that's if I remember correctly. It's ugly and messy and a total pain
> in the whatever. But it works.
>
> However if an array of type T[] were to claim to be
>
> struct
> {
> T* ptr;
> size_t length;
> }
>
> or something close to that, then you could access it almost as normal.
>
I do not know enough D, but is there "unsigned long long" an otherwise
legal D type? Because if (as I supsect) it isn't, and it can be
unequivocally determined that it stands for a char[] whenever the
translation unit's language is D, I could easily make it work in Zero.
Out of the box.
More information about the Digitalmars-d-debugger
mailing list