aboutsummaryrefslogtreecommitdiff
path: root/gdb/alpha-mdebug-tdep.c
diff options
context:
space:
mode:
authorJerome Guitton <guitton@adacore.com>2010-04-23 15:14:22 +0000
committerJerome Guitton <guitton@adacore.com>2010-04-23 15:14:22 +0000
commit3a48e6ff66b76a9bd077a7a3671f13b537e418cd (patch)
treeb76abf9e78350c0df5fb1677e0740cee5c5ddffa /gdb/alpha-mdebug-tdep.c
parente4166a49ea402e8ec97329268d80cf75144c4628 (diff)
downloadgdb-3a48e6ff66b76a9bd077a7a3671f13b537e418cd.zip
gdb-3a48e6ff66b76a9bd077a7a3671f13b537e418cd.tar.gz
gdb-3a48e6ff66b76a9bd077a7a3671f13b537e418cd.tar.bz2
* alpha-tdep.c (INSN_OPCODE, MEM_RA, MEM_RB, MEM_DISP, BR_RA)
(OPR_FUNCTION, OPR_HAS_IMMEDIATE, OPR_RA, OPR_RC, OPR_LIT): New macros. (lda_opcode, stq_opcode, bne_opcode, subq_opcode, subq_function): New constants. (alpha_heuristic_analyze_probing_loop): New function. (alpha_heuristic_frame_unwind_cache): In the prologue analysis, detect and handle cases when a stack probe loop is generated. * alpha-mdebug-tdep.c (alpha_mdebug_frameless): New function. (alpha_mdebug_max_frame_size_exceeded): New function. (alpha_mdebug_after_prologue): Use alpha_mdebug_frameless. (alpha_mdebug_frame_sniffer, alpha_mdebug_frame_base_sniffer): Return 0 when the maximum debuggable frame size has been exceeded.
Diffstat (limited to 'gdb/alpha-mdebug-tdep.c')
-rw-r--r--gdb/alpha-mdebug-tdep.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/gdb/alpha-mdebug-tdep.c b/gdb/alpha-mdebug-tdep.c
index 568c2ea..369b161 100644
--- a/gdb/alpha-mdebug-tdep.c
+++ b/gdb/alpha-mdebug-tdep.c
@@ -136,6 +136,15 @@ find_proc_desc (CORE_ADDR pc)
return proc_desc;
}
+/* Return a non-zero result if the function is frameless; zero otherwise. */
+
+static int
+alpha_mdebug_frameless (struct mdebug_extra_func_info *proc_desc)
+{
+ return (PROC_FRAME_REG (proc_desc) == ALPHA_SP_REGNUM
+ && PROC_FRAME_OFFSET (proc_desc) == 0);
+}
+
/* This returns the PC of the first inst after the prologue. If we can't
find the prologue, then return 0. */
@@ -146,8 +155,7 @@ alpha_mdebug_after_prologue (CORE_ADDR pc, struct mdebug_extra_func_info *proc_d
{
/* If function is frameless, then we need to do it the hard way. I
strongly suspect that frameless always means prologueless... */
- if (PROC_FRAME_REG (proc_desc) == ALPHA_SP_REGNUM
- && PROC_FRAME_OFFSET (proc_desc) == 0)
+ if (alpha_mdebug_frameless (proc_desc))
return 0;
}
@@ -283,6 +291,20 @@ alpha_mdebug_frame_prev_register (struct frame_info *this_frame,
return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum);
}
+/* Return a non-zero result if the size of the stack frame exceeds the
+ maximum debuggable frame size (512 Kbytes); zero otherwise. */
+
+static int
+alpha_mdebug_max_frame_size_exceeded (struct mdebug_extra_func_info *proc_desc)
+{
+ /* If frame offset is null, we can be in two cases: either the
+ function is frameless (the stack frame is null) or its
+ frame exceeds the maximum debuggable frame size (512 Kbytes). */
+
+ return (PROC_FRAME_OFFSET (proc_desc) == 0
+ && !alpha_mdebug_frameless (proc_desc));
+}
+
static int
alpha_mdebug_frame_sniffer (const struct frame_unwind *self,
struct frame_info *this_frame,
@@ -302,6 +324,11 @@ alpha_mdebug_frame_sniffer (const struct frame_unwind *self,
if (alpha_mdebug_in_prologue (pc, proc_desc))
return 0;
+ /* If the maximum debuggable frame size has been exceeded, the
+ proc desc is bogus. Fall back on the heuristic unwinder. */
+ if (alpha_mdebug_max_frame_size_exceeded (proc_desc))
+ return 0;
+
return 1;
}
@@ -362,6 +389,11 @@ alpha_mdebug_frame_base_sniffer (struct frame_info *this_frame)
if (proc_desc == NULL)
return NULL;
+ /* If the maximum debuggable frame size has been exceeded, the
+ proc desc is bogus. Fall back on the heuristic unwinder. */
+ if (alpha_mdebug_max_frame_size_exceeded (proc_desc))
+ return 0;
+
return &alpha_mdebug_frame_base;
}