This is the mail archive of the gdb-patches@sourceware.org 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]: Handle addresses via CORE_ADDR in readcoff.c


> 2009-10-13  Kai Tietz  <kai.tietz@onevision.com>
> 
> 	* coffread.c (coff_symbol): Use for c_value CORE_ADDR to synchronize it
> 	with coff internal definition. Adjusted comment to not exceed 80 character
> 	line size.
> 	(coff_symtab_read): Define fcn_start_addr as CORE_ADDR.

First, a nit: One of the lines in the ChangeLog is exceeding 80 characters.
Second: $@!%$ Microsoft (thank you, sorry, couldn't help myself, I feel
better now).

I'm a little unsure about this patch.  The problem is that the n_value
field is not necessarily an address. The contents of that field is
dependent on the n_type, and could be an offset or even a register number.
I'm concerned that your patch is fixing one warning but introducing the
potential for new warnings in other places where the c_value field
is not used as an address.

However, I don't think we should complexify the code by introducing
a mutable type such as a union in order to be using the right type
everytime, and I don't know really how to best fix this.  I suppose
that CORE_ADDR is better than long, being a larger type that can hold
addresses, offsets, and simple integers.

Please give it another week or so to other people to object to this
patch before you commit.  But this is otherwise approved.

-- 
Joel


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