mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-16 17:19:41 +00:00
cf97132764
Add a new command-line option '-module-assertions' that users can enable developing or debugging a module. If this option is present, Emacs performs additional checks to verify that modules fulfill their requirements. These checks are expensive and crash Emacs if modules are invalid, so disable them by default. This is a command-line option instead of an ordinary variable because changing it while Emacs is running would cause data structure imbalances. * src/emacs.c (main): New command line option '-module-assertions'. * src/emacs-module.c (module_assert_main_thread) (module_assert_runtime, module_assert_env, module_assert_value): New functions to assert module requirements. (syms_of_module): New uninterned variable 'module-runtimes'. (init_module_assertions, in_main_thread, module_abort): New helper functions. (initialize_environment): Initialize value list. If assertions are enabled, use a heap-allocated environment object. (finalize_environment): Add assertion that environment list is never empty. (finalize_runtime_unwind): Pop module runtime object stack. (value_to_lisp): Assert that the value is valid. (lisp_to_value): Record new value if assertions are enabled. (mark_modules): Mark allocated object list. (MODULE_FUNCTION_BEGIN_NO_CATCH) (module_non_local_exit_check, module_non_local_exit_clear) (module_non_local_exit_get, module_non_local_exit_signal) (module_non_local_exit_throw): Assert thread and environment. (module_get_environment): Assert thread and runtime. (module_make_function, module_funcall, module_intern) (module_funcall, module_make_integer, module_make_float) (module_make_string, module_make_user_ptr, module_vec_get) (funcall_module, Fmodule_load): Adapt callers. (module_make_global_ref): If assertions are enabled, use the global environment to store global values. (module_free_global_ref): Remove value from global value list. * test/Makefile.in (EMACSOPT): Enable module assertions when testing modules. * test/data/emacs-module/mod-test.c (Fmod_test_invalid_store) (Fmod_test_invalid_load): New functions to test module assertions. (emacs_module_init): Bind the new functions. * test/src/emacs-module-tests.el (mod-test-emacs): New constant for the Emacs binary file. (mod-test-file): New constant for the test module file name. (module--test-assertions): New unit test. |
||
---|---|---|
.. | ||
charsets | ||
e | ||
forms | ||
gnus | ||
images | ||
nxml | ||
org | ||
refcards | ||
schema | ||
srecode | ||
themes | ||
tutorials | ||
AUTHORS | ||
CALC-NEWS | ||
CENSORSHIP | ||
ChangeLog.1 | ||
compilation.txt | ||
COPYING | ||
DEBUG | ||
DEVEL.HUMOR | ||
DISTRIB | ||
edt-user.el | ||
emacs-buffer.gdb | ||
emacs.appdata.xml | ||
emacs.desktop | ||
emacs.icon | ||
emacs.service | ||
enriched.txt | ||
ERC-NEWS | ||
ETAGS.EBNF | ||
ETAGS.README | ||
FTP | ||
future-bug | ||
GNU | ||
GNUS-NEWS | ||
gnus-tut.txt | ||
grep.txt | ||
HELLO | ||
HISTORY | ||
JOKES | ||
LINUX-GNU | ||
MACHINES | ||
MH-E-NEWS | ||
MORE.STUFF | ||
NEWS | ||
NEWS.1-17 | ||
NEWS.18 | ||
NEWS.19 | ||
NEWS.20 | ||
NEWS.21 | ||
NEWS.22 | ||
NEWS.23 | ||
NEWS.24 | ||
NEWS.25 | ||
NEXTSTEP | ||
NXML-NEWS | ||
ORDERS | ||
ORG-NEWS | ||
package-keyring.gpg | ||
PROBLEMS | ||
ps-prin0.ps | ||
ps-prin1.ps | ||
publicsuffix.txt | ||
README | ||
rgb.txt | ||
ses-example.ses | ||
spook.lines | ||
TERMS | ||
THE-GNU-PROJECT | ||
TODO | ||
WHY-FREE | ||
yow.lines |
This directory contains the architecture-independent files used by or with Emacs. This includes some text files of documentation for GNU Emacs or of interest to Emacs users, and the file of dumped docstrings for Emacs functions and variables. COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES File: emacs.icon Author: Sun Microsystems, Inc Copyright (C) 1999, 2001-2017 Free Software Foundation, Inc. License: GNU General Public License version 3 or later (see COPYING)