Re: Variable Length Arrays (VLA) proposal

Chris January <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <1372665705.3234.3.camel@gumtree>
On Sun, 2013-06-30 at 18:54 -0700, Joel Brobecker wrote:
> > Just to add another possibility, we implemented VLA for Fortran by
> > wrapping read_var_value and then adding a call to f_fixup_value which
> > 'fixed up' the type of the variable (filled in the array bounds, etc.)
> > by modifying the original type. (It also auto-dereferences pointers).
> 
> One of the questions that need to be asked is whether it's OK to modify
> the type in place like that. For Ada, we create new types with the
> bounds fixed-up. I think you might run into problems with cached
> values, such as the values accessible from the history (Eg: "print $2").

Do you mean in this scenario (excuse the mixed Fortran / GDB commands)?

ALLOCATE(array(10, 10))
(gdb) print array
$1 = (...)
DEALLOCATE(array)
ALLOCATE(array(20,20))
(gdb) print $1

Then no, modifying the original type does not work in that case (it
breaks $1 as you say).

Chris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.