summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-11-29 11:57:02 +0000
committerjeff <jeff@FreeBSD.org>2003-11-29 11:57:02 +0000
commit09f2522c7f5b84b1e020559c180e2fdcc988fdf1 (patch)
tree78db6f4caded1e8f4ea3eaa72346bdb98b5a17c6
parent944490ab4bcff9bf339df8a97240b0ed11667ff5 (diff)
downloadFreeBSD-src-09f2522c7f5b84b1e020559c180e2fdcc988fdf1.zip
FreeBSD-src-09f2522c7f5b84b1e020559c180e2fdcc988fdf1.tar.gz
- In db_stack_trace_cmd() bail out if we get confused about the stack.
Tested by: kkenn Approved by: re (scottl)
-rw-r--r--sys/alpha/alpha/db_trace.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/alpha/alpha/db_trace.c b/sys/alpha/alpha/db_trace.c
index 9067be1..c203168 100644
--- a/sys/alpha/alpha/db_trace.c
+++ b/sys/alpha/alpha/db_trace.c
@@ -112,7 +112,7 @@ void db_md_list_watchpoints(void);
* Decode the function prologue for the function we're in, and note
* which registers are stored where, and how large the stack frame is.
*/
-static void
+static int
decode_prologue(db_addr_t callpc, db_addr_t func,
struct prologue_info *pi)
{
@@ -127,6 +127,7 @@ decode_prologue(db_addr_t callpc, db_addr_t func,
do { \
if (pi->pi_frame_size != 0) { \
db_printf("frame size botch: adjust register offsets?\n"); \
+ return (1); \
} \
} while (0)
@@ -143,9 +144,11 @@ do { \
*/
signed_immediate = (long)ins.mem_format.displacement;
#if 1
- if (signed_immediate > 0)
+ if (signed_immediate > 0) {
db_printf("prologue botch: displacement %ld\n",
signed_immediate);
+ return (1);
+ }
#endif
CHECK_FRAMESIZE;
pi->pi_frame_size += -signed_immediate;
@@ -169,6 +172,7 @@ do { \
pi->pi_reg_offset[ins.mem_format.rd] = signed_immediate;
}
}
+ return (0);
}
static int
@@ -363,7 +367,8 @@ db_stack_trace_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, char *m
*
* XXX How does this interact w/ alloca()?!
*/
- decode_prologue(callpc, symval, &pi);
+ if (decode_prologue(callpc, symval, &pi))
+ return;
if ((pi.pi_regmask & (1 << 26)) == 0) {
/*
* No saved RA found. We might have RA from
OpenPOWER on IntegriCloud