This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[committed] MIPS: Lost & found fetch_mips_16 ISA bit fix
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Wed, 26 Jun 2013 16:37:58 +0100
- Subject: [committed] MIPS: Lost & found fetch_mips_16 ISA bit fix
Hi,
This was lost in patch merges and did not make its way into the ISA bit
helper usage cleanup made along adding microMIPS support. Apart from
cleaning up code it also fixes the issue of address truncation on 64-bit
targets. Committed.
2013-06-26 Maciej W. Rozycki <macro@codesourcery.com>
gdb/
* mips-tdep.c (fetch_mips_16): Use unmake_compact_addr.
Maciej
gdb-fetch-mips-16-fix.diff
Index: gdb-fsf-trunk-quilt/gdb/mips-tdep.c
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/mips-tdep.c 2013-06-26 15:33:28.260102185 +0100
+++ gdb-fsf-trunk-quilt/gdb/mips-tdep.c 2013-06-26 15:33:32.759790552 +0100
@@ -2042,7 +2042,8 @@ fetch_mips_16 (struct gdbarch *gdbarch,
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
gdb_byte buf[8];
- pc &= 0xfffffffe; /* Clear the low order bit. */
+
+ pc = unmake_compact_addr (pc); /* Clear the low order bit. */
target_read_memory (pc, buf, 2);
return extract_unsigned_integer (buf, 2, byte_order);
}