This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Start Fortran support for variable objects.


Hi, Nick and Daniel

I have two comments below, hope that they might be helpful.  Thanks.

On Fri, 1 Jul 2005, Nick Roberts wrote:

> As in the patch below?  I don't understand the extra cases it appears to
> cover, but it worked for the tests I tried.

Maybe it is also helpful to test against such arrays definition as:
  
  integer array(0:5), integer array(-1:4)

or even
  
  integer array(0:5,-1:4)

(if variable object does support multi-dimension array. I don't know much 
about variable object, and MI as a whole.)

The second comment is about the following text in a former mail Nick sent: 

> 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}}

For Fortran array such as DIMENSION I(4), the lower bound should be 1 by
default.  The following session on my box shows this:

<top-gdb> p type->main_type->fields->type->main_type->fields[0].loc.bitpos
$3 = 1
<top-gdb> p type->main_type->fields->type->main_type->fields[1].loc.bitpos
$4 = 4

I guess there might be some errors in the process of creating varobj for 
Fortran array.  

Anyway it is just my guess.  If the patch works ok with different kinds of 
array definitions, it should be okay.  

Cheers
- Wu Zhou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]