diff --git a/.gitignore b/.gitignore index 949c204..0abe58a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz +/v1.6.1.tar.gz /gdb-8.1.90.20180727.tar.xz -/v2.0.tar.gz diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include index 946c4af..8ba0e48 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -505,11 +505,8 @@ Patch120: gdb-vla-intel-fix-print-char-array.patch Patch121: gdb-rhbz1553104-s390x-arch12-test.patch # Implement IPv6 support for GDB/gdbserver (RH BZ 881849, Sergio Durigan Junior). -Patch122: gdb-rhbz881849-ipv6-1of3.patch +Patch122: gdb-rhbz881849-ipv6-1of2.patch - -Patch123: gdb-rhbz881849-ipv6-2of3.patch - - -Patch124: gdb-rhbz881849-ipv6-3of3.patch +# Implement IPv6 support for GDB/gdbserver (RH BZ 881849, Sergio Durigan Junior). +Patch123: gdb-rhbz881849-ipv6-2of2.patch diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include index 97f12c4..27a39b7 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -121,4 +121,3 @@ %patch121 -p1 %patch122 -p1 %patch123 -p1 -%patch124 -p1 diff --git a/_patch_order b/_patch_order index b10536c..11b4131 100644 --- a/_patch_order +++ b/_patch_order @@ -119,6 +119,5 @@ gdb-testsuite-readline63-sigint.patch gdb-archer.patch gdb-vla-intel-fix-print-char-array.patch gdb-rhbz1553104-s390x-arch12-test.patch -gdb-rhbz881849-ipv6-1of3.patch -gdb-rhbz881849-ipv6-2of3.patch -gdb-rhbz881849-ipv6-3of3.patch +gdb-rhbz881849-ipv6-1of2.patch +gdb-rhbz881849-ipv6-2of2.patch diff --git a/gdb-rhbz881849-ipv6-1of3.patch b/gdb-rhbz881849-ipv6-1of2.patch similarity index 99% rename from gdb-rhbz881849-ipv6-1of3.patch rename to gdb-rhbz881849-ipv6-1of2.patch index 7c3a664..50510c8 100644 --- a/gdb-rhbz881849-ipv6-1of3.patch +++ b/gdb-rhbz881849-ipv6-1of2.patch @@ -1,7 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Fri, 18 May 2018 01:29:24 -0400 -Subject: gdb-rhbz881849-ipv6-1of3.patch +Subject: gdb-rhbz881849-ipv6-1of2.patch ;; Implement IPv6 support for GDB/gdbserver (RH BZ 881849, Sergio Durigan Junior). diff --git a/gdb-rhbz881849-ipv6-2of2.patch b/gdb-rhbz881849-ipv6-2of2.patch new file mode 100644 index 0000000..339c966 --- /dev/null +++ b/gdb-rhbz881849-ipv6-2of2.patch @@ -0,0 +1,63 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Sergio Durigan Junior +Date: Fri, 13 Jul 2018 16:20:34 -0400 +Subject: gdb-rhbz881849-ipv6-2of2.patch + +;; Implement IPv6 support for GDB/gdbserver (RH BZ 881849, Sergio Durigan Junior). + +Expect for another variant of error message when gdbserver cannot resolve hostname + +I've noticed that on a few hosts, when given an invalid hostname, +gdbserver fails with: + + spawn /../../gdb/gdbserver/gdbserver --once tcp8:123:2353 /gdb/build/fedora-s390x/build/gdb/testsuite/outputs/gdb.server/server-connect/server-connect + tcp8:123:2353: cannot resolve name: No address associated with hostname + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + Exiting + +Unfortunately, this causes a fail on the new +gdb.server/server-connect.exp test (introduced by the IPv6 patch): + + FAIL: gdb.server/server-connect.exp: tcp8: start gdbserver: gdbserver should fail but did not + +This happens because we're expecting for another variant of this error +message: + + cannot resolve name: Name or service not known + +Therefore, this patch extends the helper function 'gdbserver_start' to +also recognize the "No address associated with hostname" message. +This "fixes" the testcase on the hosts that use this variant. + +gdb/testsuite/ChangeLog: +2018-07-13 Sergio Durigan Junior + + * lib/gdbserver-support.exp (gdbserver_start): Expect for the + message "No address associated with hostname" when gdbserver + cannot resolve the hostname. + +diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog +--- a/gdb/testsuite/ChangeLog ++++ b/gdb/testsuite/ChangeLog +@@ -1,3 +1,9 @@ ++2018-07-13 Sergio Durigan Junior ++ ++ * lib/gdbserver-support.exp (gdbserver_start): Expect for the ++ message "No address associated with hostname" when gdbserver ++ cannot resolve the hostname. ++ + 2018-07-11 Sergio Durigan Junior + Jan Kratochvil + Paul Fertser +diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp +--- a/gdb/testsuite/lib/gdbserver-support.exp ++++ b/gdb/testsuite/lib/gdbserver-support.exp +@@ -326,7 +326,7 @@ proc gdbserver_start { options arguments } { + continue + } + } +- -re ".*: cannot resolve name: Name or service not known\r\n" { ++ -re ".*: cannot resolve name: \(No address associated with hostname|Name or service not known\)\r\n" { + error "gdbserver cannot resolve name." + } + timeout { diff --git a/gdb-rhbz881849-ipv6-2of3.patch b/gdb-rhbz881849-ipv6-2of3.patch deleted file mode 100644 index 390be0f..0000000 --- a/gdb-rhbz881849-ipv6-2of3.patch +++ /dev/null @@ -1,54 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Sergio Durigan Junior -Date: Mon, 30 Jul 2018 15:23:27 -0400 -Subject: gdb-rhbz881849-ipv6-2of3.patch - -Match any kind of error after "cannot resolve name" on lib/gdbserver-support.exp:gdbserver_start - -On commit: - -commit 7f1f7e23939adc7d71036a17fc6081e3af7ca585 -Author: Sergio Durigan Junior -Date: Fri Jul 13 16:20:34 2018 -0400 - - Expect for another variant of error message when gdbserver cannot resolve hostname - -I extended the regular expression being used to identify whether -gdbserver could not resolve a (host)name. This was needed because the -error message being printed had a different variation across some -systems. However, as it turns out, I've just noticed that the message -has yet another variation: - - target remote tcp8:123:2353 - tcp8:123:2353: cannot resolve name: System error - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - tcp8:123:2353: No such file or directory. - (gdb) FAIL: gdb.server/server-connect.exp: tcp8: connect to gdbserver using tcp8:123 - -which is causing FAILs on some systems (namely, Fedora-i686 on -BuildBot). - -So instead of trying to predict everything that can be printed, I -decided to just match anything after the "cannot resolve name: " part. -This patch implements that. - -Regression tested on the BuildBot. - -gdb/testsuite/ChangeLog: -2018-07-30 Sergio Durigan Junior - - * lib/gdbserver-support.exp (gdbserver_start): Match any kind of - error after "cannot resolve name" string. - -diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp ---- a/gdb/testsuite/lib/gdbserver-support.exp -+++ b/gdb/testsuite/lib/gdbserver-support.exp -@@ -326,7 +326,7 @@ proc gdbserver_start { options arguments } { - continue - } - } -- -re ".*: cannot resolve name: Name or service not known\r\n" { -+ -re ".*: cannot resolve name: .*\r\n" { - error "gdbserver cannot resolve name." - } - timeout { diff --git a/gdb-rhbz881849-ipv6-3of3.patch b/gdb-rhbz881849-ipv6-3of3.patch deleted file mode 100644 index 789cb18..0000000 --- a/gdb-rhbz881849-ipv6-3of3.patch +++ /dev/null @@ -1,72 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Sergio Durigan Junior -Date: Fri, 3 Aug 2018 18:04:38 -0400 -Subject: gdb-rhbz881849-ipv6-3of3.patch - -Fix thinko when deciding whether to disable TCP's Nagle algorithm - -This patch fixes a thinko that happened when I was implementing the -IPv6 support on GDB/gdbserver. On certain situations, it is necessary -to disable TCP's Nagle algorithm (NODELAY). For obvious reasons, this -only applies when we are dealing with a TCP connection. - -While implementing the IPv6 patch, I noticed that the net_open -function (on gdb/ser-tcp.c) kept a flag indicating whether the -connection type was UDP or TCP. I eliminated that flag, and started -using the 'struct addrinfo *' related to the successful connection -directly. However, I made a mistake: - - if (success_ainfo->ai_socktype == IPPROTO_TCP) - ^^^^^^^^^^^ - { - /* Disable Nagle algorithm. Needed in some cases. */ - int tmp = 1; - - setsockopt (scb->fd, IPPROTO_TCP, TCP_NODELAY, - (char *) &tmp, sizeof (tmp)); - } - -The 'ai_socktype' field specifies the socket type (SOCK_STREAM or -SOCK_DGRAM), and not the protocol. This test was always failing, and -the Nagle algorithm was never being disabled. - -The obvious fix is to use the 'ai_protocol' field. This is what this -patch does. - -Huge "thank you" to Joel Brobecker who reported the regression (he was -experiencing an unusual delay while debugging a bare-metal program -running under QEMU) and helped me set up a proper reproducer for the -bug. - -gdb/ChangeLog: -2018-08-03 Sergio Durigan Junior - - * ser-tcp.c (net_open): Fix thinko when deciding whether to - disable TCP's Nagle algorithm (use "ai_protocol" instead of - "ai_socktype"). - -diff --git a/gdb/ChangeLog b/gdb/ChangeLog ---- a/gdb/ChangeLog -+++ b/gdb/ChangeLog -@@ -1,3 +1,9 @@ -+2018-08-03 Sergio Durigan Junior -+ -+ * ser-tcp.c (net_open): Fix thinko when deciding whether to -+ disable TCP's Nagle algorithm (use "ai_protocol" instead of -+ "ai_socktype"). -+ - 2018-07-25 Alan Hayward - - * target-descriptions.c (tdesc_register_bitsize): Rename. -diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c ---- a/gdb/ser-tcp.c -+++ b/gdb/ser-tcp.c -@@ -367,7 +367,7 @@ net_open (struct serial *scb, const char *name) - - ioctl (scb->fd, FIONBIO, &ioarg); - -- if (success_ainfo->ai_socktype == IPPROTO_TCP) -+ if (success_ainfo->ai_protocol == IPPROTO_TCP) - { - /* Disable Nagle algorithm. Needed in some cases. */ - int tmp = 1; diff --git a/gdb.spec b/gdb.spec index 6f3872a..7db6f72 100644 --- a/gdb.spec +++ b/gdb.spec @@ -26,7 +26,7 @@ Version: 8.1.90.%{snapsrc} # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 40%{?dist} +Release: 39%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -169,11 +169,14 @@ Source5: %{libstdcxxpython}.tar.xz Source6: gdbtui # libipt: Intel Processor Trace Decoder Library -%global libipt_version 2.0 +%global libipt_version 1.6.1 #=fedora Source7: v%{libipt_version}.tar.gz #=fedora Patch1142: v1.5-libipt-static.patch +# [rhel dts libipt] Fix [-Werror=implicit-fallthrough=] with gcc-7.1.1. +#=push+jan +Patch1171: v1.6.1-implicit-fallthrough.patch ## [testsuite] Fix false selftest.exp FAIL from system readline-6.3+ (Patrick Palka). ##=fedoratest @@ -412,6 +415,7 @@ tar xzf %{SOURCE7} ( cd processor-trace-%{libipt_version} %patch1142 -p1 +%patch1171 -p1 ) %endif @@ -1022,11 +1026,6 @@ fi %endif %changelog -* Wed Aug 8 2018 Sergio Durigan Junior - 8.1.90.20180727-40.fc29 -- Rebuild due to new libipt release. -- Adjust bundled libipt; remove unnecessary patch. -- Sync IPv6 patch with F-28 GDB. - * Wed Aug 8 2018 Jan Kratochvil - 8.1.90.20180727-39.fc29 - [dts] Fix build by removing a patch for already removed pahole.py . - [dts rhel6] Fix build by updating gdb-gnat-dwarf-crash-3of3.patch . diff --git a/sources b/sources index 5d8b853..193c57d 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz) = a8b1c54dd348cfeb37da73f968742896be3dd13a4215f8d8519870c2abea915f5176c3fa6989ddd10f20020a16f0fab20cbae68ee8d58a82234d8778023520f8 +SHA512 (v1.6.1.tar.gz) = c7c9c8ba78021fff3fde12a216f5729c6031114e5a727f49b7ff1a31c53b5ddba24d1b3aee252d8278ecd1fafe78a44ed059c12b9eb29eca33093e0720673468 SHA512 (gdb-8.1.90.20180727.tar.xz) = 0f8e9cfaeaf9f22361b3b8d5d490d0a8bea3eeaaa0c6813d5df0a6d5267ff3f597747cc0e97d70c4196d78ee32e0e82d5893283d71b449d89703893bf1ae0014 -SHA512 (v2.0.tar.gz) = ec63151e842c81cc73ea11ba560b63e005cefbe19d98de24ae5c8caa4de7c9c1d71d1ec5b6214a347592eac675b75a3d2b26d4691ca86f91020ebfea8e912939 diff --git a/v1.5-libipt-static.patch b/v1.5-libipt-static.patch index 6599445..477b6c4 100644 --- a/v1.5-libipt-static.patch +++ b/v1.5-libipt-static.patch @@ -1,8 +1,6 @@ -Index: processor-trace-2.0/libipt/CMakeLists.txt -=================================================================== ---- processor-trace-2.0.orig/libipt/CMakeLists.txt -+++ processor-trace-2.0/libipt/CMakeLists.txt -@@ -85,7 +85,7 @@ endif (CMAKE_HOST_WIN32) +--- processor-trace-1.5/libipt/CMakeLists.txt-orig 2016-04-07 08:52:14.000000000 +0200 ++++ processor-trace-1.5/libipt/CMakeLists.txt 2016-08-17 23:12:23.241109244 +0200 +@@ -81,7 +81,7 @@ endif (CMAKE_HOST_WIN32) set(LIBIPT_FILES ${LIBIPT_FILES} ${LIBIPT_SECTION_FILES}) @@ -11,10 +9,8 @@ Index: processor-trace-2.0/libipt/CMakeLists.txt ${LIBIPT_FILES} ) -Index: processor-trace-2.0/libipt/src/posix/init.c -=================================================================== ---- processor-trace-2.0.orig/libipt/src/posix/init.c -+++ processor-trace-2.0/libipt/src/posix/init.c +--- processor-trace-1.5/libipt/src/posix/init.c-orig 2016-04-07 08:52:14.000000000 +0200 ++++ processor-trace-1.5/libipt/src/posix/init.c 2016-08-23 09:04:11.540176668 +0200 @@ -29,7 +29,7 @@ #include "pt_ild.h" diff --git a/v1.6.1-implicit-fallthrough.patch b/v1.6.1-implicit-fallthrough.patch new file mode 100644 index 0000000..db844d3 --- /dev/null +++ b/v1.6.1-implicit-fallthrough.patch @@ -0,0 +1,23 @@ +gcc-7.1.1-1.fc27.x86_64 +/home/jkratoch/redhat/fedora/libipt/master/processor-trace-1.6.1/libipt/src/pt_block_decoder.c: In function ‘pt_blk_proceed_no_event_cached’: +/home/jkratoch/redhat/fedora/libipt/master/processor-trace-1.6.1/libipt/src/pt_block_decoder.c:2282:6: error: this statement may fall through [-Werror=implicit-fallthrough=] + if (bce.isize) { + ^ +/home/jkratoch/redhat/fedora/libipt/master/processor-trace-1.6.1/libipt/src/pt_block_decoder.c:2328:2: note: here + case ptbq_decode: { + ^~~~ + +diff --git a/libipt/src/pt_block_decoder.c b/libipt/src/pt_block_decoder.c +index 21783a6..91d5bb3 100644 +--- a/libipt/src/pt_block_decoder.c ++++ b/libipt/src/pt_block_decoder.c +@@ -2095,6 +2095,9 @@ static int pt_blk_proceed_no_event_cached(struct pt_block_decoder *decoder, + } + + /* Fall through to ptbq_decode. */ ++#if __GNUC__ >= 7 ++ __attribute__ ((fallthrough)); ++#endif + + case ptbq_decode: { + struct pt_insn_ext iext;