This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
RE: [RFA/RFC] blockframe.c Fix errorneous addr check
- From: Andrew Volkov <Andrew dot Volkov at transas dot com>
- To: Kevin Buettner <kevinb at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 28 Jun 2002 12:41:48 +0400
- Subject: RE: [RFA/RFC] blockframe.c Fix errorneous addr check
>On Jun 27, 10:58pm, Andrew Volkov wrote:
>
>> >> 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 :(.
>> >
>> >Could you explain why you need to add in the size of an address?
>>
>> It's not necessarily must be addr sizeof, it may be 1, but, I think,
>> will be better, if current_source_end_addr will contain correct
>> value for target.
>
>What I'd like to understand is why (start_addr + size) is insufficient.
>I.e, why do we need to add 1 or some other small value to compute the
>correct ending address?
>
>Kevin
Because start_addr + size is last_addr in block, hence all gdb parts, wich
assume that highpc is first addr after block, will work improperly.
Ex. this check always failed:
if (addr >= lowpc && addr < highpc)
....
when addr = last_addr_in_block.
While I bump with this problem when work with h8300 coff file.
Andrey