aboutsummaryrefslogtreecommitdiff
path: root/gdb/cris-tdep.c
diff options
context:
space:
mode:
authorOrjan Friberg <orjanf@axis.com>2005-05-27 14:36:13 +0000
committerOrjan Friberg <orjanf@axis.com>2005-05-27 14:36:13 +0000
commit5114e29d63e1313c5c2ed65f4940a54f40a12ec3 (patch)
tree52a15f5a68cdf5eb26333a2f2c7c9df98463461d /gdb/cris-tdep.c
parentfafb59f131bf8ea8a9b4615a955109bf1c8d5c62 (diff)
downloadgdb-5114e29d63e1313c5c2ed65f4940a54f40a12ec3.zip
gdb-5114e29d63e1313c5c2ed65f4940a54f40a12ec3.tar.gz
gdb-5114e29d63e1313c5c2ed65f4940a54f40a12ec3.tar.bz2
2005-05-27 Orjan Friberg <orjanf@axis.com>
* cris-tdep.c (crisv32_scan_prologue): Add. (cris_frame_unwind_cache, cris_skip_prologue): Call crisv32_scan_prologue when debugging CRISv32.
Diffstat (limited to 'gdb/cris-tdep.c')
-rw-r--r--gdb/cris-tdep.c51
1 files changed, 49 insertions, 2 deletions
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 5325819..fd4b38c 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -724,6 +724,10 @@ static CORE_ADDR cris_scan_prologue (CORE_ADDR pc,
struct frame_info *next_frame,
struct cris_unwind_cache *info);
+static CORE_ADDR crisv32_scan_prologue (CORE_ADDR pc,
+ struct frame_info *next_frame,
+ struct cris_unwind_cache *info);
+
static CORE_ADDR cris_unwind_pc (struct gdbarch *gdbarch,
struct frame_info *next_frame);
@@ -795,7 +799,10 @@ cris_frame_unwind_cache (struct frame_info *next_frame,
info->leaf_function = 0;
/* Prologue analysis does the rest... */
- cris_scan_prologue (frame_func_unwind (next_frame), next_frame, info);
+ if (cris_version () == 32)
+ crisv32_scan_prologue (frame_func_unwind (next_frame), next_frame, info);
+ else
+ cris_scan_prologue (frame_func_unwind (next_frame), next_frame, info);
return info;
}
@@ -1375,6 +1382,42 @@ cris_scan_prologue (CORE_ADDR pc, struct frame_info *next_frame,
return pc;
}
+static CORE_ADDR
+crisv32_scan_prologue (CORE_ADDR pc, struct frame_info *next_frame,
+ struct cris_unwind_cache *info)
+{
+ ULONGEST this_base;
+
+ /* Unlike the CRISv10 prologue scanner (cris_scan_prologue), this is not
+ meant to be a full-fledged prologue scanner. It is only needed for
+ the cases where we end up in code always lacking DWARF-2 CFI, notably:
+
+ * PLT stubs (library calls)
+ * call dummys
+ * signal trampolines
+
+ For those cases, it is assumed that there is no actual prologue; that
+ the stack pointer is not adjusted, and (as a consequence) the return
+ address is not pushed onto the stack. */
+
+ /* We only want to know the end of the prologue when next_frame and info
+ are NULL (called from cris_skip_prologue i.e.). */
+ if (next_frame == NULL && info == NULL)
+ {
+ return pc;
+ }
+
+ /* The SP is assumed to be unaltered. */
+ frame_unwind_unsigned_register (next_frame, SP_REGNUM, &this_base);
+ info->base = this_base;
+ info->prev_sp = this_base;
+
+ /* The PC is assumed to be found in SRP. */
+ info->saved_regs[PC_REGNUM] = info->saved_regs[SRP_REGNUM];
+
+ return pc;
+}
+
/* Advance pc beyond any function entry prologue instructions at pc
to reach some "real" code. */
@@ -1397,7 +1440,11 @@ cris_skip_prologue (CORE_ADDR pc)
return sal.end;
}
- pc_after_prologue = cris_scan_prologue (pc, NULL, NULL);
+ if (cris_version () == 32)
+ pc_after_prologue = crisv32_scan_prologue (pc, NULL, NULL);
+ else
+ pc_after_prologue = cris_scan_prologue (pc, NULL, NULL);
+
return pc_after_prologue;
}