3.18.0.RC1

This commit is contained in:
Mark Wielaard 2021-10-13 14:49:54 +02:00
parent f531747bcb
commit 103a632efa
20 changed files with 15 additions and 10085 deletions

View File

@ -1,41 +0,0 @@
From 6da22a4d246519cd1a638cfc7eff00cdd74413c4 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Fri, 16 Jul 2021 21:37:21 +0200
Subject: [PATCH] gdbserver_tests: update filters for newer glibc/gdb
With newer glibc/gdb we might see a __select call without anything
following on the line. Also when gdb cannot find a file it might
now print "Inappropriate ioctl for device" instead of the message
"No such file or directory"
---
gdbserver_tests/filter_gdb | 1 +
gdbserver_tests/filter_vgdb | 1 +
2 files changed, 2 insertions(+)
diff --git a/gdbserver_tests/filter_gdb b/gdbserver_tests/filter_gdb
index 3bcd26d86..4a5b5d7a5 100755
--- a/gdbserver_tests/filter_gdb
+++ b/gdbserver_tests/filter_gdb
@@ -111,6 +111,7 @@ s/\(0x........\) in ?? ()$/\1 in syscall .../
# If select.c sources are present, we can also get a line containing:
# return SYSCALL_CANCEL....
s/in __select .*/in syscall .../
+s/in __select$/in syscall .../
/exceptfds/d
/sysv\/linux\/select\.c/d
/return SYSCALL_CANCEL /d
diff --git a/gdbserver_tests/filter_vgdb b/gdbserver_tests/filter_vgdb
index f8028a39a..679ca4b31 100755
--- a/gdbserver_tests/filter_vgdb
+++ b/gdbserver_tests/filter_vgdb
@@ -18,6 +18,7 @@ sed -e '/relaying data between gdb and process/d' \
# filter some debuginfo problems with ld.so and SLES11
sed -e '/^1 rtld.c: No such file or directory\./d' |
+sed -e '/rtld.c: Inappropriate ioctl for device\./d' |
# and filter out any remaining empty lines
sed -e '/^$/d'
--
2.27.0

View File

@ -1,241 +0,0 @@
From 5e16f12e5e812d8ed4e3e96f373d73c22c964148 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Fri, 16 Jul 2021 15:47:08 -0400
Subject: [PATCH] Update helgrind and drd suppression libc and libpthread paths
in glibc 2.34
glibc 2.34 moved all pthread functions into the main libc library.
And it changed the (in memory) path of the main libc library to
libc.so.6 (before it was libc-2.xx.so).
This breaks various standard suppressions for helgrind and drd.
Fix this by doing a configure check for whether we are using glibc
2.34 by checking whether pthread_create is in libc instead of in
libpthread. If we are using glibc then define GLIBC_LIBC_PATH and
GLIBC_LIBPTHREAD_PATH variables that point to the (regexp) path
of the library that contains all libc functions and pthread functions
(which will be the same path for glibc 2.34+).
Rename glibc-2.34567-NPTL-helgrind.supp to glibc-2.X-helgrind.supp.in
and glibc-2.X-drd.supp to glibc-2.X-drd.supp.in and replace the
GLIBC_LIBC_PATH and GLIBC_LIBPTHREAD_PATH at configure time.
The same could be done for the glibc-2.X.supp.in file, but hasn't
yet because it looks like most suppressions in that file are obsolete.
---
Makefile.am | 2 +-
configure.ac | 37 +++++++++++++++++--
glibc-2.X-drd.supp => glibc-2.X-drd.supp.in | 6 ++-
...elgrind.supp => glibc-2.X-helgrind.supp.in | 16 ++++----
4 files changed, 47 insertions(+), 14 deletions(-)
rename glibc-2.X-drd.supp => glibc-2.X-drd.supp.in (97%)
rename glibc-2.34567-NPTL-helgrind.supp => glibc-2.X-helgrind.supp.in (95%)
diff --git a/Makefile.am b/Makefile.am
index 66848afaa..f5935eb69 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,7 +41,7 @@ SUPP_FILES = \
glibc-2.2.supp glibc-2.3.supp glibc-2.4.supp glibc-2.5.supp \
glibc-2.6.supp glibc-2.7.supp glibc-2.X.supp.in \
xfree-3.supp xfree-4.supp \
- glibc-2.34567-NPTL-helgrind.supp \
+ glibc-2.X-helgrind.supp \
glibc-2.2-LinuxThreads-helgrind.supp \
glibc-2.X-drd.supp \
darwin9.supp darwin9-drd.supp \
diff --git a/configure.ac b/configure.ac
index 4582fb5d0..beb5bba79 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1090,6 +1090,31 @@ if test x$GLIBC_VERSION = x; then
fi
fi
+# If this is glibc then figure out the generic (in file) libc.so and
+# libpthread.so file paths to use in suppressions. Before 2.34 libpthread
+# was a separate library, afterwards it was merged into libc.so and
+# the library is called libc.so.6 (before it was libc-2.[0-9]+.so).
+# Use this fact to set GLIBC_LIBC_PATH and GLIBC_LIBPTHREAD_PATH.
+case ${GLIBC_VERSION} in
+2*)
+ AC_MSG_CHECKING([whether pthread_create needs libpthread])
+ AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_create])],
+ [
+ AC_MSG_RESULT([no])
+ GLIBC_LIBC_PATH="*/lib*/libc.so.6"
+ GLIBC_LIBPTHREAD_PATH="$GLIBC_LIBC_PATH"
+ ], [
+ AC_MSG_RESULT([yes])
+ GLIBC_LIBC_PATH="*/lib*/libc-2.*so*"
+ GLIBC_LIBPTHREAD_PATH="*/lib*/libpthread-2.*so*"
+ ])
+ ;;
+*)
+ AC_MSG_CHECKING([not glibc...])
+ AC_MSG_RESULT([${GLIBC_VERSION}])
+ ;;
+esac
+
AC_MSG_CHECKING([the glibc version])
case "${GLIBC_VERSION}" in
@@ -1102,13 +1127,13 @@ case "${GLIBC_VERSION}" in
2.[[3-6]])
AC_MSG_RESULT(${GLIBC_VERSION} family)
DEFAULT_SUPP="glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
;;
2.[[7-9]])
AC_MSG_RESULT(${GLIBC_VERSION} family)
DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
;;
2.10|2.11)
@@ -1116,7 +1141,7 @@ case "${GLIBC_VERSION}" in
AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
[Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
;;
2.*)
@@ -1126,7 +1151,7 @@ case "${GLIBC_VERSION}" in
AC_DEFINE([GLIBC_MANDATORY_INDEX_AND_STRLEN_REDIRECT], 1,
[Define to 1 if index() and strlen() have been optimized heavily (x86 glibc >= 2.12)])
DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-helgrind.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
;;
darwin)
@@ -1157,6 +1182,8 @@ case "${GLIBC_VERSION}" in
esac
AC_SUBST(GLIBC_VERSION)
+AC_SUBST(GLIBC_LIBC_PATH)
+AC_SUBST(GLIBC_LIBPTHREAD_PATH)
if test "$VGCONF_OS" != "solaris"; then
@@ -4928,6 +4955,8 @@ AC_CONFIG_FILES([
valgrind.spec
valgrind.pc
glibc-2.X.supp
+ glibc-2.X-helgrind.supp
+ glibc-2.X-drd.supp
docs/Makefile
tests/Makefile
tests/vg_regtest
diff --git a/glibc-2.X-drd.supp b/glibc-2.X-drd.supp.in
similarity index 97%
rename from glibc-2.X-drd.supp
rename to glibc-2.X-drd.supp.in
index cee5f22fb..2c880051a 100644
--- a/glibc-2.X-drd.supp
+++ b/glibc-2.X-drd.supp.in
@@ -1,3 +1,5 @@
+# IMPORTANT: DO NOT EDIT glibc-2.X-drd.supp, as it is as a generated
+# file. Instead edit glibc-2.X-drd.supp.in.
#
# Suppression patterns for ld, the dynamic loader.
#
@@ -6,7 +8,7 @@
{
drd-ld
drd:ConflictingAccess
- obj:*/lib*/ld-*.so
+ obj:*/lib*/ld*.so*
}
#
@@ -22,7 +24,7 @@
{
drd-libc-stdio
drd:ConflictingAccess
- obj:*/lib*/libc-*
+ obj:@GLIBC_LIBC_PATH@
}
{
drd-libc-thread-cancellation-test
diff --git a/glibc-2.34567-NPTL-helgrind.supp b/glibc-2.X-helgrind.supp.in
similarity index 95%
rename from glibc-2.34567-NPTL-helgrind.supp
rename to glibc-2.X-helgrind.supp.in
index 7ebd2c4b4..cecf3ceab 100644
--- a/glibc-2.34567-NPTL-helgrind.supp
+++ b/glibc-2.X-helgrind.supp.in
@@ -1,3 +1,5 @@
+# IMPORTANT: DO NOT EDIT glibc-2.X-helgrind.supp, as it is as a generated
+# file. Instead edit glibc-2.X-helgrind.supp.in.
# FIXME 22 Jan 09: helgrind-glibc2X-005 overlaps with a lot of
# other stuff. They should be removed.
@@ -41,7 +43,7 @@
{
helgrind-glibc2X-004
Helgrind:Race
- obj:*/lib*/libc-2.*so*
+ obj:@GLIBC_LIBC_PATH@
}
{
@@ -49,13 +51,13 @@
Helgrind:Race
fun:__GI_mempcpy
fun:_IO_*xsputn*
- obj:*/lib*/libc-2.*so*
+ obj:@GLIBC_LIBC_PATH@
}
{
helgrind-glibc2X-005
Helgrind:Race
- obj:*/lib*/libpthread-2.*so*
+ obj:@GLIBC_LIBPTHREAD_PATH@
}
# helgrind-glibc2X-006 was merged into helgrind-glibc2X-005
@@ -90,14 +92,14 @@
{
helgrind-glibc2X-101
Helgrind:Race
- obj:*/lib*/libpthread-2.*so*
+ obj:@GLIBC_LIBPTHREAD_PATH@
fun:pthread_*
}
{
helgrind-glibc2X-102
Helgrind:Race
fun:mythread_wrapper
- obj:*/lib*/libpthread-2.*so*
+ obj:@GLIBC_LIBPTHREAD_PATH@
}
{
helgrind-glibc2X-103
@@ -122,7 +124,7 @@
{
helgrind-glibc2X-107
Helgrind:Race
- obj:*/lib*/libpthread-2.*so*
+ obj:@GLIBC_LIBPTHREAD_PATH@
fun:sem_*
}
{
@@ -138,7 +140,7 @@
{
helgrind-glibc2X-110
Helgrind:Race
- obj:*/lib*/libc-2.*so*
+ obj:@GLIBC_LIBC_PATH@
fun:pthread_*
}
{
--
2.27.0

View File

@ -1,21 +0,0 @@
commit e08a82991a9b9dc87c13f2b89273f25f97d14baf
Author: Tom Hughes <tom@compton.nu>
Date: Tue Apr 6 22:44:36 2021 +0100
Only process clone results in the parent thread
Fixes BZ#423963
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
index 5ae4e6613..c59d8ee26 100644
--- a/coregrind/m_syswrap/syswrap-linux.c
+++ b/coregrind/m_syswrap/syswrap-linux.c
@@ -940,7 +940,7 @@ PRE(sys_clone)
("Valgrind does not support general clone().");
}
- if (SUCCESS) {
+ if (SUCCESS && RES != 0) {
if (ARG_FLAGS & (VKI_CLONE_PARENT_SETTID | VKI_CLONE_PIDFD))
POST_MEM_WRITE(ARG3, sizeof(Int));
if (ARG_FLAGS & (VKI_CLONE_CHILD_SETTID | VKI_CLONE_CHILD_CLEARTID))

View File

@ -1,141 +0,0 @@
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
index 45e1f3d1b..3b2dcb8e3 100644
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
@@ -874,6 +874,8 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
+ GENX_(__NR_clone3, sys_ni_syscall), // 435
+
LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c
index 428cb7c6f..7f41b0749 100644
--- a/coregrind/m_syswrap/syswrap-arm-linux.c
+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
@@ -1051,6 +1051,8 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
+ GENX_(__NR_clone3, sys_ni_syscall), // 435
+
LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c
index 024ece27f..0d717f44b 100644
--- a/coregrind/m_syswrap/syswrap-arm64-linux.c
+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c
@@ -830,6 +830,8 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
+ GENX_(__NR_clone3, sys_ni_syscall), // 435
+
LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c
index 62b085ea2..b62129111 100644
--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
+++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
@@ -1136,6 +1136,8 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
+ GENX_(__NR_clone3, sys_ni_syscall), // 435
+
LINX_ (__NR_faccessat2, sys_faccessat2), // 439
};
diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c
index b73c03da1..94f38366f 100644
--- a/coregrind/m_syswrap/syswrap-mips64-linux.c
+++ b/coregrind/m_syswrap/syswrap-mips64-linux.c
@@ -815,6 +815,7 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY (__NR_io_uring_setup, sys_io_uring_setup),
LINXY (__NR_io_uring_enter, sys_io_uring_enter),
LINXY (__NR_io_uring_register, sys_io_uring_register),
+ GENX_ (__NR_clone3, sys_ni_syscall),
LINX_ (__NR_faccessat2, sys_faccessat2),
};
diff --git a/coregrind/m_syswrap/syswrap-nanomips-linux.c b/coregrind/m_syswrap/syswrap-nanomips-linux.c
index 14127b181..102c15550 100644
--- a/coregrind/m_syswrap/syswrap-nanomips-linux.c
+++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c
@@ -824,6 +824,7 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY (__NR_io_uring_setup, sys_io_uring_setup),
LINXY (__NR_io_uring_enter, sys_io_uring_enter),
LINXY (__NR_io_uring_register, sys_io_uring_register),
+ GENX_ (__NR_clone3, sys_ni_syscall),
LINX_ (__NR_faccessat2, sys_faccessat2),
};
diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
index aad14f8ba..1e2efc677 100644
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
@@ -1054,6 +1054,8 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
+ GENX_(__NR_clone3, sys_ni_syscall), // 435
+
LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
index c0e3f5549..76610e142 100644
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
@@ -1023,6 +1023,8 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
+ GENX_(__NR_clone3, sys_ni_syscall), // 435
+
LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c
index af6c4eb21..5283c19fe 100644
--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
@@ -864,6 +864,8 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
+ GENX_(__NR_clone3, sys_ni_syscall), // 435
+
LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
index 67d866497..418c76975 100644
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
@@ -1645,6 +1645,8 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
LINXY(__NR_io_uring_register, sys_io_uring_register),// 427
+ GENX_(__NR_clone3, sys_ni_syscall), // 435
+
LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
diff --git a/include/vki/vki-scnums-shared-linux.h b/include/vki/vki-scnums-shared-linux.h
index c8bc31b4b..6c70c9981 100644
--- a/include/vki/vki-scnums-shared-linux.h
+++ b/include/vki/vki-scnums-shared-linux.h
@@ -39,6 +39,8 @@
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_clone3 435
+
#define __NR_faccessat2 439
#endif

View File

@ -1,30 +0,0 @@
commit 93104368952c37268da724231487058ea3eaf1dc
Author: Tom Hughes <tom@compton.nu>
Date: Thu May 20 17:16:06 2021 +0100
Don't look for separate debuginfo if the image has a .debug_info section
Fixes BZ#435908
diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c
index b0f062ddc..e424e3e7e 100644
--- a/coregrind/m_debuginfo/readelf.c
+++ b/coregrind/m_debuginfo/readelf.c
@@ -2879,13 +2879,15 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
/* Look for a build-id */
HChar* buildid = find_buildid(mimg, False, False);
- /* Look for a debug image that matches either the build-id or
+ /* If we don't have a .debug_info section in the main image then
+ look for a debug image that matches either the build-id or
the debuglink-CRC32 in the main image. If the main image
doesn't contain either of those then this won't even bother
to try looking. This looks in all known places, including
the --extra-debuginfo-path if specified and on the
--debuginfo-server if specified. */
- if (buildid != NULL || debuglink_escn.img != NULL) {
+ if (debug_info_escn.img == NULL &&
+ (buildid != NULL || debuglink_escn.img != NULL)) {
/* Do have a debuglink section? */
if (debuglink_escn.img != NULL) {
UInt crc_offset

View File

@ -1,43 +0,0 @@
commit 10922b70b825a0a9b4df9694ceb9f20e93e2c11d
Author: Mark Wielaard <mark@klomp.org>
Date: Sat Sep 18 02:19:13 2021 +0200
m_debuginfo: Handle DW_TAG_atomic_type
DW_TAG_atomic_type is a DWARF5 qualifier tag like DW_TAG_volatile_type,
DW_TAG_const_type and DW_TAG_restrict_type.
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
index 52c27d4bb..968c37bd6 100644
--- a/coregrind/m_debuginfo/readdwarf3.c
+++ b/coregrind/m_debuginfo/readdwarf3.c
@@ -4191,14 +4191,15 @@ static void parse_type_DIE ( /*MOD*/XArray* /* of TyEnt */ tyents,
}
if (dtag == DW_TAG_volatile_type || dtag == DW_TAG_const_type
- || dtag == DW_TAG_restrict_type) {
+ || dtag == DW_TAG_restrict_type || dtag == DW_TAG_atomic_type) {
Int have_ty = 0;
VG_(memset)(&typeE, 0, sizeof(typeE));
typeE.cuOff = D3_INVALID_CUOFF;
typeE.tag = Te_TyQual;
typeE.Te.TyQual.qual
= (dtag == DW_TAG_volatile_type ? 'V'
- : (dtag == DW_TAG_const_type ? 'C' : 'R'));
+ : (dtag == DW_TAG_const_type ? 'C'
+ : (dtag == DW_TAG_restrict_type ? 'R' : 'A')));
/* target type defaults to 'void' */
typeE.Te.TyQual.typeR = D3_FAKEVOID_CUOFF;
nf_i = 0;
diff --git a/coregrind/m_debuginfo/tytypes.c b/coregrind/m_debuginfo/tytypes.c
index 75e4cf500..e356b92c9 100644
--- a/coregrind/m_debuginfo/tytypes.c
+++ b/coregrind/m_debuginfo/tytypes.c
@@ -295,6 +295,7 @@ void ML_(pp_TyEnt_C_ishly)( const XArray* /* of TyEnt */ tyents,
case 'C': VG_(printf)("const "); break;
case 'V': VG_(printf)("volatile "); break;
case 'R': VG_(printf)("restrict "); break;
+ case 'A': VG_(printf)("atomic "); break;
default: goto unhandled;
}
ML_(pp_TyEnt_C_ishly)(tyents, ent->Te.TyQual.typeR);

View File

@ -1,976 +0,0 @@
From 7183a5638e294822bff3f486edce6303d22059ef Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Thu, 16 Sep 2021 22:01:47 +0200
Subject: [PATCH 1/6] readdwarf3: Skip units without addresses when looking for
inlined functions
When a unit doesn't cover any addresses skip it because no actual code
will be inside. Also use skip_DIE instead of read_DIE when not parsing
(skipping) children.
---
coregrind/m_debuginfo/readdwarf3.c | 48 +++++++++++++++++++++++++-----
1 file changed, 40 insertions(+), 8 deletions(-)
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
index 968c37bd6..cf8270c8c 100644
--- a/coregrind/m_debuginfo/readdwarf3.c
+++ b/coregrind/m_debuginfo/readdwarf3.c
@@ -3127,8 +3127,9 @@ static Bool parse_inl_DIE (
UWord saved_die_c_offset = get_position_of_Cursor( c_die );
- /* Get info about DW_TAG_compile_unit and DW_TAG_partial_unit 'which
- in theory could also contain inlined fn calls). */
+ /* Get info about DW_TAG_compile_unit and DW_TAG_partial_unit which in theory
+ could also contain inlined fn calls, if they cover an address range. */
+ Bool unit_has_addrs = False;
if (dtag == DW_TAG_compile_unit || dtag == DW_TAG_partial_unit) {
Bool have_lo = False;
Addr ip_lo = 0;
@@ -3145,7 +3146,10 @@ static Bool parse_inl_DIE (
if (attr == DW_AT_low_pc && cts.szB > 0) {
ip_lo = cts.u.val;
have_lo = True;
+ unit_has_addrs = True;
}
+ if (attr == DW_AT_ranges && cts.szB > 0)
+ unit_has_addrs = True;
if (attr == DW_AT_comp_dir) {
if (cts.szB >= 0)
cc->barf("parse_inl_DIE compdir: expecting indirect string");
@@ -3278,9 +3282,10 @@ static Bool parse_inl_DIE (
// Only recursively parse the (possible) children for the DIE which
// might maybe contain a DW_TAG_inlined_subroutine:
- return dtag == DW_TAG_lexical_block || dtag == DW_TAG_subprogram
- || dtag == DW_TAG_inlined_subroutine
- || dtag == DW_TAG_compile_unit || dtag == DW_TAG_partial_unit;
+ Bool ret = (unit_has_addrs
+ || dtag == DW_TAG_lexical_block || dtag == DW_TAG_subprogram
+ || dtag == DW_TAG_inlined_subroutine);
+ return ret;
bad_DIE:
dump_bad_die_and_barf("parse_inl_DIE", dtag, posn, level,
@@ -4759,9 +4764,36 @@ static void read_DIE (
while (True) {
atag = peek_ULEB128( c );
if (atag == 0) break;
- read_DIE( rangestree, tyents, tempvars, gexprs,
- typarser, varparser, inlparser,
- c, td3, cc, level+1 );
+ if (parse_children) {
+ read_DIE( rangestree, tyents, tempvars, gexprs,
+ typarser, varparser, inlparser,
+ c, td3, cc, level+1 );
+ } else {
+ Int skip_level = level + 1;
+ while (True) {
+ atag = peek_ULEB128( c );
+ if (atag == 0) {
+ skip_level--;
+ if (skip_level == level) break;
+ /* Eat the terminating zero and continue skipping the
+ children one level up. */
+ atag = get_ULEB128( c );
+ vg_assert(atag == 0);
+ continue;
+ }
+
+ abbv_code = get_ULEB128( c );
+ abbv = get_abbv(cc, abbv_code);
+ sibling = 0;
+ skip_DIE (&sibling, c, abbv, cc);
+ if (abbv->has_children) {
+ if (sibling == 0)
+ skip_level++;
+ else
+ set_position_of_Cursor( c, sibling );
+ }
+ }
+ }
}
/* Now we need to eat the terminating zero */
atag = get_ULEB128( c );
--
2.18.4
From 1597c1139127bb02d49f4711a9c9addd877d17cf Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Thu, 16 Sep 2021 22:49:41 +0200
Subject: [PATCH 2/6] readdwarf3: Only read line table for units with addresses
for inlined functions
When parsing DIEs for inlined functions, only read the line table for
units which can actually contain inlined_subroutines.
---
coregrind/m_debuginfo/readdwarf3.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
index cf8270c8c..7ece77009 100644
--- a/coregrind/m_debuginfo/readdwarf3.c
+++ b/coregrind/m_debuginfo/readdwarf3.c
@@ -3134,6 +3134,8 @@ static Bool parse_inl_DIE (
Bool have_lo = False;
Addr ip_lo = 0;
const HChar *compdir = NULL;
+ Bool has_stmt_list = False;
+ ULong debug_line_offset = 0;
nf_i = 0;
while (True) {
@@ -3159,15 +3161,19 @@ static Bool parse_inl_DIE (
ML_(dinfo_free) (str);
}
if (attr == DW_AT_stmt_list && cts.szB > 0) {
- read_filename_table( parser->fndn_ix_Table, compdir,
- cc, cts.u.val, td3 );
+ has_stmt_list = True;
+ debug_line_offset = cts.u.val;
}
if (attr == DW_AT_sibling && cts.szB > 0) {
parser->sibling = cts.u.val;
}
}
- if (level == 0)
+ if (level == 0) {
setup_cu_svma (cc, have_lo, ip_lo, td3);
+ if (has_stmt_list && unit_has_addrs)
+ read_filename_table( parser->fndn_ix_Table, compdir,
+ cc, debug_line_offset, td3 );
+ }
}
if (dtag == DW_TAG_inlined_subroutine) {
--
2.18.4
From 528a71f95f8eb124ed284f7cff093b3375bca380 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Sat, 18 Sep 2021 00:24:38 +0200
Subject: [PATCH 3/6] readdwarf3: Reuse fndn_ix_Table as much as possible
Both the var parser and the inl parser kept a fndn_ix_Table.
Initialize only one per debuginfo read pass and reuse if the stmt offset
is the same as last time (CUs can share the same line table and alt
files do share one for all units).
---
coregrind/m_debuginfo/readdwarf3.c | 122 +++++++++++++++++------------
1 file changed, 72 insertions(+), 50 deletions(-)
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
index 7ece77009..e63e35788 100644
--- a/coregrind/m_debuginfo/readdwarf3.c
+++ b/coregrind/m_debuginfo/readdwarf3.c
@@ -1801,9 +1801,6 @@ typedef
Int *level; /* D3 DIE levels */
Bool *isFunc; /* from DW_AT_subprogram? */
GExpr **fbGX; /* if isFunc, contains the FB expr, else NULL */
- /* The fndn_ix file name/dirname table. Is a mapping from dwarf
- integer index to the index in di->fndnpool. */
- XArray* /* of UInt* */ fndn_ix_Table;
}
D3VarParser;
@@ -1817,7 +1814,6 @@ var_parser_init ( D3VarParser *parser )
parser->level = NULL;
parser->isFunc = NULL;
parser->fbGX = NULL;
- parser->fndn_ix_Table = NULL;
}
/* Release any memory hanging off a variable parser object */
@@ -2471,12 +2467,39 @@ static void bad_DIE_confusion(int linenr)
}
#define goto_bad_DIE do {bad_DIE_confusion(__LINE__); goto bad_DIE;} while (0)
+/* Reset the fndn_ix_Table. When we come across the top level DIE for a CU we
+ will copy all the file names out of the .debug_line img area and use this
+ table to look up the copies when we later see filename numbers in
+ DW_TAG_variables etc. The table can be be reused between parsers (var and
+ inline) and between CUs. So we keep a copy of the last one parsed. Call
+ reset_fndn_ix_table before reading a new one from a new offset. */
+static
+void reset_fndn_ix_table (XArray** fndn_ix_Table, ULong *debug_line_offset,
+ ULong new_offset)
+{
+ vg_assert (new_offset == -1
+ || *debug_line_offset != new_offset);
+ Int size = *fndn_ix_Table == NULL ? 0 : VG_(sizeXA) (*fndn_ix_Table);
+ if (size > 0) {
+ VG_(deleteXA) (*fndn_ix_Table);
+ *fndn_ix_Table = NULL;
+ }
+ if (*fndn_ix_Table == NULL)
+ *fndn_ix_Table = VG_(newXA)( ML_(dinfo_zalloc),
+ "di.readdwarf3.reset_ix_table",
+ ML_(dinfo_free),
+ sizeof(UInt) );
+ *debug_line_offset = new_offset;
+}
+
__attribute__((noinline))
static void parse_var_DIE (
/*MOD*/WordFM* /* of (XArray* of AddrRange, void) */ rangestree,
/*MOD*/XArray* /* of TempVar* */ tempvars,
/*MOD*/XArray* /* of GExpr* */ gexprs,
/*MOD*/D3VarParser* parser,
+ XArray** fndn_ix_Table,
+ ULong *debug_line_offset,
DW_TAG dtag,
UWord posn,
Int level,
@@ -2535,8 +2558,12 @@ static void parse_var_DIE (
ML_(dinfo_free) (str);
}
if (attr == DW_AT_stmt_list && cts.szB > 0) {
- read_filename_table( parser->fndn_ix_Table, compdir,
- cc, cts.u.val, td3 );
+ if (cts.u.val != *debug_line_offset) {
+ reset_fndn_ix_table( fndn_ix_Table, debug_line_offset,
+ cts.u.val );
+ read_filename_table( *fndn_ix_Table, compdir,
+ cc, cts.u.val, td3 );
+ }
}
}
if (have_lo && have_hi1 && hiIsRelative)
@@ -2730,8 +2757,8 @@ static void parse_var_DIE (
if (attr == DW_AT_decl_file && cts.szB > 0) {
Int ftabIx = (Int)cts.u.val;
if (ftabIx >= 1
- && ftabIx < VG_(sizeXA)( parser->fndn_ix_Table )) {
- fndn_ix = *(UInt*)VG_(indexXA)( parser->fndn_ix_Table, ftabIx );
+ && ftabIx < VG_(sizeXA)( *fndn_ix_Table )) {
+ fndn_ix = *(UInt*)VG_(indexXA)( *fndn_ix_Table, ftabIx );
}
if (0) VG_(printf)("XXX filename fndn_ix = %u %s\n", fndn_ix,
ML_(fndn_ix2filename) (cc->di, fndn_ix));
@@ -2958,9 +2985,6 @@ static void parse_var_DIE (
typedef
struct {
- /* The fndn_ix file name/dirname table. Is a mapping from dwarf
- integer index to the index in di->fndnpool. */
- XArray* /* of UInt* */ fndn_ix_Table;
UWord sibling; // sibling of the last read DIE (if it has a sibling).
}
D3InlParser;
@@ -3113,6 +3137,8 @@ static const HChar* get_inlFnName (Int absori, const CUConst* cc, Bool td3)
__attribute__((noinline))
static Bool parse_inl_DIE (
/*MOD*/D3InlParser* parser,
+ XArray** fndn_ix_Table,
+ ULong *debug_line_offset,
DW_TAG dtag,
UWord posn,
Int level,
@@ -3135,7 +3161,7 @@ static Bool parse_inl_DIE (
Addr ip_lo = 0;
const HChar *compdir = NULL;
Bool has_stmt_list = False;
- ULong debug_line_offset = 0;
+ ULong cu_line_offset = 0;
nf_i = 0;
while (True) {
@@ -3162,7 +3188,7 @@ static Bool parse_inl_DIE (
}
if (attr == DW_AT_stmt_list && cts.szB > 0) {
has_stmt_list = True;
- debug_line_offset = cts.u.val;
+ cu_line_offset = cts.u.val;
}
if (attr == DW_AT_sibling && cts.szB > 0) {
parser->sibling = cts.u.val;
@@ -3170,9 +3196,13 @@ static Bool parse_inl_DIE (
}
if (level == 0) {
setup_cu_svma (cc, have_lo, ip_lo, td3);
- if (has_stmt_list && unit_has_addrs)
- read_filename_table( parser->fndn_ix_Table, compdir,
- cc, debug_line_offset, td3 );
+ if (has_stmt_list && unit_has_addrs
+ && *debug_line_offset != cu_line_offset) {
+ reset_fndn_ix_table ( fndn_ix_Table, debug_line_offset,
+ cu_line_offset );
+ read_filename_table( *fndn_ix_Table, compdir,
+ cc, cu_line_offset, td3 );
+ }
}
}
@@ -3200,9 +3230,9 @@ static Bool parse_inl_DIE (
if (attr == DW_AT_call_file && cts.szB > 0) {
Int ftabIx = (Int)cts.u.val;
if (ftabIx >= 1
- && ftabIx < VG_(sizeXA)( parser->fndn_ix_Table )) {
+ && ftabIx < VG_(sizeXA)( *fndn_ix_Table )) {
caller_fndn_ix = *(UInt*)
- VG_(indexXA)( parser->fndn_ix_Table, ftabIx );
+ VG_(indexXA)( *fndn_ix_Table, ftabIx );
}
if (0) VG_(printf)("XXX caller_fndn_ix = %u %s\n", caller_fndn_ix,
ML_(fndn_ix2filename) (cc->di, caller_fndn_ix));
@@ -4652,6 +4682,8 @@ static void read_DIE (
/*MOD*/D3TypeParser* typarser,
/*MOD*/D3VarParser* varparser,
/*MOD*/D3InlParser* inlparser,
+ XArray** fndn_ix_Table,
+ ULong *debug_line_offset,
Cursor* c, Bool td3, CUConst* cc, Int level
)
{
@@ -4713,6 +4745,8 @@ static void read_DIE (
tempvars,
gexprs,
varparser,
+ fndn_ix_Table,
+ debug_line_offset,
(DW_TAG)atag,
posn,
level,
@@ -4734,6 +4768,8 @@ static void read_DIE (
inlparser->sibling = 0;
parse_children =
parse_inl_DIE( inlparser,
+ fndn_ix_Table,
+ debug_line_offset,
(DW_TAG)atag,
posn,
level,
@@ -4773,6 +4809,7 @@ static void read_DIE (
if (parse_children) {
read_DIE( rangestree, tyents, tempvars, gexprs,
typarser, varparser, inlparser,
+ fndn_ix_Table, debug_line_offset,
c, td3, cc, level+1 );
} else {
Int skip_level = level + 1;
@@ -5006,6 +5043,8 @@ void new_dwarf3_reader_wrk (
D3TypeParser typarser;
D3VarParser varparser;
D3InlParser inlparser;
+ XArray* /* of UInt */ fndn_ix_Table = NULL;
+ ULong debug_line_offset = (ULong) -1;
Word i, j, n;
Bool td3 = di->trace_symtab;
XArray* /* of TempVar* */ dioff_lookup_tab;
@@ -5145,6 +5184,10 @@ void new_dwarf3_reader_wrk (
"Overrun whilst reading alternate .debug_info section" );
section_size = escn_debug_info_alt.szB;
+ /* Keep track of the last line table we have seen,
+ it might turn up again. */
+ reset_fndn_ix_table(&fndn_ix_Table, &debug_line_offset, (ULong) -1);
+
TRACE_D3("\n------ Parsing alternate .debug_info section ------\n");
} else if (pass == 1) {
/* Now loop over the Compilation Units listed in the .debug_info
@@ -5155,6 +5198,10 @@ void new_dwarf3_reader_wrk (
"Overrun whilst reading .debug_info section" );
section_size = escn_debug_info.szB;
+ /* Keep track of the last line table we have seen,
+ it might turn up again. */
+ reset_fndn_ix_table(&fndn_ix_Table, &debug_line_offset, (ULong) -1);
+
TRACE_D3("\n------ Parsing .debug_info section ------\n");
} else {
if (!ML_(sli_is_valid)(escn_debug_types))
@@ -5165,6 +5212,10 @@ void new_dwarf3_reader_wrk (
"Overrun whilst reading .debug_types section" );
section_size = escn_debug_types.szB;
+ /* Keep track of the last line table we have seen,
+ it might turn up again. */
+ reset_fndn_ix_table(&fndn_ix_Table, &debug_line_offset, (ULong) -1);
+
TRACE_D3("\n------ Parsing .debug_types section ------\n");
}
@@ -5257,26 +5308,6 @@ void new_dwarf3_reader_wrk (
unitary_range_list(0UL, ~0UL),
-1, False/*isFunc*/, NULL/*fbGX*/ );
- /* And set up the fndn_ix_Table. When we come across the top
- level DIE for this CU (which is what the next call to
- read_DIE should process) we will copy all the file names out
- of the .debug_line img area and use this table to look up the
- copies when we later see filename numbers in DW_TAG_variables
- etc. */
- vg_assert(!varparser.fndn_ix_Table );
- varparser.fndn_ix_Table
- = VG_(newXA)( ML_(dinfo_zalloc), "di.readdwarf3.ndrw.5var",
- ML_(dinfo_free),
- sizeof(UInt) );
- }
-
- if (VG_(clo_read_inline_info)) {
- /* fndn_ix_Table for the inlined call parser */
- vg_assert(!inlparser.fndn_ix_Table );
- inlparser.fndn_ix_Table
- = VG_(newXA)( ML_(dinfo_zalloc), "di.readdwarf3.ndrw.5inl",
- ML_(dinfo_free),
- sizeof(UInt) );
}
/* Now read the one-and-only top-level DIE for this CU. */
@@ -5284,6 +5315,7 @@ void new_dwarf3_reader_wrk (
read_DIE( rangestree,
tyents, tempvars, gexprs,
&typarser, &varparser, &inlparser,
+ &fndn_ix_Table, &debug_line_offset,
&info, td3, &cc, 0 );
cu_offset_now = get_position_of_Cursor( &info );
@@ -5328,16 +5360,6 @@ void new_dwarf3_reader_wrk (
typestack_preen( &typarser, td3, -2 );
}
- if (VG_(clo_read_var_info)) {
- vg_assert(varparser.fndn_ix_Table );
- VG_(deleteXA)( varparser.fndn_ix_Table );
- varparser.fndn_ix_Table = NULL;
- }
- if (VG_(clo_read_inline_info)) {
- vg_assert(inlparser.fndn_ix_Table );
- VG_(deleteXA)( inlparser.fndn_ix_Table );
- inlparser.fndn_ix_Table = NULL;
- }
clear_CUConst(&cc);
if (cu_offset_now == section_size)
@@ -5346,6 +5368,8 @@ void new_dwarf3_reader_wrk (
}
}
+ if (fndn_ix_Table != NULL)
+ VG_(deleteXA)(fndn_ix_Table);
if (VG_(clo_read_var_info)) {
/* From here on we're post-processing the stuff we got
@@ -5662,8 +5686,6 @@ void new_dwarf3_reader_wrk (
ML_(dinfo_free)( tyents_to_keep_cache );
tyents_to_keep_cache = NULL;
- vg_assert( varparser.fndn_ix_Table == NULL );
-
/* And the signatured type hash. */
VG_(HT_destruct) ( signature_types, ML_(dinfo_free) );
--
2.18.4
From 8548d2e4ca0fb485597ddbf958e2064620ee972a Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Sat, 18 Sep 2021 03:23:52 +0200
Subject: [PATCH 4/6] readdwarf3: Immediately skip to end of CU when not
parsing children
---
coregrind/m_debuginfo/readdwarf3.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
index e63e35788..b02e23990 100644
--- a/coregrind/m_debuginfo/readdwarf3.c
+++ b/coregrind/m_debuginfo/readdwarf3.c
@@ -4787,6 +4787,16 @@ static void read_DIE (
vg_assert (inlparser->sibling == 0 || inlparser->sibling == sibling);
}
+ /* Top level CU DIE, but we don't want to read anything else, just skip
+ to the end and return. */
+ if (level == 0 && !parse_children) {
+ UWord cu_size_including_IniLen = (cc->unit_length
+ + (cc->is_dw64 ? 12 : 4));
+ set_position_of_Cursor( c, (cc->cu_start_offset
+ + cu_size_including_IniLen));
+ return;
+ }
+
if (after_die_c_offset > 0) {
// DIE was read by a parser above, so we know where the DIE ends.
set_position_of_Cursor( c, after_die_c_offset );
--
2.18.4
From 2295d273ee03781f5bf112ccedabcea03ca79bf5 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Sat, 18 Sep 2021 22:16:33 +0200
Subject: [PATCH 5/6] readdwarf3: Reuse abbrev if possible between units
Instead of destroying the ht_abbrvs after processing a CU save it
and the offset so it can be reused for the next CU if that happens
to have the same abbrev offset. dwz compressed DWARF often reuse
the same abbrev for multiple CUs.
---
coregrind/m_debuginfo/readdwarf3.c | 40 ++++++++++++++++++++++--------
1 file changed, 29 insertions(+), 11 deletions(-)
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
index b02e23990..0c86b712e 100644
--- a/coregrind/m_debuginfo/readdwarf3.c
+++ b/coregrind/m_debuginfo/readdwarf3.c
@@ -470,6 +470,7 @@ typedef
struct _DebugInfo* di;
/* --- a hash table of g_abbv (i.e. parsed abbreviations) --- */
VgHashTable *ht_abbvs;
+ ULong debug_abbrev_offset;
/* True if this came from .debug_types; otherwise it came from
.debug_info. */
@@ -1101,13 +1102,6 @@ static g_abbv* get_abbv (const CUConst* cc, ULong abbv_code)
return abbv;
}
-/* Free the memory allocated in CUConst. */
-static void clear_CUConst (CUConst* cc)
-{
- VG_(HT_destruct) ( cc->ht_abbvs, ML_(dinfo_free));
- cc->ht_abbvs = NULL;
-}
-
/* Parse the Compilation Unit header indicated at 'c' and
initialise 'cc' accordingly. */
static __attribute__((noinline))
@@ -1115,6 +1109,8 @@ void parse_CU_Header ( /*OUT*/CUConst* cc,
Bool td3,
Cursor* c,
DiSlice escn_debug_abbv,
+ ULong last_debug_abbrev_offset,
+ VgHashTable *last_ht_abbvs,
Bool type_unit,
Bool alt_info )
{
@@ -1190,7 +1186,15 @@ void parse_CU_Header ( /*OUT*/CUConst* cc,
cc->debug_abbv.ioff += debug_abbrev_offset;
cc->debug_abbv.szB -= debug_abbrev_offset;
- init_ht_abbvs(cc, td3);
+ cc->debug_abbrev_offset = debug_abbrev_offset;
+ if (last_ht_abbvs != NULL
+ && debug_abbrev_offset == last_debug_abbrev_offset) {
+ cc->ht_abbvs = last_ht_abbvs;
+ } else {
+ if (last_ht_abbvs != NULL)
+ VG_(HT_destruct) (last_ht_abbvs, ML_(dinfo_free));
+ init_ht_abbvs(cc, td3);
+ }
}
/* This represents a single signatured type. It maps a type signature
@@ -5141,6 +5145,8 @@ void new_dwarf3_reader_wrk (
TRACE_D3("\n------ Collecting signatures from "
".debug_types section ------\n");
+ ULong last_debug_abbrev_offset = (ULong) -1;
+ VgHashTable *last_ht_abbvs = NULL;
while (True) {
UWord cu_start_offset, cu_offset_now;
CUConst cc;
@@ -5149,7 +5155,9 @@ void new_dwarf3_reader_wrk (
TRACE_D3("\n");
TRACE_D3(" Compilation Unit @ offset 0x%lx:\n", cu_start_offset);
/* parse_CU_header initialises the CU's abbv hash table. */
- parse_CU_Header( &cc, td3, &info, escn_debug_abbv, True, False );
+ parse_CU_Header( &cc, td3, &info, escn_debug_abbv,
+ last_debug_abbrev_offset, last_ht_abbvs,
+ True, False );
/* Needed by cook_die. */
cc.types_cuOff_bias = escn_debug_info.szB;
@@ -5163,7 +5171,8 @@ void new_dwarf3_reader_wrk (
cu_offset_now = (cu_start_offset + cc.unit_length
+ (cc.is_dw64 ? 12 : 4));
- clear_CUConst ( &cc);
+ last_debug_abbrev_offset = cc.debug_abbrev_offset;
+ last_ht_abbvs = cc.ht_abbvs;
if (cu_offset_now >= escn_debug_types.szB) {
break;
@@ -5171,6 +5180,8 @@ void new_dwarf3_reader_wrk (
set_position_of_Cursor ( &info, cu_offset_now );
}
+ if (last_ht_abbvs != NULL)
+ VG_(HT_destruct) (last_ht_abbvs, ML_(dinfo_free));
}
/* Perform three DIE-reading passes. The first pass reads DIEs from
@@ -5229,6 +5240,8 @@ void new_dwarf3_reader_wrk (
TRACE_D3("\n------ Parsing .debug_types section ------\n");
}
+ ULong last_debug_abbrev_offset = (ULong) -1;
+ VgHashTable *last_ht_abbvs = NULL;
while (True) {
ULong cu_start_offset, cu_offset_now;
CUConst cc;
@@ -5277,9 +5290,11 @@ void new_dwarf3_reader_wrk (
/* parse_CU_header initialises the CU's hashtable of abbvs ht_abbvs */
if (pass == 0) {
parse_CU_Header( &cc, td3, &info, escn_debug_abbv_alt,
+ last_debug_abbrev_offset, last_ht_abbvs,
False, True );
} else {
parse_CU_Header( &cc, td3, &info, escn_debug_abbv,
+ last_debug_abbrev_offset, last_ht_abbvs,
pass == 2, False );
}
cc.escn_debug_str = pass == 0 ? escn_debug_str_alt
@@ -5370,12 +5385,15 @@ void new_dwarf3_reader_wrk (
typestack_preen( &typarser, td3, -2 );
}
- clear_CUConst(&cc);
+ last_debug_abbrev_offset = cc.debug_abbrev_offset;
+ last_ht_abbvs = cc.ht_abbvs;
if (cu_offset_now == section_size)
break;
/* else keep going */
}
+ if (last_ht_abbvs != NULL)
+ VG_(HT_destruct) (last_ht_abbvs, ML_(dinfo_free));
}
if (fndn_ix_Table != NULL)
--
2.18.4
From 24faa4c59b719c4a4bb2b21c2024ecb52c9be875 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Sun, 19 Sep 2021 14:30:19 +0200
Subject: [PATCH 6/6] readdwarf3: Introduce abbv_state to read .debug_abbrev
more lazily
With the inline parser often a lot of DIEs are skipped, so reading
all abbrevs up front wastes time and memory. A lot of time and memory
can be saved by reading the abbrevs on demand. Do this by introducing
an abbv_state that is used to keep track of the abbrevs already read.
This does technically make the CUConst struct not const.
---
coregrind/m_debuginfo/readdwarf3.c | 145 +++++++++++++++++------------
1 file changed, 88 insertions(+), 57 deletions(-)
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
index 0c86b712e..4ac23a3c4 100644
--- a/coregrind/m_debuginfo/readdwarf3.c
+++ b/coregrind/m_debuginfo/readdwarf3.c
@@ -415,6 +415,23 @@ typedef
described by this g_abbv; */
} g_abbv;
+/* Holds information about the .debug_abbrev section for this CU. The current
+ Cursor into the abbrev section, the known abbrev codes are but into an hash
+ table. The (starting) offset into the abbrev_offset can be used to check
+ whether the abbv can be shared between CUs. The done boolean is set when all
+ known codes have been read. Initialize a new abbv_state with init_ht_abbvs.
+ To read any new abbrev codes not yet in the hash table call find_ht_abbvs
+ (get_abbv will first query the ht_abbvs, then if not done, call
+ find_ht_abbvs). */
+typedef
+ struct _abbv_state {
+ Cursor c; /* Current cursor into .debug_abbrev. */
+ VgHashTable *ht_abbvs; /* Hash table mapping codes to abbrevs. */
+ ULong debug_abbrev_offset; /* Starting offset into .debug_abbrev. */
+ Bool done; /* Whether there (might) still be new abbrev codes not yet
+ in the cache. */
+ } abbv_state;
+
/* Holds information that is constant through the parsing of a
Compilation Unit. This is basically plumbed through to
everywhere. */
@@ -468,9 +485,9 @@ typedef
UWord alt_cuOff_bias;
/* --- Needed so we can add stuff to the string table. --- */
struct _DebugInfo* di;
- /* --- a hash table of g_abbv (i.e. parsed abbreviations) --- */
- VgHashTable *ht_abbvs;
- ULong debug_abbrev_offset;
+ /* --- State of the hash table of g_abbv (i.e. parsed abbreviations)
+ technically makes this struct not const. --- */
+ abbv_state abbv;
/* True if this came from .debug_types; otherwise it came from
.debug_info. */
@@ -998,18 +1015,27 @@ get_range_list ( const CUConst* cc,
#define VARSZ_FORM 0xffffffff
static UInt get_Form_szB (const CUConst* cc, DW_FORM form );
-/* Initialises the hash table of abbreviations.
- We do a single scan of the abbv slice to parse and
- build all abbreviations, for the following reasons:
- * all or most abbreviations will be needed in any case
- (at least for var-info reading).
- * re-reading each time an abbreviation causes a lot of calls
- to get_ULEB128.
- * a CU should not have many abbreviations. */
-static void init_ht_abbvs (CUConst* cc,
+/* Initialises the hash table of abbreviations. This only sets up the abbv
+ Cursor and hash table, but does not try to read any abbrevs yes. The actual
+ reading of abbrevs will be done by get_abbv by calling find_ht_abbvs on
+ demand if a requested abbrev code isn't in the hash table yet. When using the
+ inline parser a lot of abbrevs will not be needed so reading everything
+ upfront will often waste time and memory. */
+static void init_ht_abbvs (CUConst* cc, ULong debug_abbrev_offset,
Bool td3)
{
- Cursor c;
+ Cursor *c = &cc->abbv.c;
+ init_Cursor( c, cc->debug_abbv, 0, cc->barf,
+ "Overrun whilst parsing .debug_abbrev section(2)" );
+ cc->abbv.ht_abbvs = VG_(HT_construct) ("di.readdwarf3.ht_abbvs");
+ cc->abbv.debug_abbrev_offset = debug_abbrev_offset;
+ cc->abbv.done = False;
+}
+
+static g_abbv *find_ht_abbvs (CUConst* cc, ULong abbv_code,
+ Bool td3)
+{
+ Cursor *c;
g_abbv *ta; // temporary abbreviation, reallocated if needed.
UInt ta_nf_maxE; // max nr of pairs in ta.nf[], doubled when reallocated.
UInt ta_nf_n; // nr of pairs in ta->nf that are initialised.
@@ -1020,16 +1046,18 @@ static void init_ht_abbvs (CUConst* cc,
ta_nf_maxE = 10; // starting with enough for 9 pairs+terminating pair.
ta = ML_(dinfo_zalloc) ("di.readdwarf3.ht_ta_nf", SZ_G_ABBV(ta_nf_maxE));
- cc->ht_abbvs = VG_(HT_construct) ("di.readdwarf3.ht_abbvs");
- init_Cursor( &c, cc->debug_abbv, 0, cc->barf,
- "Overrun whilst parsing .debug_abbrev section(2)" );
+ c = &cc->abbv.c;
while (True) {
- ta->abbv_code = get_ULEB128( &c );
- if (ta->abbv_code == 0) break; /* end of the table */
+ ht_ta = NULL;
+ ta->abbv_code = get_ULEB128( c );
+ if (ta->abbv_code == 0) {
+ cc->abbv.done = True;
+ break; /* end of the table */
+ }
- ta->atag = get_ULEB128( &c );
- ta->has_children = get_UChar( &c );
+ ta->atag = get_ULEB128( c );
+ ta->has_children = get_UChar( c );
ta_nf_n = 0;
while (True) {
if (ta_nf_n >= ta_nf_maxE) {
@@ -1040,10 +1068,10 @@ static void init_ht_abbvs (CUConst* cc,
VG_(memcpy) (ta, old_ta, SZ_G_ABBV(ta_nf_n));
ML_(dinfo_free) (old_ta);
}
- ta->nf[ta_nf_n].at_name = get_ULEB128( &c );
- ta->nf[ta_nf_n].at_form = get_ULEB128( &c );
+ ta->nf[ta_nf_n].at_name = get_ULEB128( c );
+ ta->nf[ta_nf_n].at_form = get_ULEB128( c );
if (ta->nf[ta_nf_n].at_form == DW_FORM_implicit_const)
- ta->nf[ta_nf_n].at_val = get_SLEB128( &c );
+ ta->nf[ta_nf_n].at_val = get_SLEB128( c );
if (ta->nf[ta_nf_n].at_name == 0 && ta->nf[ta_nf_n].at_form == 0) {
ta_nf_n++;
break;
@@ -1075,7 +1103,7 @@ static void init_ht_abbvs (CUConst* cc,
ht_ta = ML_(dinfo_zalloc) ("di.readdwarf3.ht_ta", SZ_G_ABBV(ta_nf_n));
VG_(memcpy) (ht_ta, ta, SZ_G_ABBV(ta_nf_n));
- VG_(HT_add_node) ( cc->ht_abbvs, ht_ta );
+ VG_(HT_add_node) ( cc->abbv.ht_abbvs, ht_ta );
if (TD3) {
TRACE_D3(" Adding abbv_code %lu TAG %s [%s] nf %u ",
ht_ta->abbv_code, ML_(pp_DW_TAG)(ht_ta->atag),
@@ -1086,19 +1114,27 @@ static void init_ht_abbvs (CUConst* cc,
TRACE_D3("[%u,%u] ", ta->nf[i].skip_szB, ta->nf[i].next_nf);
TRACE_D3("\n");
}
+ if (ht_ta->abbv_code == abbv_code)
+ break;
}
ML_(dinfo_free) (ta);
#undef SZ_G_ABBV
+
+ return ht_ta;
}
-static g_abbv* get_abbv (const CUConst* cc, ULong abbv_code)
+static g_abbv* get_abbv (CUConst* cc, ULong abbv_code,
+ Bool td3)
{
g_abbv *abbv;
- abbv = VG_(HT_lookup) (cc->ht_abbvs, abbv_code);
+ abbv = VG_(HT_lookup) (cc->abbv.ht_abbvs, abbv_code);
+ if (!abbv && !cc->abbv.done)
+ abbv = find_ht_abbvs (cc, abbv_code, td3);
if (!abbv)
cc->barf ("abbv_code not found in ht_abbvs table");
+
return abbv;
}
@@ -1109,8 +1145,7 @@ void parse_CU_Header ( /*OUT*/CUConst* cc,
Bool td3,
Cursor* c,
DiSlice escn_debug_abbv,
- ULong last_debug_abbrev_offset,
- VgHashTable *last_ht_abbvs,
+ abbv_state last_abbv,
Bool type_unit,
Bool alt_info )
{
@@ -1186,14 +1221,13 @@ void parse_CU_Header ( /*OUT*/CUConst* cc,
cc->debug_abbv.ioff += debug_abbrev_offset;
cc->debug_abbv.szB -= debug_abbrev_offset;
- cc->debug_abbrev_offset = debug_abbrev_offset;
- if (last_ht_abbvs != NULL
- && debug_abbrev_offset == last_debug_abbrev_offset) {
- cc->ht_abbvs = last_ht_abbvs;
+ if (last_abbv.ht_abbvs != NULL
+ && debug_abbrev_offset == last_abbv.debug_abbrev_offset) {
+ cc->abbv = last_abbv;
} else {
- if (last_ht_abbvs != NULL)
- VG_(HT_destruct) (last_ht_abbvs, ML_(dinfo_free));
- init_ht_abbvs(cc, td3);
+ if (last_abbv.ht_abbvs != NULL)
+ VG_(HT_destruct) (last_abbv.ht_abbvs, ML_(dinfo_free));
+ init_ht_abbvs(cc, debug_abbrev_offset, td3);
}
}
@@ -3016,7 +3050,7 @@ typedef
table is kept, while we must handle all abbreviations in all CUs
referenced by an absori (being a reference to an alt CU, or a previous
or following CU). */
-static const HChar* get_inlFnName (Int absori, const CUConst* cc, Bool td3)
+static const HChar* get_inlFnName (Int absori, CUConst* cc, Bool td3)
{
Cursor c;
const g_abbv *abbv;
@@ -3072,7 +3106,7 @@ static const HChar* get_inlFnName (Int absori, const CUConst* cc, Bool td3)
"Overrun get_inlFnName absori");
abbv_code = get_ULEB128( &c );
- abbv = get_abbv ( cc, abbv_code);
+ abbv = get_abbv ( cc, abbv_code, td3);
atag = abbv->atag;
TRACE_D3(" <get_inlFnName><%lx>: Abbrev Number: %llu (%s)\n",
posn, abbv_code, ML_(pp_DW_TAG)( atag ) );
@@ -4707,7 +4741,7 @@ static void read_DIE (
/* --- Deal with this DIE --- */
posn = cook_die( cc, get_position_of_Cursor( c ) );
abbv_code = get_ULEB128( c );
- abbv = get_abbv(cc, abbv_code);
+ abbv = get_abbv(cc, abbv_code, td3);
atag = abbv->atag;
if (TD3) {
@@ -4840,7 +4874,7 @@ static void read_DIE (
}
abbv_code = get_ULEB128( c );
- abbv = get_abbv(cc, abbv_code);
+ abbv = get_abbv(cc, abbv_code, td3);
sibling = 0;
skip_DIE (&sibling, c, abbv, cc);
if (abbv->has_children) {
@@ -5145,8 +5179,9 @@ void new_dwarf3_reader_wrk (
TRACE_D3("\n------ Collecting signatures from "
".debug_types section ------\n");
- ULong last_debug_abbrev_offset = (ULong) -1;
- VgHashTable *last_ht_abbvs = NULL;
+ abbv_state last_abbv;
+ last_abbv.debug_abbrev_offset = (ULong) -1;
+ last_abbv.ht_abbvs = NULL;
while (True) {
UWord cu_start_offset, cu_offset_now;
CUConst cc;
@@ -5156,8 +5191,7 @@ void new_dwarf3_reader_wrk (
TRACE_D3(" Compilation Unit @ offset 0x%lx:\n", cu_start_offset);
/* parse_CU_header initialises the CU's abbv hash table. */
parse_CU_Header( &cc, td3, &info, escn_debug_abbv,
- last_debug_abbrev_offset, last_ht_abbvs,
- True, False );
+ last_abbv, True, False );
/* Needed by cook_die. */
cc.types_cuOff_bias = escn_debug_info.szB;
@@ -5171,8 +5205,7 @@ void new_dwarf3_reader_wrk (
cu_offset_now = (cu_start_offset + cc.unit_length
+ (cc.is_dw64 ? 12 : 4));
- last_debug_abbrev_offset = cc.debug_abbrev_offset;
- last_ht_abbvs = cc.ht_abbvs;
+ last_abbv = cc.abbv;
if (cu_offset_now >= escn_debug_types.szB) {
break;
@@ -5180,8 +5213,8 @@ void new_dwarf3_reader_wrk (
set_position_of_Cursor ( &info, cu_offset_now );
}
- if (last_ht_abbvs != NULL)
- VG_(HT_destruct) (last_ht_abbvs, ML_(dinfo_free));
+ if (last_abbv.ht_abbvs != NULL)
+ VG_(HT_destruct) (last_abbv.ht_abbvs, ML_(dinfo_free));
}
/* Perform three DIE-reading passes. The first pass reads DIEs from
@@ -5240,8 +5273,9 @@ void new_dwarf3_reader_wrk (
TRACE_D3("\n------ Parsing .debug_types section ------\n");
}
- ULong last_debug_abbrev_offset = (ULong) -1;
- VgHashTable *last_ht_abbvs = NULL;
+ abbv_state last_abbv;
+ last_abbv.debug_abbrev_offset = (ULong) -1;
+ last_abbv.ht_abbvs = NULL;
while (True) {
ULong cu_start_offset, cu_offset_now;
CUConst cc;
@@ -5290,12 +5324,10 @@ void new_dwarf3_reader_wrk (
/* parse_CU_header initialises the CU's hashtable of abbvs ht_abbvs */
if (pass == 0) {
parse_CU_Header( &cc, td3, &info, escn_debug_abbv_alt,
- last_debug_abbrev_offset, last_ht_abbvs,
- False, True );
+ last_abbv, False, True );
} else {
parse_CU_Header( &cc, td3, &info, escn_debug_abbv,
- last_debug_abbrev_offset, last_ht_abbvs,
- pass == 2, False );
+ last_abbv, pass == 2, False );
}
cc.escn_debug_str = pass == 0 ? escn_debug_str_alt
: escn_debug_str;
@@ -5385,15 +5417,14 @@ void new_dwarf3_reader_wrk (
typestack_preen( &typarser, td3, -2 );
}
- last_debug_abbrev_offset = cc.debug_abbrev_offset;
- last_ht_abbvs = cc.ht_abbvs;
+ last_abbv = cc.abbv;
if (cu_offset_now == section_size)
break;
/* else keep going */
}
- if (last_ht_abbvs != NULL)
- VG_(HT_destruct) (last_ht_abbvs, ML_(dinfo_free));
+ if (last_abbv.ht_abbvs != NULL)
+ VG_(HT_destruct) (last_abbv.ht_abbvs, ML_(dinfo_free));
}
if (fndn_ix_Table != NULL)
--
2.18.4

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +0,0 @@
commit a7216a4c4cc676e8f4750e71e7de654c0ce78ca3
Author: Will Schmidt <will_schmidt@vnet.ibm.com>
Date: Tue Aug 24 13:18:11 2021 -0500
Remove a unneeded / unnecessary prefix check.
diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
index f223fe9456..57ac7bcf48 100644
--- a/VEX/priv/guest_ppc_toIR.c
+++ b/VEX/priv/guest_ppc_toIR.c
@@ -14561,16 +14561,10 @@ static Bool dis_fp_pair_prefix ( UInt prefix, UInt theInstr )
/* Endian aware prefixed load */
pDIP( is_prefix, "stxvp %u,%llu(%u)\n", XTp, immediate_val, rA_addr );
DIPp( is_prefix, ",%u", R );
- if ( R == 1 ) {
- vex_printf("Illegal instruction R = 1; pstxvp %u,%llu(%u)\n",
- XTp, immediate_val, rA_addr );
- return False;
- }
-
assign( EA_8, binop( Iop_Add64, mkU64( 8 ), mkexpr( EA ) ) );
assign( EA_16, binop( Iop_Add64, mkU64( 16 ), mkexpr( EA ) ) );
assign( EA_24, binop( Iop_Add64, mkU64( 24 ), mkexpr( EA ) ) );
if (host_endness == VexEndnessBE) {

View File

@ -1,27 +0,0 @@
commit 44da99781e5bb954a0cd3c897b859012a125fec6
Author: Mark Wielaard <mark@klomp.org>
Date: Fri Aug 6 19:08:17 2021 +0200
unhandled ppc64le-linux syscall: 252 (statfs64) and 253 (fstatfs64)
glibc 2.34 consolidated all statfs implementations. All other arches
that have statfs64/fstat64 (including ppc32) already had that syscall
hooked up, it was just ppc64 that was missing it.
https://bugs.kde.org/show_bug.cgi?id=440670
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
index 76610e142..f1a88f7ce 100644
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
@@ -900,8 +900,8 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_tgkill, sys_tgkill), // 250
// _____(__NR_utimes, sys_utimes), // 251
-// _____(__NR_statfs64, sys_statfs64), // 252
-// _____(__NR_fstatfs64, sys_fstatfs64), // 253
+ GENXY(__NR_statfs64, sys_statfs64), // 252
+ GENXY(__NR_fstatfs64, sys_fstatfs64), // 253
// /* #define __NR_fadvise64_64 254 32bit only */
// _____(__NR_rtas, sys_rtas), // 255

View File

@ -1,38 +0,0 @@
commit 60ff013998de8aa168e01b7b1c1743bcbdee99b1
Author: Will Schmidt <will_schmidt@vnet.ibm.com>
Date: Thu Aug 12 15:41:50 2021 -0500
Hi
This reworks the modulo operation as seen in
valgrind/none/tests/ppc64/test_isa_3_1_common.c:
initialize_source_registers(). Due to a GCC issue (PR101882), we
will try to avoid a modulo operation with both input and outputs set to
a hard register.
In this case, we can apply the modulo operation to the args[] array
value used to initialize the ra value.
diff --git a/none/tests/ppc64/test_isa_3_1_common.c b/none/tests/ppc64/test_isa_3_1_common.c
index 8222a857fc..7c3dc6f009 100644
--- a/none/tests/ppc64/test_isa_3_1_common.c
+++ b/none/tests/ppc64/test_isa_3_1_common.c
@@ -2261,12 +2261,17 @@ void initialize_source_registers () {
if (has_rb) rb = 2*vrbi;
/* note special case for is_insert_double, see set_up_iterators () */
if (has_ra) ra = 4*vrai;
if (is_insert_double) {
/* For an insert_double, the results are undefined
- for ra > 8, so modulo those into a valid range. */
- ra = ra % 9;
+ for ra > 8, so modulo those into a valid range.
+ Since ra is defined as a hard register, and due to gcc
+ issue (PR101882) where a modulo operation fails with
+ both input and output regs set to a hard register, this
+ assignment references the args[] array again, versus
+ ra = ra % 9;. */
+ ra = args[vrai] % 9;
}
}
if (uses_buffer) {
if (has_rb) {

View File

@ -1,102 +0,0 @@
commit 9aaeafa70c5126b22857485449f8d5eeb1d9c527
Author: Carl Love <cel@us.ibm.com>
Date: Tue Sep 7 17:15:38 2021 +0000
Update the expected output for test_isa_3_1_VRT.
The inputs into the vinsdlx,vinsdrx instructions changed as a result of
the impossible constraint issue fix. This patch updates the expected
results.
https://bugs.kde.org/show_bug.cgi?id=441534
diff --git a/none/tests/ppc64/test_isa_3_1_VRT.stdout.exp b/none/tests/ppc64/test_isa_3_1_VRT.stdout.exp
index 39c4d8619..8f04ee2cb 100644
--- a/none/tests/ppc64/test_isa_3_1_VRT.stdout.exp
+++ b/none/tests/ppc64/test_isa_3_1_VRT.stdout.exp
@@ -6798,24 +6798,24 @@ vinsdlx 0 4 => 4,1111111111111111
vinsdlx 0 6 => 6,1111111111111111
vinsdlx 0 8 => 8,1111111111111111
vinsdlx 0 a => a,1111111111111111
-vinsdlx 4 0 => 1111111100000000,0000000011111111
-vinsdlx 4 2 => 1111111100000000,0000000211111111
-vinsdlx 4 4 => 1111111100000000,0000000411111111
-vinsdlx 4 6 => 1111111100000000,0000000611111111
-vinsdlx 4 8 => 1111111100000000,0000000811111111
-vinsdlx 4 a => 1111111100000000,0000000a11111111
-vinsdlx 8 0 => 1111111111111111,0000000000000000
-vinsdlx 8 2 => 1111111111111111,0000000000000002
-vinsdlx 8 4 => 1111111111111111,0000000000000004
-vinsdlx 8 6 => 1111111111111111,0000000000000006
-vinsdlx 8 8 => 1111111111111111,0000000000000008
-vinsdlx 8 a => 1111111111111111,000000000000000a
-vinsdlx 3 0 => 1111110000000000,0000001111111111
-vinsdlx 3 2 => 1111110000000000,0000021111111111
-vinsdlx 3 4 => 1111110000000000,0000041111111111
-vinsdlx 3 6 => 1111110000000000,0000061111111111
-vinsdlx 3 8 => 1111110000000000,0000081111111111
-vinsdlx 3 a => 1111110000000000,00000a1111111111
+vinsdlx 6 0 => 1111111111110000,0000000000001111
+vinsdlx 6 2 => 1111111111110000,0000000000021111
+vinsdlx 6 4 => 1111111111110000,0000000000041111
+vinsdlx 6 6 => 1111111111110000,0000000000061111
+vinsdlx 6 8 => 1111111111110000,0000000000081111
+vinsdlx 6 a => 1111111111110000,00000000000a1111
+vinsdlx 6 0 => 1111111111110000,0000000000001111
+vinsdlx 6 2 => 1111111111110000,0000000000021111
+vinsdlx 6 4 => 1111111111110000,0000000000041111
+vinsdlx 6 6 => 1111111111110000,0000000000061111
+vinsdlx 6 8 => 1111111111110000,0000000000081111
+vinsdlx 6 a => 1111111111110000,00000000000a1111
+vinsdlx 2 0 => 1111000000000000,0000111111111111
+vinsdlx 2 2 => 1111000000000000,0002111111111111
+vinsdlx 2 4 => 1111000000000000,0004111111111111
+vinsdlx 2 6 => 1111000000000000,0006111111111111
+vinsdlx 2 8 => 1111000000000000,0008111111111111
+vinsdlx 2 a => 1111000000000000,000a111111111111
vinsdrx 0 0 => 1111111111111111,0000000000000000
vinsdrx 0 2 => 1111111111111111,0000000000000002
@@ -6823,24 +6823,24 @@ vinsdrx 0 4 => 1111111111111111,0000000000000004
vinsdrx 0 6 => 1111111111111111,0000000000000006
vinsdrx 0 8 => 1111111111111111,0000000000000008
vinsdrx 0 a => 1111111111111111,000000000000000a
-vinsdrx 4 0 => 1111111100000000,0000000011111111
-vinsdrx 4 2 => 1111111100000000,0000000211111111
-vinsdrx 4 4 => 1111111100000000,0000000411111111
-vinsdrx 4 6 => 1111111100000000,0000000611111111
-vinsdrx 4 8 => 1111111100000000,0000000811111111
-vinsdrx 4 a => 1111111100000000,0000000a11111111
-vinsdrx 8 0 => 0,1111111111111111
-vinsdrx 8 2 => 2,1111111111111111
-vinsdrx 8 4 => 4,1111111111111111
-vinsdrx 8 6 => 6,1111111111111111
-vinsdrx 8 8 => 8,1111111111111111
-vinsdrx 8 a => a,1111111111111111
-vinsdrx 3 0 => 1111111111000000,0000000000111111
-vinsdrx 3 2 => 1111111111000000,0000000002111111
-vinsdrx 3 4 => 1111111111000000,0000000004111111
-vinsdrx 3 6 => 1111111111000000,0000000006111111
-vinsdrx 3 8 => 1111111111000000,0000000008111111
-vinsdrx 3 a => 1111111111000000,000000000a111111
+vinsdrx 6 0 => 1111000000000000,0000111111111111
+vinsdrx 6 2 => 1111000000000000,0002111111111111
+vinsdrx 6 4 => 1111000000000000,0004111111111111
+vinsdrx 6 6 => 1111000000000000,0006111111111111
+vinsdrx 6 8 => 1111000000000000,0008111111111111
+vinsdrx 6 a => 1111000000000000,000a111111111111
+vinsdrx 6 0 => 1111000000000000,0000111111111111
+vinsdrx 6 2 => 1111000000000000,0002111111111111
+vinsdrx 6 4 => 1111000000000000,0004111111111111
+vinsdrx 6 6 => 1111000000000000,0006111111111111
+vinsdrx 6 8 => 1111000000000000,0008111111111111
+vinsdrx 6 a => 1111000000000000,000a111111111111
+vinsdrx 2 0 => 1111111111110000,0000000000001111
+vinsdrx 2 2 => 1111111111110000,0000000000021111
+vinsdrx 2 4 => 1111111111110000,0000000000041111
+vinsdrx 2 6 => 1111111111110000,0000000000061111
+vinsdrx 2 8 => 1111111111110000,0000000000081111
+vinsdrx 2 a => 1111111111110000,00000000000a1111
vinsd 3 0 => 1111110000000000,0000001111111111
vinsd 3 2 => 1111110000000000,0000021111111111

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +0,0 @@
commit 124ae6cfa303f0cc71ffd685620cb57c4f8f02bb
Author: Andreas Arnez <arnez@linux.ibm.com>
Date: Mon Jun 7 14:01:53 2021 +0200
s390x: Don't emit "vector or with complement" on z13
The z/Architecture instruction "vector or with complement" (VOC) can be
used as an optimization to combine "vector or" with "vector nor". This is
exploited in Valgrind since commit 6c1cb1a0128b00858b973e. However, VOC
requires the vector-enhancements facility 1, which is not installed on a
z13 CPU. Thus Valgrind can now run into SIGILL on z13 when trying to
execute vector string instructions.
Fix this by suppressing the VOC optimization unless the
vector-enhancements facility 1 is recognized on the host.
diff --git a/VEX/priv/host_s390_isel.c b/VEX/priv/host_s390_isel.c
index ee20c6711..15ca92a6b 100644
--- a/VEX/priv/host_s390_isel.c
+++ b/VEX/priv/host_s390_isel.c
@@ -4102,14 +4102,17 @@ s390_isel_vec_expr_wrk(ISelEnv *env, IRExpr *expr)
case Iop_OrV128:
size = 16;
vec_binop = S390_VEC_OR;
- if (arg1->tag == Iex_Unop && arg1->Iex.Unop.op == Iop_NotV128) {
- IRExpr* orig_arg1 = arg1;
- arg1 = arg2;
- arg2 = orig_arg1->Iex.Unop.arg;
- vec_binop = S390_VEC_ORC;
- } else if (arg2->tag == Iex_Unop && arg2->Iex.Unop.op == Iop_NotV128) {
- arg2 = arg2->Iex.Unop.arg;
- vec_binop = S390_VEC_ORC;
+ if (s390_host_has_vxe) {
+ if (arg1->tag == Iex_Unop && arg1->Iex.Unop.op == Iop_NotV128) {
+ IRExpr* orig_arg1 = arg1;
+ arg1 = arg2;
+ arg2 = orig_arg1->Iex.Unop.arg;
+ vec_binop = S390_VEC_ORC;
+ } else if (arg2->tag == Iex_Unop &&
+ arg2->Iex.Unop.op == Iop_NotV128) {
+ arg2 = arg2->Iex.Unop.arg;
+ vec_binop = S390_VEC_ORC;
+ }
}
goto Iop_VV_wrk;

File diff suppressed because it is too large Load Diff

View File

@ -1,54 +0,0 @@
commit 45873298ff2d17accc65654d64758360616aade5
Author: Andreas Arnez <arnez@linux.ibm.com>
Date: Tue Mar 30 18:10:43 2021 +0200
s390x: Add missing UNOP insns to s390_insn_as_string
Some unary operator insns are not handled by s390_insn_as_string(). If
they are encountered while the appropriate trace flag is set, a vpanic
occurs. Fix this: add handling for the missing insns.
diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c
index 8762975b2..6e0734ae0 100644
--- a/VEX/priv/host_s390_defs.c
+++ b/VEX/priv/host_s390_defs.c
@@ -7860,12 +7860,24 @@ s390_insn_as_string(const s390_insn *insn)
op = "v-vunpacku";
break;
- case S390_VEC_FLOAT_NEG:
- op = "v-vfloatneg";
+ case S390_VEC_ABS:
+ op = "v-vabs";
break;
- case S390_VEC_FLOAT_SQRT:
- op = "v-vfloatsqrt";
+ case S390_VEC_COUNT_LEADING_ZEROES:
+ op = "v-vclz";
+ break;
+
+ case S390_VEC_COUNT_TRAILING_ZEROES:
+ op = "v-vctz";
+ break;
+
+ case S390_VEC_COUNT_ONES:
+ op = "v-vpopct";
+ break;
+
+ case S390_VEC_FLOAT_NEG:
+ op = "v-vfloatneg";
break;
case S390_VEC_FLOAT_ABS:
@@ -7876,6 +7888,10 @@ s390_insn_as_string(const s390_insn *insn)
op = "v-vfloatnabs";
break;
+ case S390_VEC_FLOAT_SQRT:
+ op = "v-vfloatsqrt";
+ break;
+
default:
goto fail;
}

View File

@ -1,15 +0,0 @@
index 389748960..07f3400f9 100644
--- a/coregrind/vgdb-invoker-ptrace.c
+++ b/coregrind/vgdb-invoker-ptrace.c
@@ -300,6 +300,10 @@ Bool waitstopped (pid_t pid, int signal_expected, const char *msg)
// realloc a bigger queue, and store new signal at the end.
// This is not very efficient but we assume not many sigs are queued.
+ if (signal_queue_sz >= 64) {
+ DEBUG(0, "too many queued signals while waiting for SIGSTOP\n");
+ return False;
+ }
signal_queue_sz++;
signal_queue = vrealloc(signal_queue,
sizeof(siginfo_t) * signal_queue_sz);

View File

@ -1,26 +0,0 @@
commit 200b6a5a0ea3e1e154663b0fc575bfe2becf177d
Author: Mark Wielaard <mark@klomp.org>
Date: Wed Jul 21 17:55:40 2021 +0200
m_debuginfo/debuginfo.c VG_(get_fnname_kind) _start is below main
With glibc 2.34 we might see the _start symbol as the frame that
called main instead of directly after __libc_start_main or
generic_start_main.
Fixes memcheck/tests/badjump[2], memcheck/tests/origin4-many,
helgrind/tests/tc04_free_lock, helgrind/tests/tc09_bad_unlock
and helgrind/tests/tc20_verifywrap.
diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c
index bc2578b37..e2218f266 100644
--- a/coregrind/m_debuginfo/debuginfo.c
+++ b/coregrind/m_debuginfo/debuginfo.c
@@ -2289,6 +2289,7 @@ Vg_FnNameKind VG_(get_fnname_kind) ( const HChar* name )
VG_STREQN(18, "__libc_start_main.", name) || // gcc optimization
VG_STREQ("generic_start_main", name) || // Yellow Dog doggedness
VG_STREQN(19, "generic_start_main.", name) || // gcc optimization
+ VG_STREQ("_start", name) ||
# elif defined(VGO_darwin)
// See readmacho.c for an explanation of this.
VG_STREQ("start_according_to_valgrind", name) || // Darwin, darling

View File

@ -2,8 +2,8 @@
Summary: Tool for finding memory management bugs in programs
Name: %{?scl_prefix}valgrind
Version: 3.17.0
Release: 13%{?dist}
Version: 3.18.0
Release: 0.1.RC1%{?dist}
Epoch: 1
License: GPLv2+
URL: http://www.valgrind.org/
@ -71,7 +71,7 @@ URL: http://www.valgrind.org/
# So those will already have their full symbol table.
%undefine _include_minidebuginfo
Source0: ftp://sourceware.org/pub/valgrind/valgrind-%{version}.tar.bz2
Source0: https://sourceware.org/pub/valgrind/valgrind-%{version}.RC1.tar.bz2
# Needs investigation and pushing upstream
Patch1: valgrind-3.9.0-cachegrind-improvements.patch
@ -85,103 +85,6 @@ Patch4: valgrind-3.16.0-some-stack-protector.patch
# Add some -Wl,z,now.
Patch5: valgrind-3.16.0-some-Wl-z-now.patch
# Upstream commits that provide additional ppc64le ISA 3.1 support
# commit 3cc0232c46a5905b4a6c2fbd302b58bf5f90b3d5
# PPC64: ISA 3.1 VSX PCV Generate Operations
# commit 078f89e99b6f62e043f6138c6a7ae238befc1f2a
# PPC64: Reduced-Precision bfloat16 Outer Product & Format Conversion Operations
# commit e09fdaf569b975717465ed8043820d0198d4d47d
# PPC64: Reduced-Precision: Missing Integer-based Outer Product Operations
Patch6: valgrind-3.17.0-ppc64-isa-3.1.patch
# Upstream commits that provide extra tests for ppc64le ISA 3.1 support
# commit c8fa838be405d7ac43035dcf675bf490800c26ec
# Reduced Precision bfloat16 outer product tests
# commit 4bcc6c8a97c10c4dd41b35bd3b3035ec4037d524
# VSX Permute Control Vector Generate Operation tests.
# commit c589b652939655090c005a982a71f50c489fb5ce
# Reduced precision Missing Integer based outer tests
Patch7: valgrind-3.17.0-ppc64-isa-3.1-tests.patch
# commit 45873298ff2d17accc65654d64758360616aade5
# s390x: Add missing UNOP insns to s390_insn_as_string
Patch8: valgrind-3.17.0-s390_insn_as_string.patch
# KDE#435908 Don't look for separate debuginfo if image already has .debug_info
Patch9: valgrind-3.17.0-debuginfod.patch
# KDE#423963 Only process clone results in the parent thread
Patch10: valgrind-3.17.0-clone-parent-res.patch
# commit d74a637206ef5532ccd2ccb2e31ee2762f184e60
# Bug 433863 - s390x: Remove memcheck test cases for cs, cds, and csg
# commit 18ddcc47c951427efd3b790ba2481159b9bd1598
# s390x: Support "expensive" comparisons Iop_ExpCmpNE32/64
# commit 5db3f929c43bf46f4707178706cfe90f43acdd19
# s390x: Add convenience function mkV128()
# commit e78bd78d3043729033b426218ab8c6dae9c51e96
# Bug 434296 - s390x: Rework IR conversion of VSTRC, VFAE, and VFEE
# commit 4f17a067c4f8245c05611d6e8aa36e8841bab376
# Bug 434296 - s390x: Rework IR conversion of VFENE
# commit 9bd78ebd8bb5cd4ebb3f081ceba46836cc485551
# Bug 434296 - s390x: Rework IR conversion of VISTR
# commit 32312d588b77c5b5b5a0145bb0cc6f795b447790
# Bug 434296 - s390x: Add memcheck test cases for vector string insns
# commit a0bb049ace14ab52d386bb1d49a399f39eec4986
# s390x: Improve handling of amodes without base register
# commit fd935e238d907d9c523a311ba795077d95ad6912
# s390x: Rework insn "v-vdup" and add "v-vrep"
# commit 6c1cb1a0128b00858b973ef9344e12d6ddbaaf57
# s390x: Add support for emitting "vector or with complement"
# commit 0bd4263326b2d48f782339a9bbe1a069c7de45c7
# s390x: Fix/optimize Iop_64HLtoV128
# commit cae5062b05b95e0303b1122a0ea9aadc197e4f0a
# s390x: Add missing stdout.exp for vector string memcheck test
Patch11: valgrind-3.17.0-s390-prep.patch
# KDE#432387 - s390x: z15 instructions support
Patch12: valgrind-3.17.0-s390-z15.patch
# commit 124ae6cfa303f0cc71ffd685620cb57c4f8f02bb
# s390x: Don't emit "vector or with complement" on z13
Patch13: valgrind-3.17.0-s390-z13-vec-fix.patch
# commit 6da22a4d246519cd1a638cfc7eff00cdd74413c4
# gdbserver_tests: update filters for newer glibc/gdb
Patch14: gdbserver_tests-update-filters-for-newer-glibc-gdb.patch
# KDE#439590 glibc-2.34 breaks suppressions against obj:*/lib*/libc-2.*so*
Patch15: helgrind-and-drd-suppression-libc-and-libpthread.patch
# KDE#420906 missing syscall wrapper for clone3 (435)
Patch16: valgrind-3.17.0-clone3.patch
# commit 200b6a5a0ea3e1e154663b0fc575bfe2becf177d
# m_debuginfo/debuginfo.c VG_(get_fnname_kind) _start is below main
Patch17: valgrind-3.17.0_start.patch
# KDE#440670 unhandled ppc64 syscalls 252 (statfs64 and 253 (fstatfs64)
Patch18: valgrind-3.17.0-ppc64-statfs64.patch
# KDE#441474 vgdb might eat all memory while waiting for sigstop
Patch19: valgrind-3.17.0-vgdb-queued-signals.patch
# KDE#440906 update test_isa_3_1_common.c to avoid modulo against hard regs
Patch20: valgrind-3.17.0-ppc64-test-isa-3-1.patch
# KDE#441512 remove troublesome block of code from guest_ppc_toIR for pstxvp
Patch21: valgrind-3.17.0-ppc64-pstxvp.patch
# KDE#441534 Update the expected output for test_isa_3_1_VRT
Patch22: valgrind-3.17.0-ppc64-test_isa_3_1_VRT.patch
# commit 10922b70b825a0a9b4df9694ceb9f20e93e2c11d
# m_debuginfo: Handle DW_TAG_atomic_type
Patch23: valgrind-3.17.0-dwarf-atomic_type.patch
# KDE#442061 Valgrind: very slow execution under Fedora 34
Patch24: valgrind-3.17.0-faster-readdwarf3.patch
BuildRequires: make
BuildRequires: glibc-devel
@ -212,9 +115,6 @@ BuildRequires: autoconf
# For make check validating the documentation
BuildRequires: docbook-dtds
# configure might use which
BuildRequires: which
# For testing debuginfod-find
%if 0%{?fedora} > 29 || 0%{?rhel} > 7
BuildRequires: elfutils-debuginfod-client
@ -311,7 +211,7 @@ Valgrind User Manual for details.
%endif
%prep
%setup -q -n %{?scl:%{pkg_name}}%{!?scl:%{name}}-%{version}
%setup -q -n %{?scl:%{pkg_name}}%{!?scl:%{name}}-%{version}.RC1
%patch1 -p1
%patch3 -p1
@ -322,30 +222,6 @@ Valgrind User Manual for details.
%patch5 -p1
%endif
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
touch memcheck/tests/s390x/vistr.stdout.exp
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%build
# LTO triggers undefined symbols in valgrind. Valgrind has a --enable-lto
# configure time option, but that doesn't seem to help.
@ -518,7 +394,9 @@ cat diffs
echo ===============END TESTING===============
%files
%doc COPYING NEWS README_*
%{!?_licensedir:%global license %%doc}
%license COPYING COPYING.DOCS
%doc NEWS README_*
%doc docs/installed/html docs/installed/*.pdf
%{_bindir}/*
%dir %{_libexecdir}/valgrind
@ -531,6 +409,8 @@ echo ===============END TESTING===============
%{_mandir}/man1/*
%files devel
%{!?_licensedir:%global license %%doc}
%license COPYING
%dir %{_includedir}/valgrind
%{_includedir}/valgrind/valgrind.h
%{_includedir}/valgrind/callgrind.h
@ -541,6 +421,8 @@ echo ===============END TESTING===============
%{_libdir}/pkgconfig/valgrind.pc
%if %{build_tools_devel}
%{!?_licensedir:%global license %%doc}
%license COPYING
%files tools-devel
%{_includedir}/valgrind/config.h
%{_includedir}/valgrind/libvex*h
@ -570,6 +452,10 @@ fi
%endif
%changelog
* Wed Oct 13 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.18.0-0.1.RC1
- Update to upstream 3.18.0-RC1
- Drop all upstreamed patches
* Mon Sep 20 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-13
- Add valgrind-3.17.0-dwarf-atomic_type.patch
- Add valgrind-3.17.0-faster-readdwarf3.patch