On Sun, 2010-05-16 at 14:04 +0200, Jonas Maebe wrote: > On 15 May 2010, at 23:44, Jan Kratochvil wrote: > > > But if the "allocation" is just an internal > > compiler issue which should be hidden by the same compiler at the DWARF level. > > Therefore I would guess to use some: > > drop DW_TAG_array_type -> DW_AT_allocated > > DW_TAG_subrange_type -> DW_AT_upper_bound: > > DW_OP_push_object_address > > DW_OP_deref > > DW_OP_dup > > DW_OP_bra allocated > > DW_OP_lit0 > > DW_OP_skip end > > allocated: > > DW_OP_lit8 > > DW_OP_minus > > DW_OP_deref > > end: > > I agree. Joost, I've attached a patch for FPC's DWARF writer to fix it. I can't test whether it works (the dumped DWARF info looks ok though), because I can't get gdb/F-13 to build: It doesn't work. That's because type_length_get() (gdbtypes.c) does not return 0 when the high and low-bound are equal to each other. Instead it returns the element-size. Then allocate_value_lazy tries to read element-size bytes from the base-address (being 0x0) -> av. I think that type_length_get() not returning 0 is a bug, (also because there is a comment in the function that some part of the code doesn't handle count=0 right. But I think that should be count=1) but it could be that it's on purpose for Fortran. Jan, can you comment on this? There's also a second problem. The lower bound is 1 for strings. With Jonas' patch for fpc the upper bound of strings is 0 when not allocated. Leading to a size of -1. An easy fix, new patch is attached. Joost.