]> git.ipfire.org Git - thirdparty/elfutils.git/commit
src/readelf.c: Add support for print_debug_* output buffering
authorAaron Merey <amerey@redhat.com>
Tue, 5 Aug 2025 03:20:53 +0000 (23:20 -0400)
committerAaron Merey <amerey@redhat.com>
Tue, 12 Aug 2025 13:27:09 +0000 (09:27 -0400)
commitf74cf4b240a581312a4ba107d137cdbb80b68735
treecf677983ae52f6b501f342dd0feb822301f1d1c1
parent28b8e2b0f9b80a63743be2e73058449abc7f17bc
src/readelf.c: Add support for print_debug_* output buffering

Safely handle stdout output during concurrent calls to print_debug_*
functions.

For any print_debug_* function and any function that could be called
from print_debug_* which also prints to stdout: add a FILE * argument
and replace all printf, puts, putchar with fprintf.  All printing
to stdout will now be written to this FILE instead.

The FILE * is an interface to a per-thread dynamically-sized buffer.
libthread.a manages the allocation, printing and deallocation of
these buffers.

Signed-off-by: Aaron Merey <amerey@redhat.com>
src/readelf.c