]> git.ipfire.org Git - thirdparty/elfutils.git/commit
src/readelf.c: Add support for print_debug_* output buffering
authorAaron Merey <amerey@redhat.com>
Mon, 30 Jun 2025 03:51:57 +0000 (23:51 -0400)
committerAaron Merey <amerey@redhat.com>
Thu, 3 Jul 2025 18:18:03 +0000 (14:18 -0400)
commit2667a6e05b1c669953f6843a2f447e6b3b692047
tree6bf297bd9076f3e779bc7974dccbdc06953bfba3
parent0b0d812f793e0f926420eea4534e8728170f11e0
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