public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 3/3] PR gdb/16304: Zero-extend address from 32-bit to 64-bit
@ 2013-12-08 19:45 H.J. Lu
  2013-12-14 23:13 ` H.J. Lu
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2013-12-08 19:45 UTC (permalink / raw)
  To: GDB

When there is ADDR32 prefix in 64-bit mode, we should zero-extend
address from 32-bit to 64-bit. Tested on Linux/x86-64.  OK to install?

Thanks.

H.J.
----
2013-12-08  H.J. Lu  <hongjiu.lu@intel.com>

	PR gdb/16304
	* i386-tdep.c (i386_record_lea_modrm_addr): Zero-extend 32-bit
	address to 64-bit in 64-bit mode.
---
 gdb/i386-tdep.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index be99aa3..17605ef 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -4265,6 +4265,13 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr)
 	  else
 	    *addr = (uint32_t) (*addr + (offset64 << scale));
 	}
+
+      if (!irp->aflag)
+	{
+	  /* Since we are in 64-bit mode with ADDR32 prefix, zero-extend
+	     address from 32-bit to 64-bit.  */
+	    *addr = (uint32_t) *addr;
+	}
     }
   else
     {
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/3] PR gdb/16304: Zero-extend address from 32-bit to 64-bit
  2013-12-08 19:45 [PATCH 3/3] PR gdb/16304: Zero-extend address from 32-bit to 64-bit H.J. Lu
@ 2013-12-14 23:13 ` H.J. Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2013-12-14 23:13 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: GDB

On Sun, Dec 08, 2013 at 11:44:50AM -0800, H.J. Lu wrote:
> When there is ADDR32 prefix in 64-bit mode, we should zero-extend
> address from 32-bit to 64-bit. Tested on Linux/x86-64.  OK to install?
> 
> Thanks.
> 
> H.J.
> ----
> 2013-12-08  H.J. Lu  <hongjiu.lu@intel.com>
> 
> 	PR gdb/16304
> 	* i386-tdep.c (i386_record_lea_modrm_addr): Zero-extend 32-bit
> 	address to 64-bit in 64-bit mode.
> ---
>  gdb/i386-tdep.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
> index be99aa3..17605ef 100644
> --- a/gdb/i386-tdep.c
> +++ b/gdb/i386-tdep.c
> @@ -4265,6 +4265,13 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr)
>  	  else
>  	    *addr = (uint32_t) (*addr + (offset64 << scale));
>  	}
> +
> +      if (!irp->aflag)
> +	{
> +	  /* Since we are in 64-bit mode with ADDR32 prefix, zero-extend
> +	     address from 32-bit to 64-bit.  */
> +	    *addr = (uint32_t) *addr;
> +	}
>      }
>    else
>      {
> -- 
> 1.8.3.1
> 

Hi Mark,

Do you get time to review this?

Thanks.

H.J.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-14 23:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-08 19:45 [PATCH 3/3] PR gdb/16304: Zero-extend address from 32-bit to 64-bit H.J. Lu
2013-12-14 23:13 ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).