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: [RFA] dwarf2-frame.c sign extension patch


On Wed, 21 Jul 2004 17:17:23 -0400
Daniel Jacobowitz <drow@false.org> wrote:

> The rest I have no comment on, but this issue I know...
> 
> On Wed, Jul 21, 2004 at 10:29:43PM +0200, Mark Kettenis wrote:
> > 	   (dwarf2_build_frame_info): Set unit.addr_size.
> > 
> > Why is the old code wrong?  The comment clearly says "from unit
> > header" which is what the DWARF standard says (or at least implies).
> > Theoretically it could change from compilation unit to compilation
> > unit.  So I think your change to replace it by
> > TYPE_LENGTH(builtin_type_void_data_ptr) is wrong.
> 
> The old code doesn't do it from the compilation unit header either:
> -  unit.addr_size = objfile->obfd->arch_info->bits_per_address / 8;
> +  unit.addr_size = TYPE_LENGTH (builtin_type_void_data_ptr);
> 
> Any use of bits_per_address, IMO, is a bug.  Take a look at how this
> field is set on MIPS; it's based on the architecture, not the ABI or
> the pointer size or the dwarf address size or anything like that.

I agree.

> TYPE_LENGTH doesn't seem like an ideal replacement.  Can we use the
> value in the compilation unit header here?

I considered doing this, but was told that the information in
.debug_frame should be independent of the CU header.  I really
don't know what the "right" solution is.

Kevin


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