Re: PATCH: Problem union comparision in TUI

Andrew STUBBS
2005-10-20T16:20:04Z

Andrew Stubbs wrote:
> Eli Zaretskii wrote:
>> Yes, I've read the code before I replied, so I know all that already.
>> Having read the code, I'm not sure that addresses are used only for
>> disassembly windows and line numbers only for source windows. We
>> could have more bugs; that's why I think cleaning the code is
>> important.
>
>
> Indeed, it isn't as simple as addresses for assembly and lines for
> sources. That's what the original problem was - i686-pc-linux-gnu native
> uses one and sh-elf cross (also running on i686-pc-linux-gnu) uses the
> other while both are supposedly running the same simple program .

Apologies, please ignore this. I have just done some experiments to try
to understand this better.

It would appear that both are using line numbers for the source window.
The difference is that, for reasons unknown, sh-elf has a 64 bit
CORE_ADDR, but i686-pc-linux-gnu has a 32 bit CORE_ADDR. line_no remains
32 bit on both platforms. Hence I only see the problem on targets with
mismatched types, and then only when random data manages to find its way
into the unused half of the union.

Therefore, an alternative fix for this problem would be to figure out
which window we are in for the problem comparison. I an not sure whether
that would be a better solution or not.

Sorry for the confusion.

Andrew Stubbs