Commit 6316024f authored by Anton Ertl's avatar Anton Ertl

bugfix in lp checking; page-align stack bottoms in debugging engine

parent 91054846
......@@ -2453,6 +2453,13 @@ user_area* gforth_stacks(Cell dsize, Cell fsize, Cell rsize, Cell lsize)
totalsize += 2*SIGSTKSZ;
#endif
#ifdef HAVE_MMAP
#ifdef GFORTH_DEBUGGING
/* make sure the stack bottom is page-aligned for stack underflow detection*/
dsize = dsizep;
rsize = rsizep;
fsize = fsizep;
lsize = lsizep;
#endif
a = (Cell)alloc_mmap(totalsize);
if (a != (Cell)MAP_FAILED) {
up0=(user_area*)a; a+=pagesize;
......
......@@ -289,7 +289,7 @@ VM_JUMP(EXEC1(EXTRA_CODEXT(a_cfa)));
branch-lp+!# ( #a_target #nlocals -- ) gforth branch_lp_plus_store_number
/* this will probably not be used */
lp += nlocals;
ALIVE_DEBUGGING(*lp);
ALIVE_DEBUGGING(lp[-1]);
SET_IP((Xt *)a_target);
\+
......@@ -313,7 +313,7 @@ $6
$1-lp+!`#' ( $7 `#'a_target `#'nlocals $2 ) $3_lp_plus_store_number
$4 $5 lp += nlocals;
ALIVE_DEBUGGING(*lp);
ALIVE_DEBUGGING(lp[-1]);
SET_IP((Xt *)a_target);
ifelse(condbranch_opt,`1',`INST_TAIL; NEXT_P2;',`/* condbranch_opt=0 */')
}
......@@ -2866,18 +2866,18 @@ lp+!# ( #noffset -- ) gforth lp_plus_store_number
local stack, a positive immediate argument drops memory from the local
stack""
lp += noffset;
ALIVE_DEBUGGING(*lp);
ALIVE_DEBUGGING(lp[-1]);
lp- ( -- ) new lp_minus
lp += -sizeof(Cell);
lp+ ( -- ) new lp_plus
lp += sizeof(Float);
ALIVE_DEBUGGING(*lp);
ALIVE_DEBUGGING(lp[-1]);
lp+2 ( -- ) new lp_plus_two
lp += 2*sizeof(Float);
ALIVE_DEBUGGING(*lp);
ALIVE_DEBUGGING(lp[-1]);
lp! ( c_addr -- ) gforth lp_store
lp = (Address)c_addr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment