Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: "Martin M. Hunt" <hunt@redhat.com>
Cc: Andrew Cagney <cagney@gnu.org>, Mark Kettenis <kettenis@gnu.org>,
	gdb@sources.redhat.com
Subject: Re: dwarf2-frame.c question for maintainers
Date: Fri, 16 Jul 2004 21:16:00 -0000	[thread overview]
Message-ID: <vt2zn5zzpn1.fsf@zenia.home> (raw)
In-Reply-To: <1089917359.3028.26.camel@dragon>


Here is a terse way to extract the least-significant end of the
register's value, regardless of endianness.

*** dwarf2-frame.c.~1.36.~	2004-06-17 16:42:41.000000000 -0500
--- dwarf2-frame.c	2004-07-16 14:57:09.000000000 -0500
*************** read_reg (void *baton, int reg)
*** 214,219 ****
--- 214,222 ----
  
    buf = (char *) alloca (register_size (gdbarch, regnum));
    frame_unwind_register (next_frame, regnum, buf);
+   store_unsigned_integer
+     (buf, TYPE_LENGTH (builtin_type_void_data_ptr),
+      extract_unsigned_integer (buf, register_size (gdbarch, regnum)));
    return extract_typed_address (buf, builtin_type_void_data_ptr);
  }

Shouldn't that work?  (Setting aside questions of whether it's
pleasing to extract, store, and then re-extract the value.)


      reply	other threads:[~2004-07-16 20:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-13 22:01 Martin M. Hunt
2004-07-14 17:29 ` Andrew Cagney
2004-07-14 17:56   ` Martin M. Hunt
2004-07-14 19:38     ` Andrew Cagney
2004-07-15 17:32       ` Mark Kettenis
2004-07-15 17:40       ` Martin M. Hunt
2004-07-15 18:15         ` Andrew Cagney
2004-07-15 18:35           ` Martin M. Hunt
2004-07-15 18:45             ` Andrew Cagney
2004-07-15 18:54               ` Martin M. Hunt
2004-07-16 21:16                 ` Jim Blandy [this message]

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=vt2zn5zzpn1.fsf@zenia.home \
    --to=jimb@redhat.com \
    --cc=cagney@gnu.org \
    --cc=gdb@sources.redhat.com \
    --cc=hunt@redhat.com \
    --cc=kettenis@gnu.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