opnsense-src/share
Olivier Certner 64ca7e040a
queue(3): Debug macros: Finer control knobs, userland support
Support enabling debugging macros for userland and _STANDALONE builds,
in addition to the already existing kernel support.  On runtime error,
panic() is used for kernel and _STANDALONE builds, and a simple
fprintf() + abort() combination for userland ones.  These can be
overriden if needed by defining the QMD_PANIC() and/or QMD_ASSERT()
macros.

The expansion of queue debug macros can now be controlled more finely
thanks to the QUEUE_MACRO_DEBUG_ASSERTIONS and
QUEUE_MACRO_NO_DEBUG_ASSERTIONS macros.  The first one serves to
forcibly enable debug code and the second to forcibly disable it.  These
are meant to be used as compile options only, and should normally not be
defined in a source file.  It is an error to have both of them defined.

If none of the two above-mentioned macros are defined, an automatic
determination is performed.  When compiling kernel code,
QUEUE_MACRO_DEBUG_ASSERTIONS is defined if INVARIANTS has been defined
(as before).  For userland and _STANDALONE builds, no debug code is ever
automatically inserted even if NDEBUG is not defined, as doing so would
inflate code size and users may want to have working assert() calls
without this overhead by default.

In the manual page, document check code control under DIAGNOSTICS.
While here, rework a bit the rest of the DIAGNOSTICS section.

Reviewed by:    markj (older version)
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D49973

(cherry picked from commit 1c5fea9e8b563186b8f5773064458c4ecf2d7004)
2025-05-01 21:46:38 +02:00
..
colldef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
colldef_unicode Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ctypedef ctypedef: Remove || true from localedef command to reveal error sooner 2024-10-21 12:24:17 +08:00
dict Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
doc iwlwififw: remove Intel iwlwifi firmware from src.git 2025-04-18 14:36:03 +00:00
dtrace ipfw.d: Add required dependency declarations 2024-12-23 16:51:33 +00:00
examples release: use "runtime" instead of "minimal" for OCI image name 2025-04-30 07:55:41 +00:00
i18n Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
keys Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
man queue(3): Debug macros: Finer control knobs, userland support 2025-05-01 21:46:38 +02:00
misc bsd-family-tree: add OpenBSD 7.7 release 2025-05-01 12:34:30 -04:00
mk Move extra suffix-transformation rules into bsd.suffixes-extra.mk 2025-04-26 13:29:47 +02:00
monetdef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
monetdef_unicode Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
msgdef msgdef: fix NO and SI locales 2023-11-28 14:12:11 +07:00
msgdef_unicode Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
numericdef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
numericdef_unicode Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
security Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
sendmail Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
skel Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
snmp Remove $FreeBSD$: two-line lua tag 2023-08-16 11:55:30 -06:00
syscons Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tabset Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
termcap termcap: add entry for Alacritty 2025-04-30 10:03:27 +02:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
timedef timedef: remove redundancy in Catalan date_fmt definitions 2024-11-21 22:52:06 -06:00
vt keymaps: add map for some Lenovo laptops found in Brazillian market 2025-04-22 08:10:47 -03:00
zoneinfo zoneinfo: also install tzdata.zi and version 2025-05-01 08:51:12 +08:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00