In the language I’m compiling (Java), I’m generating structures which contain a trailing variable-length array, whose length is determined by a member of that structure.
What I can’t figure out is, what magic debug info do I have to provide in order to tell lldb
that the length of the array is determined by the value of the structure member? Right now, lldb refuses to print most of these structures (particularly the ones whose arrays are arrays of i8
) with an error like “error: supposed to interpret, but failed: Interpreter couldn’t read from memory”. I suspect it’s related to the lack of null-termination but it could be something else I suppose.
My IR for the structure which fails to be read is generally something like this:
%"class.[B" = type { i8 ; header
, i8 ; (padding)
, i16 ; (padding)
, i32 ; typeId
, %ref ; monitor
, i32 ; defaultHashCode
, i32 ; length
, [0 x i8] ; content
}
Thanks!