This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 5/8] Detect a frameless frame by comparing the FP register to -1.
- From: John Baldwin <jhb at FreeBSD dot org>
- To: gdb-patches at sourceware dot org, binutils at sourceware dot org
- Date: Sat, 11 Jun 2016 13:48:32 -0700
- Subject: [PATCH 5/8] Detect a frameless frame by comparing the FP register to -1.
- Authentication-results: sourceware.org; auth=none
- References: <1465678115-58170-1-git-send-email-jhb at FreeBSD dot org>
Since CORE_ADDR is unsigned, the saved FP register is always greater than
or equal to zero. Comparing to -1 results in a direct comparison with the
value used to initialize the saved FP register to an uninitialized state.
---
gdb/ChangeLog | 5 +++++
gdb/sh64-tdep.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 73f42e2..243b717 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2016-06-11 John Baldwin <jhb@FreeBSD.org>
+ * sh64-tdep.c (sh64_analyze_prologue): Compare FP register against
+ -1 to detect missing FP.
+
+2016-06-11 John Baldwin <jhb@FreeBSD.org>
+
* score-tdep.c (score7_malloc_and_get_memblock): Remove check for
negative size.
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index e6b1e27..f5a6504 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -971,7 +971,7 @@ sh64_analyze_prologue (struct gdbarch *gdbarch,
}
}
- if (cache->saved_regs[MEDIA_FP_REGNUM] >= 0)
+ if (cache->saved_regs[MEDIA_FP_REGNUM] == -1)
cache->uses_fp = 1;
}
--
2.7.0