aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-03-08 10:15:33 +0000
committerCorinna Vinschen <corinna@vinschen.de>2004-03-08 10:15:33 +0000
commita2b4a96c10f9115225d242545aea65532fb8fb3a (patch)
treeeae14d7ba5d2acd17f5f6d6c90be97c96457c4fd
parentd5bb7600cb7e1c1eeb1d1b7c83f768ddc6f5c1b0 (diff)
downloadgdb-a2b4a96c10f9115225d242545aea65532fb8fb3a.zip
gdb-a2b4a96c10f9115225d242545aea65532fb8fb3a.tar.gz
gdb-a2b4a96c10f9115225d242545aea65532fb8fb3a.tar.bz2
Fix PR tdep/1291.
* sh-tdep.c (sh_analyze_prologue): Align PC relative addressing to official SH documentation.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/sh-tdep.c10
2 files changed, 11 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4683f06..814c2f3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-08 Corinna Vinschen <vinschen@redhat.com>
+
+ Fix PR tdep/1291.
+ * sh-tdep.c (sh_analyze_prologue): Align PC relative addressing
+ to official SH documentation.
+
2004-03-07 Andrew Cagney <cagney@redhat.com>
* ppc-linux-nat.c (ppc_ptrace_cannot_fetch_store_register): Delete
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 9cb5278..d1e5f59 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -440,9 +440,9 @@ sh_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
if (reg < 14)
{
sav_reg = reg;
- offset = (((inst & 0xff) ^ 0x80) - 0x80) << 1;
+ offset = (inst & 0xff) << 1;
sav_offset =
- read_memory_integer (((pc + 4) & ~3) + offset, 2);
+ read_memory_integer ((pc + 4) + offset, 2);
}
}
}
@@ -450,13 +450,13 @@ sh_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
{
if (sav_reg < 0)
{
- reg = (inst & 0x0f00) >> 8;
+ reg = GET_TARGET_REG (inst);
if (reg < 14)
{
sav_reg = reg;
- offset = (((inst & 0xff) ^ 0x80) - 0x80) << 1;
+ offset = (inst & 0xff) << 2;
sav_offset =
- read_memory_integer (((pc + 4) & ~3) + offset, 4);
+ read_memory_integer (((pc & 0xfffffffc) + 4) + offset, 4);
}
}
}