This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: PATCH: Start Fortran support for variable objects.
Daniel Jacobowitz writes:
> On Thu, Jun 30, 2005 at 09:29:16AM +1200, Nick Roberts wrote:
> >
> > This patch adjusts the offset from 0 to 1 to allow the display of arrays
> > in Fortran using variable objects.
>
> I see that you're hardcoding this based on language. Can we do it
> based on type instead? Specifically, TYPE_LOW_BOUND and
> TYPE_HIGH_BOUND. We have got type information here - unless I'm
> misreading, var->type should be the type of the array.
They look pretty similar to me.
C:
(top-gdb) p TYPE_LOW_BOUND(var->type)
$18 = 0
(top-gdb) p* var->type->main_type
$33 = {code = TYPE_CODE_ARRAY, upper_bound_type = BOUND_SIMPLE,
lower_bound_type = BOUND_SIMPLE, name = 0x0, tag_name = 0x0,
objfile = 0x8357618, target_type = 0x8372c74, flags = 0, nfields = 1,
vptr_fieldno = -1, fields = 0x837496c, vptr_basetype = 0x0, type_specific = {
cplus_stuff = 0x0, floatformat = 0x0}}
Fortran:
(top-gdb) p TYPE_LOW_BOUND(var->type)
$3 = 0
(top-gdb) p* var->type->main_type
$8 = {code = TYPE_CODE_ARRAY, upper_bound_type = BOUND_SIMPLE,
lower_bound_type = BOUND_SIMPLE, name = 0x0, tag_name = 0x0,
objfile = 0x8357618, target_type = 0x83654cc, flags = 0, nfields = 1,
vptr_fieldno = -1, fields = 0x83655c4, vptr_basetype = 0x0,
type_specific = {cplus_stuff = 0x0, floatformat = 0x0}}
I need more of a clue to follow your suggestion.
> I'm not thrilled with the existing language-dependent behavior in
> varobj; we have got a common type system, after all.
At the moment, I'm finding it hard enough to just work with whats already
there. Maybe later on I'll be able to step up another gear.
Nick