This is the mail archive of the gdb-patches@sourceware.org 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: [rfc] dwarf2 unwinder and MIPS n32


Daniel Jacobowitz wrote:

> So what do we do about it?  The patch below works for MIPS, but I'm
> reasonably sure it's wrong; it avoids the architecture's
> ADDRESS_TO_POINTER method entirely.  If we pass the register's type to
> store_typed_address we'll get various failures if the architecture
> doesn't define the relevant register as a pointer.  And MIPS doesn't,
> partly because the register is 64-bit and the pointer would only be
> 32-bit.

Well, when we *read* a register in order to get (or compute) the CFA,
read_reg does

  unpack_long (register_type (gdbarch, regnum), buf)

which in turn uses either extract_type_address, extract_signed_integer,
or extract_unsigned_integer, depending on the type.

It may make sense to perform the analogous operation when *writing*
the CFA to (an unwound copy of the contents of) a register.  There
is no "pack_long", but something like

  memcpy (buf, value_contents
		 (value_from_longest (register_type (gdbarch, regnum), cfa)),
	       register_size (gdbarch, regnum));

should have that effect.

Not sure if that is the right thing to do in all cases, but at least
it would be consistent ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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