Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [patch, i386] Use read_memory_unsigned_integer to get address
Date: Thu, 22 Sep 2011 10:23:00 -0000	[thread overview]
Message-ID: <4E7A98B0.20809@codesourcery.com> (raw)

The address on i386 is unsigned, so we should use
read_memory_unsigned_integer to fetch address from memory.

OK to apply?

-- 
Yao (齐尧) 

	gdb/
	* i386-linux-nat.c (i386_linux_resume): Use read_memory_unsigned_integer
	to get address.
	* i386obsd-nat.c (i386obsd_supply_pcb): Likewise.

diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index e32a119..6257931 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -893,7 +893,8 @@ i386_linux_resume (struct target_ops *ops,
 
 	      regcache_cooked_read_unsigned (regcache, I386_ESP_REGNUM, &sp);
 	      if (syscall == SYS_rt_sigreturn)
-		addr = read_memory_integer (sp + 8, 4, byte_order) + 20;
+		addr = read_memory_unsigned_integer (sp + 8, 4, byte_order)
+		  + 20;
 	      else
 		addr = sp;
 
diff --git a/gdb/i386obsd-nat.c b/gdb/i386obsd-nat.c
index db1f693..1c0d047 100644
--- a/gdb/i386obsd-nat.c
+++ b/gdb/i386obsd-nat.c
@@ -78,8 +78,8 @@ i386obsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
     {
       /* No, the pcb must have been last updated by savectx().  */
       pcb->pcb_esp = pcb->pcb_ebp;
-      pcb->pcb_ebp = read_memory_integer(pcb->pcb_esp, 4, byte_order);
-      sf.sf_eip = read_memory_integer(pcb->pcb_esp + 4, 4, byte_order);
+      pcb->pcb_ebp = read_memory_unsigned_integer (pcb->pcb_esp, 4, byte_order);
+      sf.sf_eip = read_memory_unsigned_integer (pcb->pcb_esp + 4, 4, byte_order);
       regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf.sf_eip);
     }
 


             reply	other threads:[~2011-09-22  2:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 10:23 Yao Qi [this message]
2011-09-22 13:55 ` Mark Kettenis
2011-09-23  8:11   ` [committed]: " Yao Qi

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=4E7A98B0.20809@codesourcery.com \
    --to=yao@codesourcery.com \
    --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