fix module stuff (at last)
debugger should call goal_expansion in spycalls. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@679 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
f56a874e3b
commit
6c626484f0
5
C/init.c
5
C/init.c
@ -822,7 +822,10 @@ InitCodes(void)
|
||||
heap_regs->char_conversion_table2 = NULL;
|
||||
heap_regs->number_of_cpreds = 0;
|
||||
heap_regs->number_of_cmpfuncs = 0;
|
||||
heap_regs->no_of_modules = 1;
|
||||
/*
|
||||
don't initialise this here, this is initialised by _YAP_InitModules!!!!
|
||||
heap_regs->no_of_modules = 1;
|
||||
*/
|
||||
heap_regs->primitives_module = 0;
|
||||
heap_regs->user_module = 1;
|
||||
heap_regs->db_queues = NULL;
|
||||
|
16
C/modules.c
16
C/modules.c
@ -50,9 +50,11 @@ LookupModule(Term a)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < NoOfModules; ++i)
|
||||
if (ModuleName[i] == a)
|
||||
for (i = 0; i < NoOfModules; ++i) {
|
||||
if (ModuleName[i] == a) {
|
||||
return (i);
|
||||
}
|
||||
}
|
||||
ModuleName[i = NoOfModules++] = a;
|
||||
if (NoOfModules == MaxModules) {
|
||||
_YAP_Error(SYSTEM_ERROR,a,"number of modules overflowed");
|
||||
@ -65,24 +67,18 @@ _YAP_LookupModule(Term a)
|
||||
{
|
||||
return(LookupModule(a));
|
||||
}
|
||||
|
||||
static Int
|
||||
p_current_module(void)
|
||||
{ /* $current_module(Old,New) */
|
||||
Term t;
|
||||
unsigned int i;
|
||||
|
||||
if (!_YAP_unify_constant(ARG1, ModuleName[CurrentModule]))
|
||||
return (0);
|
||||
t = Deref(ARG2);
|
||||
if (IsVarTerm(t) || !IsAtomTerm(t))
|
||||
return (0);
|
||||
for (i = 0; i < NoOfModules; ++i)
|
||||
if (ModuleName[i] == t) {
|
||||
CurrentModule = i;
|
||||
return (TRUE);
|
||||
}
|
||||
CurrentModule = NoOfModules;
|
||||
ModuleName[NoOfModules++] = t;
|
||||
CurrentModule = LookupModule(t);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
@ -381,6 +381,11 @@ debugging :-
|
||||
'$spycalls'(Mod:G,_,Res) :-
|
||||
!,
|
||||
'$spycalls'(G,Mod,Res).
|
||||
'$spycalls'(G,Mod,Res) :-
|
||||
'$pred_goal_expansion_on',
|
||||
% make sure we do not try to expand conjs, etc...
|
||||
user:goal_expansion(G,Mod,GF), !,
|
||||
'$spycalls'(GF,Mod,Res).
|
||||
'$spycalls'(\+ G,Mod,Res) :-
|
||||
!,
|
||||
CP is '$last_choice_pt',
|
||||
|
Reference in New Issue
Block a user