add debugging code to verify when a specific predicate is added.
This commit is contained in:
parent
e8f2c37000
commit
92f0a91f85
@ -812,6 +812,10 @@ Yap_NewPredPropByFunctor(FunctorEntry *fe, Term cur_mod)
|
|||||||
else
|
else
|
||||||
p->ModuleOfPred = cur_mod;
|
p->ModuleOfPred = cur_mod;
|
||||||
//TRUE_FUNC_WRITE_LOCK(fe);
|
//TRUE_FUNC_WRITE_LOCK(fe);
|
||||||
|
#if DEBUG_NEW_FUNCTOR
|
||||||
|
if (!strcmp(fe->NameOfFE->StrOfAE, "library_directory"))
|
||||||
|
jmp_deb(1);
|
||||||
|
#endif
|
||||||
INIT_LOCK(p->PELock);
|
INIT_LOCK(p->PELock);
|
||||||
p->KindOfPE = PEProp;
|
p->KindOfPE = PEProp;
|
||||||
p->ArityOfPE = fe->ArityOfFE;
|
p->ArityOfPE = fe->ArityOfFE;
|
||||||
|
16
C/modules.c
16
C/modules.c
@ -263,6 +263,21 @@ p_strip_module( USES_REGS1 )
|
|||||||
Yap_unify(ARG2, tmod);
|
Yap_unify(ARG2, tmod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Int
|
||||||
|
p_system_module( USES_REGS1 )
|
||||||
|
{
|
||||||
|
Term t1 = Deref(ARG1);
|
||||||
|
if (t1 == PROLOG_MODULE) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return t1 == TermProlog ||
|
||||||
|
t1 == IDB_MODULE ||
|
||||||
|
t1 == IDB_MODULE ||
|
||||||
|
t1 == ATTRIBUTES_MODULE ||
|
||||||
|
t1 == SYSTEM_MODULE ||
|
||||||
|
t1 == GLOBALS_MODULE;
|
||||||
|
}
|
||||||
|
|
||||||
static Int
|
static Int
|
||||||
p_context_module( USES_REGS1 )
|
p_context_module( USES_REGS1 )
|
||||||
{
|
{
|
||||||
@ -336,6 +351,7 @@ Yap_InitModulesC(void)
|
|||||||
Yap_InitCPred("$change_module", 1, p_change_module, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("$change_module", 1, p_change_module, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("strip_module", 3, p_strip_module, SafePredFlag|SyncPredFlag);
|
Yap_InitCPred("strip_module", 3, p_strip_module, SafePredFlag|SyncPredFlag);
|
||||||
Yap_InitCPred("context_module", 1, p_context_module, 0);
|
Yap_InitCPred("context_module", 1, p_context_module, 0);
|
||||||
|
Yap_InitCPred("$system_module", 1, p_system_module, 0);
|
||||||
Yap_InitCPredBack("$all_current_modules", 1, 1, init_current_module, cont_current_module,
|
Yap_InitCPredBack("$all_current_modules", 1, 1, init_current_module, cont_current_module,
|
||||||
SafePredFlag|SyncPredFlag);
|
SafePredFlag|SyncPredFlag);
|
||||||
}
|
}
|
||||||
|
@ -148,11 +148,11 @@ IDNUM id_table_retrieve(const ID_TABLE *this, TERM term)
|
|||||||
|
|
||||||
IDNUM id_table_register(ID_TABLE *this, TERM term)
|
IDNUM id_table_register(ID_TABLE *this, TERM term)
|
||||||
{
|
{
|
||||||
BPULONG hash;
|
// BPULONG hash;
|
||||||
IDNUM i;
|
IDNUM i;
|
||||||
|
|
||||||
term = term_pool_register(this->store, term);
|
term = term_pool_register(this->store, term);
|
||||||
hash = (BPULONG)(term);
|
//hash = (BPULONG)(term);
|
||||||
|
|
||||||
i = id_table_search(this, term);
|
i = id_table_search(this, term);
|
||||||
if (i == ID_NONE) {
|
if (i == ID_NONE) {
|
||||||
|
@ -1063,23 +1063,21 @@ module_property(Mod, file(F)) :-
|
|||||||
module_property(Mod, exports(Es)) :-
|
module_property(Mod, exports(Es)) :-
|
||||||
recorded('$module','$module'(_,Mod,Es,_),_).
|
recorded('$module','$module'(_,Mod,Es,_),_).
|
||||||
|
|
||||||
'$module_class'(system, L) :- '$system_module'(L).
|
'$module_class'(Mod, system) :- '$system_module'( Mod ).
|
||||||
'$module_class'(library, L) :- '$library_module'(L).
|
'$module_class'(Mod, library) :- '$library_module'( Mod ).
|
||||||
'$module_class'(user, L) :- '$user_module'(L).
|
'$module_class'(Mod, user) :- '$user_module'( Mod ).
|
||||||
'$module_class'(temporary, L) :- fail.
|
'$module_class'(_, temporary) :- fail.
|
||||||
'$module_class'(test, L) :- fail.
|
'$module_class'(_, test) :- fail.
|
||||||
'$module_class'(development, L) :- fail.
|
'$module_class'(_, development) :- fail.
|
||||||
|
|
||||||
'$system_module'(prolog).
|
|
||||||
'$system_module'(system).
|
|
||||||
|
|
||||||
'$library_module'(M1) :-
|
'$library_module'(M1) :-
|
||||||
recorded('$module','$module'(F, M1, _MyExports,_Line),_),
|
recorded('$module','$module'(F, M1, _MyExports,_Line),_),
|
||||||
library_directory(D),
|
user:library_directory(D),
|
||||||
sub_atom(F, 0, _, _, D).
|
sub_atom(F, 0, _, _, D).
|
||||||
|
|
||||||
'$user_module'(_).
|
'$user_module'( Mod ) :-
|
||||||
|
\+ '$library_module'( Mod),
|
||||||
|
\+ '$system_module'( Mod).
|
||||||
|
|
||||||
ls_imports :-
|
ls_imports :-
|
||||||
recorded('$import','$import'(M0,M,G0,G,_N,_K),_R),
|
recorded('$import','$import'(M0,M,G0,G,_N,_K),_R),
|
||||||
|
Reference in New Issue
Block a user