Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: drow@false.org (Daniel Jacobowitz)
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc] dwarf2 unwinder and MIPS n32
Date: Sat, 28 Apr 2007 22:52:00 -0000	[thread overview]
Message-ID: <200704282240.l3SMefEh024381@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20070428202914.GA8077@caradoc.them.org> from "Daniel Jacobowitz" at Apr 28, 2007 04:29:14 PM

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


  reply	other threads:[~2007-04-28 22:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-28 20:42 Daniel Jacobowitz
2007-04-28 22:52 ` Ulrich Weigand [this message]
2007-04-30 13:28   ` Daniel Jacobowitz
2007-04-30 20:19     ` Ulrich Weigand
2007-05-14 17:22       ` Daniel Jacobowitz
2007-04-30 13:00 ` Maciej W. Rozycki
2007-04-30 13:26   ` Daniel Jacobowitz
2007-04-30 13:44     ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200704282240.l3SMefEh024381@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox