[00/03] per-aspace target_gdbarch (+local gdbarch obsoletion?)

Jan Kratochvil jan.kratochvil@redhat.com
Mon Feb 8 22:36:00 GMT 2010


Hi Ulrich,

thanks for the reply, my sorry for my late reply.


On Wed, 20 Jan 2010 09:54:53 +0100, Ulrich Weigand wrote:
[gdbarch]
> Maybe at some point we should really split
> this up into two different data structures ...

That is a very nice idea when I see the differentiaton now.


> > This patchset is required for PIE but only in biarch (64bit debugger -> 32bit
> > inferior) or just for 32bit host built with --enable-64-bit-bfd mode.
> 
> It seems to me there's something else going on.  Maybe the underlying problem
> your patch set is trying to solve can be handled elsewhere?
[...]
> Wouldn't it be more natural to force a canonical representation at
> the time the address is *determined* in the first place?  This may
> have the advantage that you may still have the required information
> at this place, e.g. while relocating an objfile due to PIE, you know
> the objfile's architecture and hence know which mask needs to be
> applied ...

This should match the opinion of Daniel Jacobowitz:
	Re: [patch] Cut memory address width
	http://sourceware.org/ml/gdb-patches/2006-09/msg00197.html

One related patch (stripping down the address width):
	Re: [patch] Fix i386 memory-by-register access on amd64
	http://sourceware.org/ml/gdb-patches/2009-07/msg00371.html


As there already exist many cases in the code containing:
  int addr_bit = gdbarch_addr_bit (gdbarch);
  if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
    address &= ((CORE_ADDR) 1 << addr_bit) - 1;

the question is whether these scattered code snippets should be:
(A) left as is (stripping address width)
(B) changed to gdb_assert (that upper bits are zeroed)
(C) code removed (keeping full address width);
    with warning() for external sources - from gdbserver

I will submit (C) (after I finish it).


Thanks,
Jan



More information about the Gdb-patches mailing list