debugging

This commit is contained in:
Vitor Santos Costa 2019-01-30 15:24:06 +00:00
parent 847edfd432
commit f7ed109d1c
9 changed files with 2078 additions and 2266 deletions

View File

@ -1592,6 +1592,7 @@ void Yap_InitCPreds(void) {
Yap_udi_init();
Yap_udi_Interval_init();
Yap_InitSignalCPreds();
Yap_InitTermCPreds();
Yap_InitUserCPreds();
Yap_InitUtilCPreds();
Yap_InitSortPreds();

1534
C/terms.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -409,9 +409,7 @@ ${CMAKE_SOURCE_DIR}/OPTYap
${CMAKE_SOURCE_DIR}/utf8proc
${CMAKE_SOURCE_DIR}/JIT/HPP
${GMP_INCLUDE_DIRS}
${READLINE_LIBRARIES}
${SQLITE_LIBRARIES}
${ANDROID_LIBRARIES}
${READLINE_INCLUDE_DIR}
${CMAKE_BINARY_DIR}
)

View File

@ -167,7 +167,7 @@ opportunity. Initial value is 10,000. May be changed. A value of 0
*/
YAP_FLAG(DEBUG_FLAG, "debug", true, booleanFlag, "false", NULL),
// YAP_FLAG(DEBUG_INFO_FLAG, "debug_info", true, booleanFlag, "true", NULL),
YAP_FLAG(DEBUG_INFO_FLAG, "debug_info", true, booleanFlag, "true", NULL),
/**<
Says whether to call the debUgger on an exception. False in YAP..

View File

@ -65,6 +65,7 @@ set (ENGINE_SOURCES
C/tracer.c
C/unify.c
C/userpreds.c
C/terms.c
C/utilpreds.c
C/yap-args.c
C/write.c

View File

@ -29,7 +29,7 @@
*/
/**
* @pred system_module( +_Mod_, +_ListOfPublicPredicates, +ListOfPrivatePredicates *
* @pred system_module( _Mod_, _ListOfPublicPredicates, ListOfPrivatePredicates *
* Define a system module _Mod_. _ListOfPublicPredicates_ . Currentlt, all
* predicates are in the 'prolog' module. The first
* are visible outside the Prolog module, all others are hidden at the end of booting.
@ -37,21 +37,26 @@
*/
system_module(Mod, SysExps) :-
system_module(Mod, SysExps, []).
use_system_module(_Module, _SysExps).
system_module(_Mod, SysExps, _Decls) :-
% '$new_system_predicates'(SysExps),
fail.
system_module(_Mod, _SysExps, _Decls) :-
(
'$new_system_predicates'(SysExps),
fail
;
stream_property(loop_stream,file_name(File))
->
recordz(system_file, File, _ )
;
recordz(system_file, loop_stream, _ )
).
private(_).
'$new_system_predicates'([P|_Ps]) :-
functor(P, N, Ar),
'$new_system_predicates'([]).
'$new_system_predicates'([N/Ar|_Ps]) :-
'$new_system_predicate'(N, Ar, prolog).
'$new_system_predicates'([_P|Ps]) :-
'$new_system_predicates'(Ps).
@ -77,9 +82,6 @@ system_module(_Mod, SysExps, _Decls) :-
% be careful here not to generate an undefined exception..
use_system_module(_,_).
private(_).
print_message(L,E) :-
(L = informational
->
@ -247,7 +249,7 @@ initialize_prolog :-
:- c_compile( 'preds.yap' ).
:- c_compile( 'modules.yap' ).
:- c_compile( 'grammar.yap' ).
:- c_compile( 'protect.yap' ).
%:- c_compile( 'protect.yap' ).
:- ['absf.yap'].

View File

@ -97,9 +97,10 @@
set_prolog_flag(debug, false),
% simple trick to find out if this is we are booting from Prolog.
% boot from a saved state
'$init_from_saved_state_and_args', %start_low_level_trace,
writeln(ok),
'$init_from_saved_state_and_args', %start_low_level_trace,
'$db_clean_queues'(0),
'$db_clean_queues'(_),
% this must be executed from C-code.
% '$startup_saved_state',
set_input(user_input),
@ -186,7 +187,7 @@
get_value('$consult_on_boot',X), X \= [],
set_value('$consult_on_boot',[]),
'$do_startup_reconsult'(X),
fail.
!.
'$init_from_saved_state_and_args' :-
recorded('$restore_flag', init_file(M:B), R),
erase(R),

View File

@ -82,8 +82,8 @@ Saves an image of the current state of the YAP database in file
trying goal _G_.
**/
qsave_program(File) :-
'$save_program_status'([], qsave_program(File)),
open(File, write, S, [type(binary)]),
'$save_program_status'([], qsave_program(File)),
open(File, write, S, [type(binary)]),
'$qsave_program'(S),
close(S).