zephyr/lib/os
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
..
assert.c includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
base64.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
bitarray.c lib: bitarray: Remove dead statement 2022-06-06 22:46:37 +02:00
cbprintf.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
cbprintf_complete.c coding guidelines: comply with MISRA C:2012 Rule 21.13 2022-06-30 17:34:28 -04:00
cbprintf_nano.c lib: os: cbprint: enable tagged arguments for packaging 2022-06-08 00:15:55 +09:00
cbprintf_packaged.c lib: os: cbprintf: Mechanism for detecting %p in static package 2022-09-19 10:14:23 +00:00
CMakeLists.txt lib/os: Replace cbvprintf and printfcb family when using picolibc 2022-06-27 12:47:25 +02:00
crc7_sw.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
crc8_sw.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
crc16_sw.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
crc32_sw.c coding guidelines: comply with MISRA C:2012 Rule 7.2 2022-06-14 13:36:14 -04:00
crc32c_sw.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
dec.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
fdtable.c lib: os: Fix warning on XCC 2022-07-25 17:07:11 -04:00
heap-validate.c lib/os: use generic mem stats structure for heap 2022-07-12 13:59:26 +00:00
heap.c arch/posix: Add MemorySanitizer support 2022-08-19 08:30:01 +02:00
heap.h sys: heap: support maximum allocated bytes statistic 2022-04-13 13:27:28 -07:00
heap_listener.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
hex.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
json.c lib: os: Extend Json library API and type update 2022-06-06 12:06:43 +02:00
Kconfig lib: os: disable PRINTK_SYNC while using EFI console as log backend 2022-08-11 12:17:24 +02:00
Kconfig.cbprintf lib: os: cbprintf: Mechanism for detecting %p in static package 2022-09-19 10:14:23 +00:00
Kconfig.heap lib/os: add statistics tracking to mem_blocks 2022-07-12 13:59:26 +00:00
mem_blocks.c includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
mpsc_pbuf.c lib: mpsc_pbuf: Fix compilation unused-but-set-variable warning 2022-06-06 22:47:11 +02:00
multi_heap.c lib: add mising braces to single line if statements 2022-07-06 11:00:45 -04:00
mutex.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
notify.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
onoff.c lib: os: Remove unneeded assignment 2022-06-23 15:43:59 -05:00
p4wq.c p4wq: register log module with default log level 2022-05-17 20:39:25 -04:00
printk.c lib/printk: Use picolibc's vfprintf instead of cbvprintf 2022-06-24 20:30:03 +02:00
rb.c lib: rb: Remove unneeded statement 2022-06-05 14:49:37 +02:00
reboot.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
ring_buffer.c lib: ring_buf: Make code consistent 2022-06-06 22:46:43 +02:00
sem.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
shared_multi_heap.c includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
spsc_pbuf.c includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
thread_entry.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
timeutil.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
user_work.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
utf8.c zephyr: Fix n=0 for utf8_lcpy 2022-07-04 15:49:22 +02:00
winstream.c lib/os: winstream: properly include string.h for memcpy 2022-06-21 14:02:13 -04:00