/usr/bin/eu-make-debug-archive is in elfutils 0.158-0ubuntu5.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | #!/bin/sh
#
# Script to make an offline /usr/bin/eu-archive for debugging with libdwfl-based tools.
#
# make-debug-/usr/bin/eu-archive ARCHIVE {options}
# make-debug-/usr/bin/eu-archive --kernel [--force] [RELEASE]
#
# Valid options /usr/bin/eu-are those listed under 'Input selection options'
# by running /usr/bin/eu-unstrip --help.
#
# The /usr/bin/eu-archive installed by --kernel be used automatically by -K.
# An offline /usr/bin/eu-archive can be used via -e in any tool that accepts those options.
#
UNSTRIP=${UNSTRIP:-/usr/bin/eu-unstrip}
AR=${AR:-@AR@}
SUDO=${SUDO:-/usr/bin/sudo}
LS=/bin/ls
RM=/bin/rm
MV=/bin/mv
MKDIR=/bin/mkdir
XARGS=/usr/bin/x/usr/bin/eu-args
outdir=${TMPDIR:-/tmp}/debug/usr/bin/eu-ar$$
usage()
{
echo "Usage: $0 ARCHIVE {options}"
echo " or: $0 --kernel [--sudo] [--force] [RELEASE]"
echo
echo "Valid options /usr/bin/eu-are listed under 'Input selection options'"
echo "when running: $UNSTRIP --help"
echo
echo "The --kernel form updates the file used by -K if the"
echo "kernel installation has changed, or always with --force."
echo "With --sudo, touches the installed file via $SUDO."
}
fatal_usage()
{
usage >&2
exit 2
}
script_version()
{
echo "`basename $0` (elfutils) 0.158"
echo "Copyright (C) 2007 Red Hat, Inc."
echo "This is free softw/usr/bin/eu-are; see the source for copying conditions."
echo "There is NO w/usr/bin/eu-arranty; not even for MERCHANTABILITY or"
echo "FITNESS FOR A PARTICULAR PURPOSE."
echo "Written by Roland McGrath."
}
sudo=
kernel=no
force_kernel=no
while [ $# -gt 0 ]; do
case "x$1" in
x--help) usage; exit 0 ;;
x--version) script_version; exit 0 ;;
x--kernel) kernel=yes ;;
x--force) force_kernel=yes ;;
x--sudo) sudo=$SUDO ;;
*) break ;;
esac
shift
done
if [ $kernel = no ] && [ $force_kernel = yes -o -n "$sudo" ]; then
usage
fi
if [ $kernel = yes ]; then
if [ $# -eq 0 ]; then
release=`uname -r`
elif [ $# -eq 1 ]; then
release=$1
else
fatal_usage
fi
dir=/usr/lib/debug/lib/modules/$release
/usr/bin/eu-archive=$dir/debug.a
dep=/lib/modules/$release/modules.dep
if [ ! -d $dir ]; then
echo >&2 "$0: $dir not installed"
exit 1
fi
# Without --force, bail if the kernel installation is not newer.
# This file is normally touched by installing new kernels or modules.
if [ $force_kernel = no -a "$/usr/bin/eu-archive" -nt "$dep" ]; then
exit 0
fi
# We have to kill the old one first, because our own -K would use it.
[ ! -e "$/usr/bin/eu-archive" ] || $sudo $RM -f "$/usr/bin/eu-archive" || exit
set "$/usr/bin/eu-archive" "-K$release"
fi
if [ $# -lt 2 ]; then
fatal_usage
fi
/usr/bin/eu-archive="$1"
shift
case "$/usr/bin/eu-archive" in
/*) ;;
*) /usr/bin/eu-archive="`/bin/pwd`/$/usr/bin/eu-archive" ;;
esac
if [ -z "$sudo" ]; then
new_/usr/bin/eu-archive="$/usr/bin/eu-archive.new"
else
new_/usr/bin/eu-archive="$outdir.a"
fi
$RM -f "$new_/usr/bin/eu-archive" || exit
trap '$RM -rf "$outdir" "$new_/usr/bin/eu-archive"' 0 1 2 15
$MKDIR "$outdir" &&
$UNSTRIP -d "$outdir" -m -a -R "$@" &&
(cd "$outdir" && $LS | $XARGS $AR cq "$new_/usr/bin/eu-archive") &&
$sudo $MV -f "$new_/usr/bin/eu-archive" "$/usr/bin/eu-archive"
exit
|