sieve: provide a separate stream for debugging output
* include/mailutils/sieve.h (MU_SIEVE_DEBUG_TRACE) (MU_SIEVE_DEBUG_INSTR,MU_SIEVE_DEBUG_DISAS) (MU_SIEVE_DRY_RUN): Remove. (mu_sieve_machine_init_ex): Remove proto. (mu_sieve_set_dbg_stream,mu_sieve_get_dbg_stream) (mu_sieve_stream_save) (mu_sieve_stream_restore): New protos. * libmu_sieve/runtime.c (INSTR_DISASS,INSTR_DEBUG): Reimplement. * libmu_sieve/sieve-priv.h (MU_SV_SAVED_ERR_STATE) (MU_SV_SAVED_DBG_STATE,MU_SV_SAVED_STATE): New bitflags. (mu_sieve_state_disass): New constant. (mu_sieve_machine)<state_flags, err_mode> <err_locus,dbg_mode,dbg_locus>: New members. <dbgstream>: New member. * libmu_sieve/sieve.y (mu_sieve_machine_init_ex): Remove. (mu_sieve_machine_dup, mu_sieve_machine_inherit): Fix. (mu_sieve_set_dbg_stream) (mu_sieve_get_dbg_stream): New functions. (mu_sieve_machine_destroy): Destroy dbgstream. (with_machine): Preserve stream state (mode & locus). * libmu_sieve/util.c (mu_i_sv_debug,mu_i_sv_debug_command): Use ioctl instead of format strings. (mu_sieve_stream_save, mu_sieve_stream_restore): New functions. * python/libmu_py/sieve.c (api_sieve_machine_init): Use mu_sieve_machine_init. * sieve/sieve.c: Improve help output. (main): Dump disassembled code to standard output.
Showing
8 changed files
with
250 additions
and
135 deletions
-
Please register or sign in to post a comment