File mingw-objdump-srcfiles of Package mingw32-filesystem
#!/bin/bash
# SPDX-FileCopyrightText: 2022 Jan Engelhardt <jengelh@inai.de>
# SPDX-FileCopyrightText: 2022,2026 Ralf Habacker <ralf.habacker@freenet.de>
# SPDX-License-Identifier: GPL-2.0-or-later
# get source and header filenames from dwarf debug sections
DLL="$1" # first arg = DLL/EXE file
BUILD_ROOT="$2" # second arg = root of build tree
i686-w64-mingw32-objdump -WL "$DLL" \
| grep ':$' \
| sed 's/:$//' \
| grep -E '\.c$|\.cpp$|\.h$' \
| while read f; do
if [[ "$f" != /* ]]; then
echo "$BUILD_ROOT/$f"
else
echo "$f"
fi
done | sort -u