From 1090771c90ca443adc369bd2c8be5de517f1f12f Mon Sep 17 00:00:00 2001 From: vsc Date: Mon, 17 Mar 2008 18:31:16 +0000 Subject: [PATCH] fix breakage in module system disable stack writing in error for now git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2155 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/cdmgr.c | 10 ++++++---- C/tracer.c | 4 +++- pl/hacks.yap | 20 ++++++++++++-------- pl/messages.yap | 3 ++- pl/modules.yap | 2 +- pl/protect.yap | 1 + 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/C/cdmgr.c b/C/cdmgr.c index f8fdfe713..318fd4ebd 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -11,8 +11,13 @@ * File: cdmgr.c * * comments: Code manager * * * -* Last rev: $Date: 2008-02-22 15:08:33 $,$Author: vsc $ * +* Last rev: $Date: 2008-03-17 18:31:16 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.219 2008/02/22 15:08:33 vsc +* Big update to support more SICStus/SWI like message handling +* fix YAPSHAREDIR +* fix yap.tex (Bernd) +* * Revision 1.218 2008/01/23 17:57:44 vsc * valgrind it! * enable atom garbage collection. @@ -5934,7 +5939,6 @@ p_choicepoint_info(void) taddr = MkIntegerTerm((Int)cptr); while (go_on) { op_numbers opnum = Yap_op_from_opcode(ipc->opc); - go_on = FALSE; switch (opnum) { #ifdef TABLING @@ -6065,8 +6069,6 @@ p_choicepoint_info(void) break; case _Ystop: default: - pe = NULL; - t = TermNil; return FALSE; } } diff --git a/C/tracer.c b/C/tracer.c index 04a207136..df8626199 100644 --- a/C/tracer.c +++ b/C/tracer.c @@ -164,6 +164,8 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args) LOCK(Yap_heap_regs->low_level_trace_lock); sc = Yap_heap_regs; vsc_count++; + if (vsc_count < 2064000LL) + return; #ifdef COMMENTED //*(H0+(0xb65f2850-0xb64b2008)/sizeof(CELL))==0xc || //0x4fd4d @@ -241,7 +243,7 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args) return; } { - CELL *env_ptr = ENV; + CELL *env_ptr = ENV; PredEntry *p; while (env_ptr) { diff --git a/pl/hacks.yap b/pl/hacks.yap index 1741d851a..a7a4940ef 100644 --- a/pl/hacks.yap +++ b/pl/hacks.yap @@ -11,7 +11,7 @@ * File: utilities for messing around in YAP internals. * * comments: error messages for YAP * * * -* Last rev: $Date: 2008-02-22 15:08:37 $,$Author: vsc $ * +* Last rev: $Date: 2008-03-17 18:31:16 $,$Author: vsc $ * * * * * *************************************************************************/ @@ -74,8 +74,7 @@ display_stack_info([],[Env|Envs],I,Cont) --> { I1 is I-1 }, display_stack_info([], Envs, I1, NCont). display_stack_info([CP|LCPs],[Env|LEnvs],I,Cont) --> - continuation(Env, _, NCont, CB), - { I1 is I-1 }, + { yap_hacks:continuation(Env, _, NCont, CB), I1 is I-1 }, ( { CP == Env, CB < CP } -> % if we follow choice-point and we cut to before choice-point % we are the same goal @@ -91,7 +90,7 @@ display_stack_info([CP|LCPs],[Env|LEnvs],I,Cont) --> ). show_cp(CP, Continuation) --> - { choicepoint(CP, Addr, Mod, Name, Arity, Goal, ClNo) }, + { yap_hacks:choicepoint(CP, Addr, Mod, Name, Arity, Goal, ClNo) }, ( { Goal = (_;_) } -> [ '0x~16r~t*~16+ Cur~t~d~16+ ~q:~q/~d( ? ; ? )~n'- @@ -106,8 +105,8 @@ show_cp(CP, Continuation) --> show_env(Env,Cont,NCont) --> { - continuation(Env, Addr, NCont, _), - cp_to_predicate(Cont, Mod, Name, Arity, ClId) + yap_hacks:continuation(Env, Addr, NCont, _), + yap_hacks:cp_to_predicate(Cont, Mod, Name, Arity, ClId) }, [ '0x~16r~t ~16+ Cur~t ~d~16+ ~q:' - [Addr, ClId, Mod] ], @@ -121,9 +120,14 @@ clean_goal(G,_,G). scratch_goal(N,A,Mod,NG) :- list_of_qmarks(A,L), G=..[N|L], - beautify_hidden_goal(G,Mod,[NG],[]), !. + ( + beautify_hidden_goal(G,Mod,[NG],[]) + ; + G = NG + ), + !. -list_of_qmarks(0,[]). +list_of_qmarks(0,[]) :- !. list_of_qmarks(I,[?|L]) :- I1 is I-1, list_of_qmarks(I1,L). diff --git a/pl/messages.yap b/pl/messages.yap index e01f429e3..762b6f542 100644 --- a/pl/messages.yap +++ b/pl/messages.yap @@ -11,7 +11,7 @@ * File: utilities for displaying messages in YAP. * * comments: error messages for YAP * * * -* Last rev: $Date: 2008-02-25 10:15:31 $,$Author: vsc $ * +* Last rev: $Date: 2008-03-17 18:31:16 $,$Author: vsc $ * * * * * *************************************************************************/ @@ -73,6 +73,7 @@ generate_message(M) --> stack_dump(M). stack_dump(error(_,_)) --> + { fail }, { nb_getval(sp_info,local_sp(P,CP,Envs,CPs)) }, { Envs = [_|_] ; CPs = [_|_] }, !, [nl], diff --git a/pl/modules.yap b/pl/modules.yap index 1a82dcadd..c6c95b5f3 100644 --- a/pl/modules.yap +++ b/pl/modules.yap @@ -241,7 +241,7 @@ module(N) :- % current module for fixing up meta-call arguments % current module for predicate % head variables. -'$module_expansion'(V,call(G),call(MM:G),_M,MM,_TM,_) :- var(V), !. +'$module_expansion'(V,call(MM:V),call(MM:V),_M,MM,_TM,_) :- var(V), !. '$module_expansion'((A,B),(A1,B1),(AO,BO),M,MM,TM,HVars) :- !, '$module_expansion'(A,A1,AO,M,MM,TM,HVars), '$module_expansion'(B,B1,BO,M,MM,TM,HVars). diff --git a/pl/protect.yap b/pl/protect.yap index df6806a35..70a4c63bf 100644 --- a/pl/protect.yap +++ b/pl/protect.yap @@ -38,5 +38,6 @@ '$hide'('$dbref') :- !, fail. /* not stream position */ '$hide'('$stream') :- !, fail. /* not $STREAM */ '$hide'('$stream_position') :- !, fail. /* not stream position */ +'$hide'('$hacks') :- !, fail. /* not stream position */ '$hide'(Name) :- hide(Name), fail.