zephyr/tests/lib/cbprintf_package
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
..
src lib: os: cbprintf: Mechanism for detecting %p in static package 2022-09-19 10:14:23 +00:00
CMakeLists.txt tests: lib: cbprintf_package: Rework C++ test 2022-03-10 14:03:52 -05:00
README
prj.conf ztest API Migration: lib/cbprintf_package 2022-04-24 19:47:18 +02:00
testcase.yaml tests: Add picolibc tests for cbprintf 2022-06-27 12:47:25 +02:00

README