Remove internal debugedit
Do not build internal debugedit and its tests. Debugedit is now external package.
This commit is contained in:
parent
89e3f8b764
commit
3a74c95016
@ -8,7 +8,7 @@ EXTRA_DIST = CHANGES CREDITS Doxyheader GROUPS INSTALL \
|
||||
po/*.in po/*.po po/rpm.pot \
|
||||
rpmpopt-$(VERSION) rpmqv.c
|
||||
|
||||
SUBDIRS = po rpmio rpmdb lib build @WITH_PYTHON_SUBDIR@ tools scripts doc tests .
|
||||
SUBDIRS = po rpmio rpmdb lib build @WITH_PYTHON_SUBDIR@ tools scripts doc .
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/build \
|
||||
|
@ -10,7 +10,6 @@ AC_PREREQ(2.13)
|
||||
AC_CONFIG_SRCDIR(rpmqv.c)
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AM_INIT_AUTOMAKE([1.4 foreign])
|
||||
AC_CONFIG_TESTDIR(tests)
|
||||
|
||||
dnl XXX AM_MAINTAINER_MODE
|
||||
|
||||
@ -926,8 +925,6 @@ AC_SUBST(RPM)
|
||||
|
||||
AC_SUBST(OBJDUMP)
|
||||
|
||||
AC_PATH_PROG(AUTOM4TE,autom4te,:)
|
||||
|
||||
dnl XXX this causes popt to depend on zlib et al
|
||||
dnl # XXX Propagate -lucb to popt ...
|
||||
dnl export LIBS INCPATH CONFIG_SITE
|
||||
@ -935,7 +932,6 @@ dnl export LIBS INCPATH CONFIG_SITE
|
||||
AC_OUTPUT([ Doxyfile Makefile rpmrc macros platform rpmpopt
|
||||
rpmio/Makefile rpmdb/Makefile lib/Makefile build/Makefile
|
||||
autodeps/linux.prov autodeps/linux.req tools/Makefile
|
||||
tests/Makefile
|
||||
scripts/Makefile
|
||||
scripts/brp-adjust_libraries
|
||||
scripts/brp-alt
|
||||
|
@ -89,9 +89,6 @@ Source: rpm-%version-%release.tar
|
||||
BuildPreReq: automake >= 1.7.1, autoconf >= 2.53, libbeecrypt-devel >= 4.2.1
|
||||
BuildPreReq: rpm >= 3.0.6-ipl24mdk, %_bindir/subst
|
||||
|
||||
# For debugedit.
|
||||
BuildPreReq: elfutils-devel
|
||||
BuildRequires: librpm-devel
|
||||
BuildRequires: debugedit
|
||||
|
||||
# Automatically added by buildreq on Thu Apr 23 2009 and edited manually.
|
||||
@ -347,7 +344,6 @@ mv -T %buildroot%_rpmlibdir/{,build}macros
|
||||
%_bindir/relative
|
||||
%_rpmlibdir/rpmt
|
||||
%rpmattr %_rpmlibdir/rpmb
|
||||
%rpmattr %_rpmlibdir/debugedit
|
||||
%rpmattr %_rpmlibdir/debuginfo.*
|
||||
%rpmattr %_rpmlibdir/dump_ld_config
|
||||
%rpmattr %_rpmlibdir/filesize
|
||||
|
@ -1,43 +0,0 @@
|
||||
AM_CFLAGS = @RPMCFLAGS@
|
||||
|
||||
EXTRA_DIST =
|
||||
CLEANFILES =
|
||||
|
||||
TESTSUITE = $(srcdir)/rpmtests
|
||||
|
||||
## testsuite components
|
||||
TESTSUITE_AT = rpmtests.at
|
||||
TESTSUITE_AT += debugedit.at
|
||||
|
||||
# testsuite voodoo
|
||||
AUTOTEST = $(AUTOM4TE) --language=autotest
|
||||
$(TESTSUITE): $(srcdir)/package.m4 local.at $(TESTSUITE_AT)
|
||||
$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
|
||||
mv $@.tmp $@
|
||||
|
||||
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
|
||||
@{ \
|
||||
echo '# Signature of the current package.'; \
|
||||
echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
|
||||
echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
|
||||
echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
|
||||
echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
|
||||
echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
|
||||
} >'$(srcdir)/package.m4'
|
||||
|
||||
atconfig: ${top_builddir}/config.status
|
||||
(cd ${top_builddir} && ./config.status ${subdir}/atconfig)
|
||||
|
||||
local.at:
|
||||
@echo 'AT_INIT' > local.at
|
||||
|
||||
check_DATA = atconfig $(TESTSUITE)
|
||||
|
||||
check-local: $(check_DATA)
|
||||
PATH=$(srcdir)/tools:$(PATH) $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
|
||||
|
||||
clean-local:
|
||||
test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' --clean
|
||||
rm -f *.tmp
|
||||
if [ -d testing ]; then chmod -R u+w testing/; fi
|
||||
rm -rf testing
|
@ -1,20 +0,0 @@
|
||||
#include "foobar.h"
|
||||
|
||||
struct debug_types_section1 var_bar1;
|
||||
|
||||
/* Use different DW_AT_stmt_list in .debug_types having it outside foobar.h.
|
||||
Also use two types in .debug_types for multiple COMDAT sections in object
|
||||
files. */
|
||||
struct debug_types_section_bar
|
||||
{
|
||||
int stringp_bar, stb;
|
||||
};
|
||||
struct debug_types_section_bar var_bar;
|
||||
|
||||
int number = NUMBER;
|
||||
|
||||
int
|
||||
bar (int n)
|
||||
{
|
||||
return n - NUMBER;
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
#include "foobar.h"
|
||||
|
||||
struct debug_types_section1 var_baz1;
|
||||
|
||||
/* Use different DW_AT_stmt_list in .debug_types having it outside foobar.h.
|
||||
Also use two types in .debug_types for multiple COMDAT sections in object
|
||||
files. */
|
||||
struct debug_types_section_baz
|
||||
{
|
||||
int stringp_baz, stz;
|
||||
};
|
||||
struct debug_types_section_baz var_baz;
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int res;
|
||||
res = foo ();
|
||||
res = bar (res);
|
||||
return res + number - NUMBER;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
#include "foobar.h"
|
||||
|
||||
struct debug_types_section1 var_foo1;
|
||||
|
||||
/* Use different DW_AT_stmt_list in .debug_types having it outside foobar.h.
|
||||
Also use two types in .debug_types for multiple COMDAT sections in object
|
||||
files. */
|
||||
struct debug_types_section_foo
|
||||
{
|
||||
int stringp_foo, stf;
|
||||
};
|
||||
struct debug_types_section_foo var_foo;
|
||||
|
||||
int
|
||||
foo ()
|
||||
{
|
||||
return number;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
#define NUMBER 42
|
||||
|
||||
extern int number;
|
||||
|
||||
extern int foo (void);
|
||||
extern int bar (int);
|
||||
|
||||
struct debug_types_section1
|
||||
{
|
||||
/* Test both DW_FORM_strp and DW_FORM_string. */
|
||||
int stringp1, st1;
|
||||
};
|
@ -1,488 +0,0 @@
|
||||
# debugedit.at: Tests for the debugedit tool
|
||||
#
|
||||
# Copyright (C) 2019 Mark J. Wielaard <mark@klomp.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Tests for the tools/debugedit program.
|
||||
AT_BANNER([RPM debugedit])
|
||||
|
||||
# Show which debugedit binary we are testing.
|
||||
AT_TESTED([debugedit])
|
||||
|
||||
# Helper to create some test binaries.
|
||||
# Optional parameter can specify additional gcc parameters.
|
||||
m4_define([RPM_DEBUGEDIT_SETUP],[[
|
||||
# Create some test binaries. Create and build them in different subdirs
|
||||
# to make sure they produce different relative/absolute paths.
|
||||
|
||||
export HOME=${PWD}
|
||||
mkdir subdir_foo
|
||||
cp "${abs_srcdir}"/data/SOURCES/foo.c subdir_foo
|
||||
mkdir subdir_bar
|
||||
cp "${abs_srcdir}"/data/SOURCES/bar.c subdir_bar
|
||||
mkdir subdir_headers
|
||||
cp "${abs_srcdir}"/data/SOURCES/foobar.h subdir_headers
|
||||
cp "${abs_srcdir}"/data/SOURCES/baz.c .
|
||||
|
||||
# First three object files (foo.o subdir_bar/bar.o and baz.o)
|
||||
gcc -g3 -Isubdir_headers $1 -c subdir_foo/foo.c
|
||||
cd subdir_bar
|
||||
gcc -g3 -I../subdir_headers $1 -c bar.c
|
||||
cd ..
|
||||
gcc -g3 -I$(pwd)/subdir_headers $1 -c $(pwd)/baz.c
|
||||
|
||||
# Then a partially linked object file (somewhat like a kernel module).
|
||||
# This will still have relocations between the debug sections.
|
||||
ld -r -o foobarbaz.part.o foo.o subdir_bar/bar.o baz.o
|
||||
|
||||
# Create an executable. Relocations between debug sections will
|
||||
# have been resolved.
|
||||
gcc -g3 -o foobarbaz.exe foo.o subdir_bar/bar.o baz.o
|
||||
eu-elfcompress -t none foo.o subdir_bar/bar.o baz.o
|
||||
]])
|
||||
|
||||
# ===
|
||||
# Check debugedit --help doesn't crash and burn.
|
||||
# ===
|
||||
AT_SETUP([debugedit help])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
AT_CHECK([debugedit --help],[0],[ignore],[ignore])
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# Make sure that an executable still runs after debugedit munged it.
|
||||
# ===
|
||||
AT_SETUP([debugedit executable])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
AT_CHECK([[./foobarbaz.exe]])
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
|
||||
AT_CHECK([[./foobarbaz.exe]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# debugedit should at least replace the .debug_str directory paths
|
||||
# in the objects.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_str objects])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
# Capture strings that start with the testdir (pwd) directory path
|
||||
# (and replace that textually with /foo/bar/baz)
|
||||
readelf -p.debug_str foo.o subdir_bar/bar.o baz.o | cut -c13- \
|
||||
| grep ^$(pwd) | sort \
|
||||
| sed -e "s@$(pwd)@/foo/bar/baz@" > expout
|
||||
|
||||
# Make sure there is at least some output
|
||||
expout_lines=$(wc --lines expout | cut -f1 -d\ )
|
||||
if test $expout_lines -lt 3; then
|
||||
echo "Expecting at least 3 debug strings starting with ${testdir}" >> expout
|
||||
fi
|
||||
|
||||
# Check the replaced strings are all there.
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
|
||||
AT_CHECK([[
|
||||
readelf -p.debug_str foo.o subdir_bar/bar.o baz.o | cut -c13- \
|
||||
| grep ^/foo/bar/baz | sort
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# debugedit should at least replace the .debug_str directory paths
|
||||
# also in partially linked files.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_str partial])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
# Capture strings that start with the testdir (pwd) directory path
|
||||
# (and replace that textually with /foo/bar/baz)
|
||||
# Note that partially linked files, might have multiple duplicate
|
||||
# strings, but debugedit will merge them. So use sort -u.
|
||||
readelf -p.debug_str ./foobarbaz.part.o | cut -c13- \
|
||||
| grep ^$(pwd) | sort -u \
|
||||
| sed -e "s@$(pwd)@/foo/bar/baz@" > expout
|
||||
|
||||
# Make sure there is at least some output
|
||||
expout_lines=$(wc --lines expout | cut -f1 -d\ )
|
||||
if test $expout_lines -lt 3; then
|
||||
echo "Expecting at least 3 debug strings starting with ${testdir}" >> expout
|
||||
fi
|
||||
|
||||
# Check the replaced strings are all there.
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
|
||||
AT_CHECK([[
|
||||
readelf -p.debug_str ./foobarbaz.part.o | cut -c13- \
|
||||
| grep ^/foo/bar/baz | sort
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# debugedit should at least replace the .debug_str directory paths
|
||||
# and in the executable.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_str exe])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
# Capture strings that start with the testdir (pwd) directory path
|
||||
# (and replace that textually with /foo/bar/baz)
|
||||
readelf -p.debug_str foobarbaz.exe | cut -c13- \
|
||||
| grep ^$(pwd) | sort \
|
||||
| sed -e "s@$(pwd)@/foo/bar/baz@" > expout
|
||||
|
||||
# Make sure there is at least some output
|
||||
# The linker will have merged unique strings, so no need for sort -u.
|
||||
expout_lines=$(wc --lines expout | cut -f1 -d\ )
|
||||
if test $expout_lines -lt 3; then
|
||||
echo "Expecting at least 3 debug strings starting with ${testdir}" >> expout
|
||||
fi
|
||||
|
||||
# Check the replaced strings are all there.
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
|
||||
AT_CHECK([[
|
||||
readelf -p.debug_str foobarbaz.exe | cut -c13- \
|
||||
| grep ^/foo/bar/baz | sort
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# For .debug_info we expect the following DW_AT_name and DW_AT_comp_dir
|
||||
# strings for the DW_TAG_compile_unit:
|
||||
# - foo.o
|
||||
# DW_AT_name: subdir_foo/foo.c
|
||||
# DW_AT_comp_dir: /foo/baz/baz
|
||||
# - bar.o
|
||||
# DW_AT_name: bar.c
|
||||
# DW_AT_comp_dir: /foo/bar/baz/subdir_bar
|
||||
# - baz.o
|
||||
# DW_AT_name: /foo/bar/baz/baz.c
|
||||
# DW_AT_comp_dir: /foo/baz/baz
|
||||
#
|
||||
# Older gcc (before 7) don't emit the DW_AT_comp_dir for baz.o.
|
||||
# But because it is similar to the comp_dir of foo.o, just sort -u.
|
||||
|
||||
# ===
|
||||
# Make sure DW_AT_name and DW_AT_comp_dir strings are replaced
|
||||
# in objects.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_info objects])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
AT_DATA([expout],
|
||||
[/foo/bar/baz
|
||||
/foo/bar/baz/baz.c
|
||||
/foo/bar/baz/subdir_bar
|
||||
])
|
||||
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
|
||||
AT_CHECK([[
|
||||
readelf --debug-dump=info foo.o subdir_bar/bar.o baz.o \
|
||||
| grep -E 'DW_AT_(name|comp_dir)' \
|
||||
| rev | cut -d: -f1 | rev | cut -c2- | grep ^/foo/bar/baz | sort -u
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# Make sure DW_AT_name and DW_AT_comp_dir strings are replaced
|
||||
# in partial linked object.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_info partial])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
AT_DATA([expout],
|
||||
[/foo/bar/baz
|
||||
/foo/bar/baz/baz.c
|
||||
/foo/bar/baz/subdir_bar
|
||||
])
|
||||
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
|
||||
AT_CHECK([[
|
||||
readelf --debug-dump=info ./foobarbaz.part.o \
|
||||
| grep -E 'DW_AT_(name|comp_dir)' \
|
||||
| rev | cut -d: -f1 | rev | cut -c2- | grep ^/foo/bar/baz | sort -u
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# Make sure DW_AT_name and DW_AT_comp_dir strings are replaced
|
||||
# in executable.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_info exe])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
AT_DATA([expout],
|
||||
[/foo/bar/baz
|
||||
/foo/bar/baz/baz.c
|
||||
/foo/bar/baz/subdir_bar
|
||||
])
|
||||
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
|
||||
AT_CHECK([[
|
||||
readelf --debug-dump=info ./foobarbaz.exe | grep -E 'DW_AT_(name|comp_dir)' \
|
||||
| rev | cut -d: -f1 | rev | cut -c2- | grep ^/foo/bar/baz | sort -u
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# Make sure -fdebug-types-section has updated strings in objects.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_types objects])
|
||||
AT_KEYWORDS([debugtypes] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP([-fdebug-types-section])
|
||||
|
||||
AT_DATA([expout],
|
||||
[st1
|
||||
stf
|
||||
stringp1
|
||||
stringp_foo
|
||||
st1
|
||||
stb
|
||||
stringp1
|
||||
stringp_bar
|
||||
st1
|
||||
stringp1
|
||||
stringp_baz
|
||||
stz
|
||||
])
|
||||
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
|
||||
AT_CHECK([[
|
||||
for i in ./foo.o ./subdir_bar/bar.o ./baz.o;do \
|
||||
readelf --debug-dump=info $i \
|
||||
| awk '/Abbrev Number:.*DW_TAG_type_unit/{p=1}{if(p)print}/^$/{p=0}' \
|
||||
| sed -n 's/^.*> *DW_AT_name *:.* \(stringp[^ ]*\|st.\)$/\1/p' \
|
||||
| sort;
|
||||
done
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# Make sure -fdebug-types-section has updated strings in partial linked object.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_types partial])
|
||||
AT_KEYWORDS([debugtypes] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP([-fdebug-types-section])
|
||||
|
||||
AT_DATA([expout],
|
||||
[st1
|
||||
stb
|
||||
stf
|
||||
stringp1
|
||||
stringp_bar
|
||||
stringp_baz
|
||||
stringp_foo
|
||||
stz
|
||||
])
|
||||
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
|
||||
AT_CHECK([[
|
||||
readelf --debug-dump=info ./foobarbaz.part.o \
|
||||
| awk '/Abbrev Number:.*DW_TAG_type_unit/{p=1}{if(p)print}/^$/{p=0}' \
|
||||
| sed -n 's/^.*> *DW_AT_name *:.* \(stringp[^ ]*\|st.\)$/\1/p' \
|
||||
| sort
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# Make sure -fdebug-types-section has updated strings in executable.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_types exe])
|
||||
AT_KEYWORDS([debugtypes] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP([-fdebug-types-section])
|
||||
|
||||
AT_DATA([expout],
|
||||
[st1
|
||||
stb
|
||||
stf
|
||||
stringp1
|
||||
stringp_bar
|
||||
stringp_baz
|
||||
stringp_foo
|
||||
stz
|
||||
])
|
||||
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
|
||||
AT_CHECK([[
|
||||
readelf --debug-dump=info ./foobarbaz.exe \
|
||||
| awk '/Abbrev Number:.*DW_TAG_type_unit/{p=1}{if(p)print}/^$/{p=0}' \
|
||||
| sed -n 's/^.*> *DW_AT_name *:.* \(stringp[^ ]*\|st.\)$/\1/p' \
|
||||
| sort
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# foo.o and bar.o are build with relative paths and so will use the
|
||||
# comp_dir (from .debug_info). But bar.o is build from sources with
|
||||
# an absolute path, so the .debug_line Directory Table should contain
|
||||
# /foo/bar/baz and /foo/bar/baz/subdir_headers.
|
||||
|
||||
# ===
|
||||
# Make sure .debug_line Directory Table entries are replaced
|
||||
# in objects.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_line objects])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
AT_DATA([expout],
|
||||
[/foo/bar/baz
|
||||
/foo/bar/baz/subdir_headers
|
||||
])
|
||||
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
|
||||
AT_CHECK([[
|
||||
readelf --debug-dump=line foo.o subdir_bar/bar.o baz.o \
|
||||
| grep -A3 "The Directory Table" | grep "^ [123]" \
|
||||
| grep /foo/ | cut -c5- | sort
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# Make sure .debug_line Directory Table entries are replaced
|
||||
# in partial linked object.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_line partial])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
AT_DATA([expout],
|
||||
[/foo/bar/baz
|
||||
/foo/bar/baz/subdir_headers
|
||||
])
|
||||
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
|
||||
AT_CHECK([[
|
||||
readelf --debug-dump=line ./foobarbaz.part.o \
|
||||
| grep -A3 "The Directory Table" | grep "^ [123]" \
|
||||
| grep /foo/ | cut -c5- | sort
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# Make sure .debug_line Directory Table entries are replaced
|
||||
# in executable.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_line exe])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
AT_DATA([expout],
|
||||
[/foo/bar/baz
|
||||
/foo/bar/baz/subdir_headers
|
||||
])
|
||||
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
|
||||
AT_CHECK([[
|
||||
readelf --debug-dump=line ./foobarbaz.exe \
|
||||
| grep -A3 "The Directory Table" | grep "^ [123]" \
|
||||
| grep /foo/ | cut -c5- | sort
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# Make sure .debug_macro strings are still there
|
||||
# in objects.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_macro objects])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
# We expect 3 for each compile unit.
|
||||
AT_DATA([expout],
|
||||
[NUMBER 42
|
||||
NUMBER 42
|
||||
NUMBER 42
|
||||
])
|
||||
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foo.o]])
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
|
||||
AT_CHECK([[
|
||||
readelf --debug-dump=macro foo.o subdir_bar/bar.o baz.o \
|
||||
| grep NUMBER | rev | cut -d: -f1 | rev | cut -c2-
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# Make sure .debug_macro strings are still there
|
||||
# in partial linked object.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_macro partial])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
# We expect 3 for each compile unit.
|
||||
AT_DATA([expout],
|
||||
[NUMBER 42
|
||||
NUMBER 42
|
||||
NUMBER 42
|
||||
])
|
||||
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
|
||||
AT_CHECK([[
|
||||
readelf --debug-dump=macro ./foobarbaz.part.o \
|
||||
| grep NUMBER | rev | cut -d: -f1 | rev | cut -c2-
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
# ===
|
||||
# Make sure .debug_macro strings are still there
|
||||
# in executable.
|
||||
# ===
|
||||
AT_SETUP([debugedit .debug_macro exe])
|
||||
AT_KEYWORDS([debuginfo] [debugedit])
|
||||
RPM_DEBUGEDIT_SETUP
|
||||
|
||||
# We expect 3 for each compile unit.
|
||||
AT_DATA([expout],
|
||||
[NUMBER 42
|
||||
NUMBER 42
|
||||
NUMBER 42
|
||||
])
|
||||
|
||||
AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
|
||||
AT_CHECK([[
|
||||
readelf --debug-dump=macro ./foobarbaz.exe \
|
||||
| grep NUMBER | rev | cut -d: -f1 | rev | cut -c2-
|
||||
]],[0],[expout])
|
||||
|
||||
AT_CLEANUP
|
@ -1 +0,0 @@
|
||||
m4_include([debugedit.at])
|
@ -28,7 +28,7 @@ noinst_PROGRAMS = \
|
||||
dump dumpdb rpmarchive rpmheader rpmlead rpmsignature setcmp.static
|
||||
|
||||
pkgbindir = @RPMCONFIGDIR@
|
||||
pkgbin_PROGRAMS = filesize dump_ld_config relative mkset setcmp suggest_bpp debugedit # javadeps pdeath_execute
|
||||
pkgbin_PROGRAMS = filesize dump_ld_config relative mkset setcmp suggest_bpp # javadeps pdeath_execute
|
||||
#bin_PROGRAMS = rpmvercmp rpmevrcmp
|
||||
|
||||
javadeps_SOURCES = javadeps.c
|
||||
@ -54,9 +54,6 @@ setcmp_static_LDADD = @LDFLAGS_STATIC@ $(LDADD)
|
||||
suggest_bpp_SOURCES = suggest_bpp.c
|
||||
suggest_bpp_LDADD = -lm $(LDADD)
|
||||
|
||||
debugedit_SOURCES = debugedit.c hashtab.c hashtab.h
|
||||
debugedit_LDADD = @WITH_LIBELF_LIB@ @LIBBEECRYPT@ @LIBPOPT@ @WITH_LIBDW_LIB@ @WITH_LIBRPMIO_LIB@
|
||||
|
||||
rpmvercmp_SOURCES = rpmvercmp.c
|
||||
|
||||
rpmevrcmp_SOURCES = rpmevrcmp.c
|
||||
|
3090
tools/debugedit.c
3090
tools/debugedit.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user