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/RFC] blockframe.c Fix errorneous addr check


>On Thu, Jun 27, 2002 at 09:13:41PM +0400, Andrew Volkov wrote:
>> Hi,
>> 
>> This patch fix wrong detection of belonging addr to startup file:
>> if call main is last instuction in crt0, then 
>> inside_entry_file erroneously return false.
>> 
>> Ok to commit?
>> Andrey 
>> 
>> P.S. Possible this bug not in this func, but in symbol reader.
>
>I'm inclined to believe the bug is in the symbol reader.  Upper PC
>bounds are generally exclusive - first address after the function.
>
>-- 
>Daniel Jacobowitz                           Carnegie Mellon University
>MontaVista Software                         Debian GNU/Linux Developer
>

Daniel you're right, this bug in coffread.c(complete_symtab) function,
rather, in invalid calculating of current_source_end_addr:

	current_source_end_addr = start_addr + size;

but must be:

	current_source_end_addr = start_addr + size + <addr sizeof>;

As I understand, since machine address size is not known at time of parsing 
coff file, then we have big trouble :(.

Comments/suggestions?

Andrey


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