This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch]: Handle addresses via CORE_ADDR in readcoff.c
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 13 Oct 2009 19:38:10 -0700
- Subject: Re: [patch]: Handle addresses via CORE_ADDR in readcoff.c
- References: <90baa01f0910130659q75053d0do88a57aad80427451@mail.gmail.com>
> 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