zephyr/tests
Krzysztof Chruscinski a7224830ce lib: os: cbprintf: Mechanism for detecting %p in static package
Static packaging is using only argument types to build a package. There
is one case where analysing argument type only is not enough to
determine package content. That is %p with (unsigned) char pointer vs
%s. In case of %s a string might need to be appended to the package
and in case of %p it must be avoided. Format string analysis is required
to distinguish those two cases.
In order to speed up the runtime inspection, additional information is
added to a static package. That is index of the string argument (where
first argument has index 0). This information allows quick format string
inspection where nth format specifier is found and checked if it is a
pointer format specifier.
Inspection algorithm is added to cbprintf_package_convert() and if %p
is found then data for that argument is discarded. Additionally, log
warning is printed with suggestion to cast pointer argument to void *
to avoid confusion. It is desired to get rid of this ambiguity because
there are going to be logging configurations where strings are stripped
from a binary and runtime inspection cannot be performed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-09-19 10:14:23 +00:00
..
application_development tests: application_development: move the gen inc file test to new ztest 2022-09-09 10:17:29 -05:00
arch boards: arm: stm32l562e_dk_ns: Add flash partitions 2022-09-09 16:40:20 +00:00
benchmarks ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
bluetooth tests: Bluetooth: Mesh: add adv tx complete cb tests 2022-09-15 16:30:34 +00:00
boards tests: Enable the pca9555 chip on mec172xevb_assy6906 2022-09-13 08:54:25 +00:00
boot/uefi includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
cmake/config_dir cmake: APPLICATION_CONFIG_DIR support implemented 2021-11-10 08:25:36 -05:00
crypto includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
drivers tests: driver: gpio: fix the incorrect testsuite names 2022-09-19 09:34:36 +00:00
kernel tests/kernel/smp: Correct parameter name 2022-09-19 09:19:02 +02:00
lib lib: os: cbprintf: Mechanism for detecting %p in static package 2022-09-19 10:14:23 +00:00
misc tests: misc: move the kconfig options test to new ztest API 2022-09-09 10:17:29 -05:00
net tests: net: bridge: exclude mg100 and pinnacle_100_dvk 2022-09-15 11:58:23 +01:00
posix ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
subsys tests: logging: log_stack: Adjust stack usage for x86 2022-09-19 10:14:23 +00:00
unit tests: unit: cbprintf: Disable logging 2022-09-19 10:14:23 +00:00
ztest ztest: Fix unused variable compile error in shuffle function 2022-09-14 20:13:46 -04:00