Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@mips.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org, "Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: [rfc] dwarf2 unwinder and MIPS n32
Date: Mon, 30 Apr 2007 13:00:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.61.0704301335560.20399@perivale.mips.com> (raw)
In-Reply-To: <20070428202914.GA8077@caradoc.them.org>

On Sat, 28 Apr 2007, Daniel Jacobowitz wrote:

> Maybe if the size of the register != the size of a void * we should
> store it as an unsigned integer.  But that seems hackish to me.

 Of course MIPS addresses are signed, so if you have a stack pointer in 
KSEG0 (e.g. 0x8fff0000), you want to store it as a signed integer, don't 
you?

 Anyway, I have the following patch waiting in the queue for submission -- 
perhaps it is less hackish. ;-)

2007-04-30  Maciej W. Rozycki  <macro@mips.com>

	* dwarf2-frame.c (read_reg): Extract an address using the width
	of the register to be used to hold it as the size.
	(dwarf2_frame_prev_register): Store an address using the width
	of the holding register as the size.

 It can certainly jump the queue if you find it useful. ;-)

  Maciej

13118.diff
Index: gdb/src/gdb/dwarf2-frame.c
===================================================================
--- gdb.orig/src/gdb/dwarf2-frame.c	2007-02-13 13:51:55.000000000 +0000
+++ gdb/src/gdb/dwarf2-frame.c	2007-02-13 13:51:56.000000000 +0000
@@ -229,6 +229,7 @@
 static CORE_ADDR
 read_reg (void *baton, int reg)
 {
+  struct type reg_void_data_ptr = *builtin_type_void_data_ptr;
   struct frame_info *next_frame = (struct frame_info *) baton;
   struct gdbarch *gdbarch = get_frame_arch (next_frame);
   int regnum;
@@ -236,6 +237,8 @@
 
   regnum = DWARF2_REG_TO_REGNUM (reg);
 
+  TYPE_LENGTH(&reg_void_data_ptr) = register_size (gdbarch, regnum);
+
   buf = alloca (register_size (gdbarch, regnum));
   frame_unwind_register (next_frame, regnum, buf);
 
@@ -244,7 +247,7 @@
      under the covers, and this makes more sense for non-pointer
      registers.  Maybe read_reg and the associated interfaces should
      deal with "struct value" instead of CORE_ADDR.  */
-  return unpack_long (register_type (gdbarch, regnum), buf);
+  return extract_typed_address (buf, &reg_void_data_ptr);
 }
 
 static void
@@ -1020,10 +1023,13 @@
 			    enum lval_type *lvalp, CORE_ADDR *addrp,
 			    int *realnump, gdb_byte *valuep)
 {
+  struct type reg_void_data_ptr = *builtin_type_void_data_ptr;
   struct gdbarch *gdbarch = get_frame_arch (next_frame);
   struct dwarf2_frame_cache *cache =
     dwarf2_frame_cache (next_frame, this_cache);
 
+  TYPE_LENGTH(&reg_void_data_ptr) = register_size (gdbarch, regnum);
+
   switch (cache->reg[regnum].how)
     {
     case DWARF2_FRAME_REG_UNDEFINED:
@@ -1132,7 +1138,7 @@
       if (valuep)
 	{
 	  /* Store the value.  */
-	  store_typed_address (valuep, builtin_type_void_data_ptr, cache->cfa);
+	  store_typed_address (valuep, &reg_void_data_ptr, cache->cfa);
 	}
       break;
 


  parent reply	other threads:[~2007-04-30 12:41 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
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 [this message]
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=Pine.LNX.4.61.0704301335560.20399@perivale.mips.com \
    --to=macro@mips.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@linux-mips.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