Re: DW_AT_count is the same as DW_AT_upper_bound?

Jan Kratochvil
2013-07-05T19:08:56Z

On Fri, 05 Jul 2013 20:41:02 +0200, Rouslan Korneychuk wrote:
> I'm using DW_AT_count instead of DW_AT_upper_bound so that "stack" can
> be empty (have 0 elements), but these two attributes appear to be
> treated the same. Is this a bug or am I misunderstanding something? I'm
> using GDB version 7.5.1.

DW_AT_upper_bound vs. DW_AT_count is described in DWARF-4:
The DW_AT_upper_bound attribute may be replaced by a DW_AT_count
attribute, whose value describes the number of elements in the
subrange rather than the value of the last element.

But your sample DWARF is a case of dynamic bounds which are supported only in
experimental branch(es) so far:
http://sourceware.org/gdb/wiki/FortranVLA
particularly the branch jankratochvil/vla of git://sourceware.org/git/archer.git

Jan