This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/3] PR gdb/16304: Properly decode MODRM byte for 64-bit
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GDB <gdb-patches at sourceware dot org>
- Date: Sun, 8 Dec 2013 11:43:53 -0800
- Subject: [PATCH 1/3] PR gdb/16304: Properly decode MODRM byte for 64-bit
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
64-bit mode doesn't have 16-bit address. This patch fixes it. Tested on
Linux/x86-64. OK to install?
H.J.
--
2013-12-08 H.J. Lu <hongjiu.lu@intel.com>
PR gdb/16304
* i386-tdep.c (i386_record_lea_modrm_addr): Don't use 16-bit
address in 64-bit mode.
---
gdb/i386-tdep.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 597d672..4a91d80 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -4192,9 +4192,9 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr)
ULONGEST offset64;
*addr = 0;
- if (irp->aflag)
+ if (irp->aflag || gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64)
{
- /* 32 bits */
+ /* 32/64 bits */
int havesib = 0;
uint8_t scale = 0;
uint8_t byte;
--
1.8.3.1