From af046d7244e6af847decef8820e98118f1b68f5a Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 4 Jul 2018 20:59:29 -0400 Subject: [PATCH 01/35] Rebase to FSF GDB 8.1.50.20180704 (8.2pre). Remove defattr directives from specfile. --- _git_upstream_commit | 2 +- gdb-6.5-bz216711-clone-is-outermost.patch | 2 +- gdb-archer-pie-addons-keep-disabled.patch | 2 +- gdb-bz541866-rwatch-before-run.patch | 4 ++-- gdb-container-rh-pkg.patch | 2 +- gdb-moribund-utrace-workaround.patch | 2 +- gdb-rhbz795424-bitpos-20of25.patch | 10 +++++----- gdb-rhbz795424-bitpos-22of25.patch | 6 +++--- gdb-rhbz795424-bitpos-23of25.patch | 24 +++++++++++------------ gdb-vla-intel-fortran-vla-strings.patch | 2 +- gdb.spec | 12 ++++++------ 11 files changed, 34 insertions(+), 34 deletions(-) diff --git a/_git_upstream_commit b/_git_upstream_commit index bcd1724..5e74af4 100644 --- a/_git_upstream_commit +++ b/_git_upstream_commit @@ -1 +1 @@ -fd1ae9058720aa2738cc4852647097dd89c2bb88 +9b960ba18c83e3f9aad16fe8bf845f5c469712bd diff --git a/gdb-6.5-bz216711-clone-is-outermost.patch b/gdb-6.5-bz216711-clone-is-outermost.patch index e90bd77..a549d10 100644 --- a/gdb-6.5-bz216711-clone-is-outermost.patch +++ b/gdb-6.5-bz216711-clone-is-outermost.patch @@ -115,7 +115,7 @@ diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c static void amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) { -@@ -1807,6 +1881,8 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch) +@@ -1808,6 +1882,8 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch) tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET; diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch index 4dc78f6..2671b7c 100644 --- a/gdb-archer-pie-addons-keep-disabled.patch +++ b/gdb-archer-pie-addons-keep-disabled.patch @@ -8,7 +8,7 @@ Subject: gdb-archer-pie-addons-keep-disabled.patch diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -15519,6 +15519,50 @@ initialize_breakpoint_ops (void) +@@ -15516,6 +15516,50 @@ initialize_breakpoint_ops (void) static struct cmd_list_element *enablebreaklist = NULL; diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch index d5595fa..912af65 100644 --- a/gdb-bz541866-rwatch-before-run.patch +++ b/gdb-bz541866-rwatch-before-run.patch @@ -10,7 +10,7 @@ Subject: gdb-bz541866-rwatch-before-run.patch diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -8804,7 +8804,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, +@@ -8801,7 +8801,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, int enabled, int internal, unsigned flags, int display_canonical) { @@ -19,7 +19,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c if (type == bp_hardware_breakpoint) { -@@ -14353,7 +14353,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition, +@@ -14350,7 +14350,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition, if (bpt->type == bp_hardware_breakpoint) { diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch index 35eb798..a58af23 100644 --- a/gdb-container-rh-pkg.patch +++ b/gdb-container-rh-pkg.patch @@ -9,7 +9,7 @@ Subject: gdb-container-rh-pkg.patch diff --git a/gdb/remote.c b/gdb/remote.c --- a/gdb/remote.c +++ b/gdb/remote.c -@@ -13904,7 +13904,17 @@ remote_target::pid_to_exec_file (int pid) +@@ -13901,7 +13901,17 @@ remote_target::pid_to_exec_file (int pid) char *annex = NULL; if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) diff --git a/gdb-moribund-utrace-workaround.patch b/gdb-moribund-utrace-workaround.patch index 36f985c..e02e83c 100644 --- a/gdb-moribund-utrace-workaround.patch +++ b/gdb-moribund-utrace-workaround.patch @@ -14,7 +14,7 @@ Bug in FSF GDB exploited by the ptrace-on-utrace interaction. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -12013,6 +12013,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode) +@@ -12010,6 +12010,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode) traps we can no longer explain. */ old_loc->events_till_retirement = 3 * (thread_count () + 1); diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index 85691f0..ed3bb09 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -1311,7 +1311,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c } return 0; } -@@ -6819,7 +6819,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1, +@@ -6816,7 +6816,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1, static int breakpoint_address_match_range (const address_space *aspace1, CORE_ADDR addr1, @@ -1320,7 +1320,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c CORE_ADDR addr2) { return ((gdbarch_has_global_breakpoints (target_gdbarch ()) -@@ -10902,7 +10902,7 @@ can_use_hardware_watchpoint (const std::vector &vals) +@@ -10899,7 +10899,7 @@ can_use_hardware_watchpoint (const std::vector &vals) && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR vaddr = value_address (v); @@ -1865,7 +1865,7 @@ diff --git a/gdb/frame.h b/gdb/frame.h diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c -@@ -1794,7 +1794,7 @@ set_gdbarch_wchar_signed (struct gdbarch *gdbarch, +@@ -1799,7 +1799,7 @@ set_gdbarch_wchar_signed (struct gdbarch *gdbarch, } const struct floatformat ** @@ -2758,7 +2758,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, struct expression *) override; -@@ -10408,7 +10408,7 @@ int remote_hw_watchpoint_length_limit = -1; +@@ -10405,7 +10405,7 @@ int remote_hw_watchpoint_length_limit = -1; int remote_hw_breakpoint_limit = -1; int @@ -3430,7 +3430,7 @@ diff --git a/gdb/x86-nat.c b/gdb/x86-nat.c +x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { struct x86_debug_reg_state *state - = x86_debug_reg_state (ptid_get_pid (inferior_ptid)); + = x86_debug_reg_state (inferior_ptid.pid ()); diff --git a/gdb/x86-nat.h b/gdb/x86-nat.h --- a/gdb/x86-nat.h +++ b/gdb/x86-nat.h diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch index 5788c27..eb81a17 100644 --- a/gdb-rhbz795424-bitpos-22of25.patch +++ b/gdb-rhbz795424-bitpos-22of25.patch @@ -384,7 +384,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c int can_use_hw_breakpoint (enum bptype, int, int) override; -@@ -10337,7 +10337,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, +@@ -10334,7 +10334,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); @@ -393,7 +393,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); -@@ -10357,7 +10357,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, +@@ -10354,7 +10354,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, bool remote_target::watchpoint_addr_within_range (CORE_ADDR addr, @@ -402,7 +402,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c { CORE_ADDR diff = remote_address_masked (addr - start); -@@ -10386,7 +10386,7 @@ remote_target::remove_watchpoint (CORE_ADDR addr, int len, +@@ -10383,7 +10383,7 @@ remote_target::remove_watchpoint (CORE_ADDR addr, int len, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); diff --git a/gdb-rhbz795424-bitpos-23of25.patch b/gdb-rhbz795424-bitpos-23of25.patch index bb78022..ebbe696 100644 --- a/gdb-rhbz795424-bitpos-23of25.patch +++ b/gdb-rhbz795424-bitpos-23of25.patch @@ -600,7 +600,7 @@ diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c -@@ -477,7 +477,7 @@ static void +@@ -489,7 +489,7 @@ static void mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, int reg_num, int length, enum bfd_endian endian, gdb_byte *in, @@ -609,7 +609,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c { int reg_offset = 0; -@@ -500,8 +500,8 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, +@@ -512,8 +512,8 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, } if (mips_debug) fprintf_unfiltered (gdb_stderr, @@ -620,7 +620,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c if (mips_debug && out != NULL) { int i; -@@ -4531,13 +4531,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -4543,13 +4543,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte ref_valbuf[MAX_MIPS_ABI_REGSIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -637,7 +637,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c /* The EABI passes structures that do not fit in a register by reference. */ -@@ -4807,7 +4807,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -4819,7 +4819,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct value *function, static int mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, @@ -646,7 +646,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c { int i; -@@ -4822,7 +4822,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, +@@ -4834,7 +4834,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, for (i = 0; i < TYPE_NFIELDS (arg_type); i++) { @@ -655,7 +655,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c struct type *field_type; /* We're only looking at normal fields. */ -@@ -4864,7 +4864,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -4876,7 +4876,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; @@ -664,7 +664,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5215,11 +5215,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -5227,11 +5227,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, : MIPS_V0_REGNUM); field < TYPE_NFIELDS (type); field++, regnum += 2) { @@ -680,7 +680,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) { /* A 16-byte long double field goes in two consecutive -@@ -5261,8 +5261,8 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -5273,8 +5273,8 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, if (offset + xfer > TYPE_LENGTH (type)) xfer = TYPE_LENGTH (type) - offset; if (mips_debug) @@ -691,7 +691,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c mips_xfer_register (gdbarch, regcache, gdbarch_num_regs (gdbarch) + regnum, xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf, -@@ -5320,7 +5320,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -5332,7 +5332,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; @@ -700,7 +700,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5384,13 +5384,13 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -5396,13 +5396,13 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -717,7 +717,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c val = value_contents (arg); -@@ -5844,8 +5844,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -5856,8 +5856,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; @@ -728,7 +728,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5905,13 +5905,13 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -5917,13 +5917,13 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch index 980b94c..b0f38f6 100644 --- a/gdb-vla-intel-fortran-vla-strings.patch +++ b/gdb-vla-intel-fortran-vla-strings.patch @@ -33,7 +33,7 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings diff --git a/gdb/NEWS b/gdb/NEWS --- a/gdb/NEWS +++ b/gdb/NEWS -@@ -103,6 +103,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* +@@ -106,6 +106,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* *** Changes in GDB 8.1 diff --git a/gdb.spec b/gdb.spec index f4749d6..550650b 100644 --- a/gdb.spec +++ b/gdb.spec @@ -18,7 +18,7 @@ Name: %{?scl_prefix}gdb # Freeze it when GDB gets branched -%global snapsrc 20180629 +%global snapsrc 20180704 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20161115 %global tarname gdb-%{version} @@ -26,7 +26,7 @@ Version: 8.1.50.%{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: 27%{?dist} +Release: 28%{?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 @@ -937,7 +937,6 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb/command/backtrace.py %endif %files -%defattr(-,root,root) # File must begin with "/": {GFDL,COPYING3,COPYING,COPYING.LIB,COPYING3.LIB} %if 0%{!?el6:1} %license COPYING3 COPYING COPYING.LIB COPYING3.LIB @@ -957,7 +956,6 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb/command/backtrace.py %{_includedir}/gdb %if 0%{!?scl:1} %files headless -%defattr(-,root,root) %{_prefix}/libexec/gdb %endif %config(noreplace) %{_sysconfdir}/gdbinit @@ -980,7 +978,6 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb/command/backtrace.py %ifnarch sparc sparcv9 %files gdbserver -%defattr(-,root,root) %{_bindir}/gdbserver %{_mandir}/*/gdbserver.1* %if %{have_inproctrace} @@ -1007,7 +1004,6 @@ done %files doc %doc %{gdb_build}/gdb/doc/{gdb,annotate}.{html,pdf} -%defattr(-,root,root) %{_infodir}/annotate.info* %{_infodir}/gdb.info* @@ -1040,6 +1036,10 @@ fi %endif %changelog +* Wed Jul 4 2018 Sergio Durigan Junior - 8.1.50.20180704-28.fc29 +- Rebase to FSF GDB 8.1.50.20180704 (8.2pre). +- Remove defattr directives from specfile. + * Mon Jul 02 2018 Miro Hrončok - Rebuilt for Python 3.7 From 26734721d06275e6ea62db569eb43ab7d8437f60 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 4 Jul 2018 23:23:08 -0400 Subject: [PATCH 02/35] Upload source files for last version --- .gitignore | 1 + sources | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index a46c566..ddf9f38 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /gdb-libstdc++-v3-python-7.1.1-20170526.tar.xz /v1.6.1.tar.gz /gdb-8.1.50.20180629.tar.xz +/gdb-8.1.50.20180704.tar.xz diff --git a/sources b/sources index d1088ae..523fa53 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ SHA512 (gdb-libstdc++-v3-python-7.1.1-20170526.tar.xz) = 3d540b99581ffa4cf2810bec979c9a01a1f8ce782b7c8efb46b40dd2421d60cdb0e52b53c5477c3e86a57957a2a14489f5c29dc53868738a1ef79e79cf76d0a1 SHA512 (v1.6.1.tar.gz) = c7c9c8ba78021fff3fde12a216f5729c6031114e5a727f49b7ff1a31c53b5ddba24d1b3aee252d8278ecd1fafe78a44ed059c12b9eb29eca33093e0720673468 SHA512 (gdb-8.1.50.20180629.tar.xz) = 8950feb5f7a6fef41f6220aa01d93454ed0198b4c0e6fb021da4235b537fab46d46031593e251a6255d9e2a715f0f9174abdf068ee8fc3e1b0c99d60a5b75a95 +SHA512 (gdb-8.1.50.20180704.tar.xz) = de107599477ba885db7604dd7da9762e88fc7543c115291dedaf9917832fb2b809c6d853bdc2eeb748938c67199ae672d15b9da0be25e9bf7993a3ee35284bdc From 9d054c36c29149bf321b7b13bde0742cbe4f8027 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 4 Jul 2018 23:23:41 -0400 Subject: [PATCH 03/35] Delete old sources --- .gitignore | 1 - sources | 1 - 2 files changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index ddf9f38..5774773 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /gdb-libstdc++-v3-python-7.1.1-20170526.tar.xz /v1.6.1.tar.gz -/gdb-8.1.50.20180629.tar.xz /gdb-8.1.50.20180704.tar.xz diff --git a/sources b/sources index 523fa53..a264632 100644 --- a/sources +++ b/sources @@ -1,4 +1,3 @@ SHA512 (gdb-libstdc++-v3-python-7.1.1-20170526.tar.xz) = 3d540b99581ffa4cf2810bec979c9a01a1f8ce782b7c8efb46b40dd2421d60cdb0e52b53c5477c3e86a57957a2a14489f5c29dc53868738a1ef79e79cf76d0a1 SHA512 (v1.6.1.tar.gz) = c7c9c8ba78021fff3fde12a216f5729c6031114e5a727f49b7ff1a31c53b5ddba24d1b3aee252d8278ecd1fafe78a44ed059c12b9eb29eca33093e0720673468 -SHA512 (gdb-8.1.50.20180629.tar.xz) = 8950feb5f7a6fef41f6220aa01d93454ed0198b4c0e6fb021da4235b537fab46d46031593e251a6255d9e2a715f0f9174abdf068ee8fc3e1b0c99d60a5b75a95 SHA512 (gdb-8.1.50.20180704.tar.xz) = de107599477ba885db7604dd7da9762e88fc7543c115291dedaf9917832fb2b809c6d853bdc2eeb748938c67199ae672d15b9da0be25e9bf7993a3ee35284bdc From e95ed4b7b34b423a08d421b6eeccf43145a375a0 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Sun, 8 Jul 2018 18:48:11 -0400 Subject: [PATCH 04/35] Rebase to FSF GDB 8.1.90.20180708 (8.2pre). --- .gitignore | 2 +- _git_upstream_commit | 2 +- gdb-archer-pie-addons-keep-disabled.patch | 2 +- gdb-attach-fail-reasons-5of5.patch | 2 +- gdb-glibc-strstr-workaround.patch | 2 +- gdb-gnat-dwarf-crash-3of3.patch | 12 ++++++------ gdb-libexec-add-index.patch | 2 +- gdb-rhbz795424-bitpos-20of25.patch | 6 +++--- gdb-vla-intel-fortran-strides.patch | 8 ++++---- gdb-vla-intel-fortran-vla-strings.patch | 24 +++++++++++------------ gdb.spec | 9 ++++++--- sources | 2 +- 12 files changed, 38 insertions(+), 35 deletions(-) diff --git a/.gitignore b/.gitignore index 5774773..b7dd60d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /gdb-libstdc++-v3-python-7.1.1-20170526.tar.xz /v1.6.1.tar.gz -/gdb-8.1.50.20180704.tar.xz +/gdb-8.1.90.20180708.tar.xz diff --git a/_git_upstream_commit b/_git_upstream_commit index 5e74af4..d890f7b 100644 --- a/_git_upstream_commit +++ b/_git_upstream_commit @@ -1 +1 @@ -9b960ba18c83e3f9aad16fe8bf845f5c469712bd +0bad166b920254974ad2e35f087e14aa913afe44 diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch index 2671b7c..672734f 100644 --- a/gdb-archer-pie-addons-keep-disabled.patch +++ b/gdb-archer-pie-addons-keep-disabled.patch @@ -62,7 +62,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h -@@ -1684,6 +1684,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg); +@@ -1679,6 +1679,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg); UIOUT iff debugging multiple threads. */ extern void maybe_print_thread_hit_breakpoint (struct ui_out *uiout); diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch index 6842d18..c8b1267 100644 --- a/gdb-attach-fail-reasons-5of5.patch +++ b/gdb-attach-fail-reasons-5of5.patch @@ -276,7 +276,7 @@ diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c -@@ -1088,7 +1088,17 @@ linux_nat_target::create_inferior (const char *exec_file, +@@ -1089,7 +1089,17 @@ linux_nat_target::create_inferior (const char *exec_file, /* Make sure we report all signals during startup. */ pass_signals (0, NULL); diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch index 952be44..c087a68 100644 --- a/gdb-glibc-strstr-workaround.patch +++ b/gdb-glibc-strstr-workaround.patch @@ -9,7 +9,7 @@ Subject: gdb-glibc-strstr-workaround.patch diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -21255,6 +21255,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, +@@ -21254,6 +21254,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* Cache this symbol's name and the name's demangled form (if any). */ SYMBOL_SET_LANGUAGE (sym, cu->language, &objfile->objfile_obstack); linkagename = dwarf2_physname (name, die, cu); diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch index 5b270bf..e36ec7c 100644 --- a/gdb-gnat-dwarf-crash-3of3.patch +++ b/gdb-gnat-dwarf-crash-3of3.patch @@ -42,7 +42,7 @@ gdb/ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -10483,6 +10483,13 @@ private: +@@ -10482,6 +10482,13 @@ private: static void process_die (struct die_info *die, struct dwarf2_cu *cu) { @@ -89,7 +89,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c /* The saved to_close method, inherited from inf-ptrace.c. Called by our to_close. */ static void (*super_close) (struct target_ops *); -@@ -1026,6 +1032,9 @@ linux_nat_post_attach_wait (ptid_t ptid, int *signalled) +@@ -1027,6 +1033,9 @@ linux_nat_post_attach_wait (ptid_t ptid, int *signalled) if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "LNPAW: Attaching to a stopped process\n"); @@ -99,7 +99,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c /* The process is definitely stopped. It is in a job control stop, unless the kernel predates the TASK_STOPPED / -@@ -1358,6 +1367,25 @@ get_detach_signal (struct lwp_info *lp) +@@ -1359,6 +1368,25 @@ get_detach_signal (struct lwp_info *lp) return gdb_signal_to_host (signo); } @@ -125,7 +125,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c return 0; } -@@ -1506,6 +1534,10 @@ linux_nat_target::detach (inferior *inf, int from_tty) +@@ -1507,6 +1535,10 @@ linux_nat_target::detach (inferior *inf, int from_tty) detach_one_lwp (main_lwp, &signo); detach_success (inf); @@ -136,7 +136,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c } } -@@ -1764,6 +1796,16 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo) +@@ -1765,6 +1797,16 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo) return; } @@ -153,7 +153,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c if (resume_many) iterate_over_lwps (ptid, linux_nat_resume_callback, lp); -@@ -3760,6 +3802,10 @@ linux_nat_target::mourn_inferior () +@@ -3761,6 +3803,10 @@ linux_nat_target::mourn_inferior () /* Let the arch-specific native code know this process is gone. */ linux_target->low_forget_process (pid); diff --git a/gdb-libexec-add-index.patch b/gdb-libexec-add-index.patch index af19eab..7856866 100644 --- a/gdb-libexec-add-index.patch +++ b/gdb-libexec-add-index.patch @@ -20,4 +20,4 @@ diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh + myname="${0##*/}" - if test $# != 1; then + dwarf5="" diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index ed3bb09..e3d4713 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -1650,7 +1650,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } static void -@@ -14934,8 +14934,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, +@@ -14933,8 +14933,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, object, and then subtract off the number of bits of the field itself. The result is the bit offset of the LSB of the field. */ @@ -3039,7 +3039,7 @@ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c paddress (gdbarch, offset), reg); } add_memrange (gdbarch, reg, offset, len); -@@ -2475,7 +2475,8 @@ info_scope_command (const char *args_in, int from_tty) +@@ -2447,7 +2447,8 @@ info_scope_command (const char *args_in, int from_tty) const char *symname; const char *save_args = args_in; struct block_iterator iter; @@ -3049,7 +3049,7 @@ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c struct gdbarch *gdbarch; int regno; const char *args = args_in; -@@ -2619,8 +2620,11 @@ info_scope_command (const char *args_in, int from_tty) +@@ -2591,8 +2592,11 @@ info_scope_command (const char *args_in, int from_tty) } } if (SYMBOL_TYPE (sym)) diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch index 941a9d0..ddd2be0 100644 --- a/gdb-vla-intel-fortran-strides.patch +++ b/gdb-vla-intel-fortran-strides.patch @@ -143,7 +143,7 @@ diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -17535,7 +17535,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17534,7 +17534,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type, *orig_base_type; struct type *range_type; struct attribute *attr; @@ -152,7 +152,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c int low_default_is_valid; int high_bound_is_count = 0; const char *name; -@@ -17555,7 +17555,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17554,7 +17554,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) low.kind = PROP_CONST; high.kind = PROP_CONST; @@ -162,7 +162,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow omitting DW_AT_lower_bound. */ -@@ -17588,6 +17590,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17587,6 +17589,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) break; } @@ -177,7 +177,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) attr_to_dynamic_prop (attr, die, cu, &low); -@@ -17665,7 +17675,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17664,7 +17674,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask)) high.data.const_val |= negative_mask; diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch index b0f38f6..29cb4ec 100644 --- a/gdb-vla-intel-fortran-vla-strings.patch +++ b/gdb-vla-intel-fortran-vla-strings.patch @@ -87,7 +87,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c /* memory allocation interface */ -@@ -13633,7 +13634,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -13632,7 +13633,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) { newobj->static_link = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop); @@ -96,7 +96,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } cu->list_in_scope = &local_symbols; -@@ -16298,7 +16299,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -16297,7 +16298,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) byte_stride_prop = (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop)); @@ -106,7 +106,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (!stride_ok) { complaint (_("unable to read array DW_AT_byte_stride " -@@ -17059,29 +17061,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17058,29 +17060,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -208,7 +208,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -17429,7 +17492,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17428,7 +17491,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, @@ -218,7 +218,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c { struct dwarf2_property_baton *baton; struct obstack *obstack -@@ -17440,14 +17504,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17439,14 +17503,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, if (attr_form_is_block (attr)) { @@ -256,7 +256,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } else if (attr_form_is_ref (attr)) { -@@ -17480,8 +17563,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17479,8 +17562,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, baton = XOBNEW (obstack, struct dwarf2_property_baton); baton->referenced_type = die_type (target_die, target_cu); baton->locexpr.per_cu = cu->per_cu; @@ -287,7 +287,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c prop->data.baton = baton; prop->kind = PROP_LOCEXPR; gdb_assert (prop->data.baton != NULL); -@@ -17592,7 +17695,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17591,7 +17694,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_byte_stride, cu); if (attr) @@ -296,7 +296,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c complaint (_("Missing DW_AT_byte_stride " "- DIE at 0x%s [in module %s]"), sect_offset_str (die->sect_off), -@@ -17600,7 +17703,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17599,7 +17702,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) @@ -305,7 +305,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c else if (!low_default_is_valid) complaint (_("Missing DW_AT_lower_bound " "- DIE at %s [in module %s]"), -@@ -17608,10 +17711,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17607,10 +17710,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) objfile_name (cu->per_cu->dwarf2_per_objfile->objfile)); attr = dwarf2_attr (die, DW_AT_upper_bound, cu); @@ -318,7 +318,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c { /* If bounds are constant do the final calculation here. */ if (low.kind == PROP_CONST && high.kind == PROP_CONST) -@@ -25112,7 +25215,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25111,7 +25214,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_allocated, cu); if (attr_form_is_block (attr)) { @@ -327,7 +327,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ALLOCATED, prop, type); } else if (attr != NULL) -@@ -25126,7 +25229,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25125,7 +25228,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_associated, cu); if (attr_form_is_block (attr)) { @@ -336,7 +336,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type); } else if (attr != NULL) -@@ -25138,7 +25241,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25137,7 +25240,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) /* Read DW_AT_data_location and set in type. */ attr = dwarf2_attr (die, DW_AT_data_location, cu); diff --git a/gdb.spec b/gdb.spec index 550650b..6fbd493 100644 --- a/gdb.spec +++ b/gdb.spec @@ -18,15 +18,15 @@ Name: %{?scl_prefix}gdb # Freeze it when GDB gets branched -%global snapsrc 20180704 +%global snapsrc 20180708 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20161115 %global tarname gdb-%{version} -Version: 8.1.50.%{snapsrc} +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: 28%{?dist} +Release: 29%{?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 @@ -1036,6 +1036,9 @@ fi %endif %changelog +* Sun Jul 8 2018 Sergio Durigan Junior - 8.1.90.20180708-29.fc29 +- Rebase to FSF GDB 8.1.90.20180708 (8.2pre). + * Wed Jul 4 2018 Sergio Durigan Junior - 8.1.50.20180704-28.fc29 - Rebase to FSF GDB 8.1.50.20180704 (8.2pre). - Remove defattr directives from specfile. diff --git a/sources b/sources index a264632..f2c3b6f 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (gdb-libstdc++-v3-python-7.1.1-20170526.tar.xz) = 3d540b99581ffa4cf2810bec979c9a01a1f8ce782b7c8efb46b40dd2421d60cdb0e52b53c5477c3e86a57957a2a14489f5c29dc53868738a1ef79e79cf76d0a1 SHA512 (v1.6.1.tar.gz) = c7c9c8ba78021fff3fde12a216f5729c6031114e5a727f49b7ff1a31c53b5ddba24d1b3aee252d8278ecd1fafe78a44ed059c12b9eb29eca33093e0720673468 -SHA512 (gdb-8.1.50.20180704.tar.xz) = de107599477ba885db7604dd7da9762e88fc7543c115291dedaf9917832fb2b809c6d853bdc2eeb748938c67199ae672d15b9da0be25e9bf7993a3ee35284bdc +SHA512 (gdb-8.1.90.20180708.tar.xz) = 95e0a841327536df7ba25e970e9696ebdbe8454203ac5fdb060a408ce6021ab353dc98ba292100f2c7d60f382f08d9972dcf35221c256f907f5af12b656a94bd From 100fc38c45e481ae7df6e68c7c888f1baf4b0c20 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Tue, 10 Jul 2018 17:23:26 -0400 Subject: [PATCH 05/35] Remove BuildRoot: directive from specfile. Ref.: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/JJC5E3YKO4HNVLTKCLSDKLS6WMZSXOBK/ --- gdb.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/gdb.spec b/gdb.spec index 6fbd493..d87cd2d 100644 --- a/gdb.spec +++ b/gdb.spec @@ -34,7 +34,6 @@ Group: Development/Debuggers # ftp://sourceware.org/pub/gdb/releases/FIXME{tarname}.tar.xz Source: %{tarname}.tar.xz #Source: ftp://sourceware.org/pub/gdb/releases/%{tarname}.tar.xz -Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) URL: http://gnu.org/software/gdb/ # For our convenience From 0ec66a7bfbb337220105e04d4ebca3671c9bd40c Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Thu, 12 Jul 2018 00:36:08 -0400 Subject: [PATCH 06/35] Rebuild due to GCC ABI change. --- gdb.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb.spec b/gdb.spec index d87cd2d..2243e8a 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: 29%{?dist} +Release: 30%{?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 @@ -1035,6 +1035,9 @@ fi %endif %changelog +* Thu Jul 12 2018 Sergio Durigan Junior - 8.1.90.20180708-30.fc29 +- Rebuild due to GCC ABI change. + * Sun Jul 8 2018 Sergio Durigan Junior - 8.1.90.20180708-29.fc29 - Rebase to FSF GDB 8.1.90.20180708 (8.2pre). From 4f936c1cb8028d029a06a0c55cadd4df363c40bf Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 12 Jul 2018 10:47:14 +0200 Subject: [PATCH 07/35] [dts] Upgrade libstdc++-v3-python to 8.1.1-20180626. --- .gitignore | 2 +- gdb.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b7dd60d..641e0d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -/gdb-libstdc++-v3-python-7.1.1-20170526.tar.xz +/gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz /v1.6.1.tar.gz /gdb-8.1.90.20180708.tar.xz diff --git a/gdb.spec b/gdb.spec index 2243e8a..19be478 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: 30%{?dist} +Release: 31%{?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 @@ -160,7 +160,7 @@ Source3: gdb-gstack.man Source4: gdbinit # libstdc++ pretty printers from GCC SVN. -%global libstdcxxpython gdb-libstdc++-v3-python-7.1.1-20170526 +%global libstdcxxpython gdb-libstdc++-v3-python-8.1.1-20180626 #=fedora Source5: %{libstdcxxpython}.tar.xz @@ -1035,6 +1035,9 @@ fi %endif %changelog +* Thu Jul 12 2018 Jan Kratochvil - 8.1.90.20180708-31.fc29 +- [dts] Upgrade libstdc++-v3-python to 8.1.1-20180626. + * Thu Jul 12 2018 Sergio Durigan Junior - 8.1.90.20180708-30.fc29 - Rebuild due to GCC ABI change. diff --git a/sources b/sources index f2c3b6f..f21c314 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (gdb-libstdc++-v3-python-7.1.1-20170526.tar.xz) = 3d540b99581ffa4cf2810bec979c9a01a1f8ce782b7c8efb46b40dd2421d60cdb0e52b53c5477c3e86a57957a2a14489f5c29dc53868738a1ef79e79cf76d0a1 +SHA512 (gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz) = a8b1c54dd348cfeb37da73f968742896be3dd13a4215f8d8519870c2abea915f5176c3fa6989ddd10f20020a16f0fab20cbae68ee8d58a82234d8778023520f8 SHA512 (v1.6.1.tar.gz) = c7c9c8ba78021fff3fde12a216f5729c6031114e5a727f49b7ff1a31c53b5ddba24d1b3aee252d8278ecd1fafe78a44ed059c12b9eb29eca33093e0720673468 SHA512 (gdb-8.1.90.20180708.tar.xz) = 95e0a841327536df7ba25e970e9696ebdbe8454203ac5fdb060a408ce6021ab353dc98ba292100f2c7d60f382f08d9972dcf35221c256f907f5af12b656a94bd From 5cc516897b427f843d99ba2d7bae01cbe9b400af Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 12 Jul 2018 11:16:09 +0200 Subject: [PATCH 08/35] Remove as no longer needed: Workaround gcc-8.0: -Wno-error=cast-function-type,stringop-truncation --- gdb.spec | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/gdb.spec b/gdb.spec index 19be478..8b74d3a 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: 31%{?dist} +Release: 32%{?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 @@ -503,18 +503,6 @@ cd %{gdb_build}$fprofile export CFLAGS="$RPM_OPT_FLAGS %{?_with_asan:-fsanitize=address}" export LDFLAGS="%{?__global_ldflags} %{?_with_asan:-fsanitize=address}" -%if 0%{?fedora} > 27 || 0%{?rhel} > 7 -# FIXME: gcc-8.0: -# ./elf32-target.h:215:4: error: cast between incompatible function types from 'void * (*)(bfd *)' {aka 'void * (*)(struct bfd *)'} to 'asymbol * (*)(bfd *, void *, long unsigned int)' {aka 'struct bfd_symbol * (*)(struct bfd *, void *, long unsigned int)'} [-Werror=cast-function-type] -# ((asymbol * (*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) -CFLAGS="$CFLAGS -Wno-error=cast-function-type" - -# FIXME: gcc-8.0: -# linux-tdep.c:1767:11: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound 17 equals destination size [-Werror=stringop-truncation] -# strncpy (p->pr_fname, basename, sizeof (p->pr_fname)); -CFLAGS="$CFLAGS -Wno-error=stringop-truncation" -%endif # 0%{?fedora} > 27 || 0%{?rhel} > 7 - %if 0%{!?rhel:1} || 0%{?rhel} > 7 CFLAGS="$CFLAGS -DDNF_DEBUGINFO_INSTALL" %endif @@ -1035,6 +1023,10 @@ fi %endif %changelog +* Thu Jul 12 2018 Jan Kratochvil - 8.1.90.20180708-32.fc29 +- Remove as no longer needed: + Workaround gcc-8.0: -Wno-error=cast-function-type,stringop-truncation + * Thu Jul 12 2018 Jan Kratochvil - 8.1.90.20180708-31.fc29 - [dts] Upgrade libstdc++-v3-python to 8.1.1-20180626. From 138f53b360a04c979da1ff83e0f3c07245dc4f91 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 12 Jul 2018 12:25:43 +0200 Subject: [PATCH 09/35] [dts] [rhel6] Do not use mpfr as rhel6 has mpfr-2 while GDB requires mpfr-3. --- gdb.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gdb.spec b/gdb.spec index 8b74d3a..f928885 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: 32%{?dist} +Release: 33%{?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 @@ -244,8 +244,11 @@ BuildRequires: libipt-devel%{buildisa} %endif %endif %endif +%if 0%{!?rhel:1} || 0%{?rhel} > 6 # See https://bugzilla.redhat.com/show_bug.cgi?id=1593280 +# DTS RHEL-6 has mpfr-2 while GDB requires mpfr-3. BuildRequires: mpfr-devel%{buildisa} +%endif %if 0%{?_with_testsuite:1} @@ -614,7 +617,11 @@ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \ %else --without-intel-pt \ %endif +%if 0%{!?rhel:1} || 0%{?rhel} > 6 --with-mpfr \ +%else + --without-mpfr \ +%endif --with-auto-load-dir='$debugdir:$datadir/auto-load%{?scl::%{_root_datadir}/gdb/auto-load}' \ --with-auto-load-safe-path='$debugdir:$datadir/auto-load%{?scl::%{_root_datadir}/gdb/auto-load}' \ %ifarch sparc sparcv9 @@ -1023,6 +1030,9 @@ fi %endif %changelog +* Thu Jul 12 2018 Jan Kratochvil - 8.1.90.20180708-33.fc29 +- [dts] [rhel6] Do not use mpfr as rhel6 has mpfr-2 while GDB requires mpfr-3. + * Thu Jul 12 2018 Jan Kratochvil - 8.1.90.20180708-32.fc29 - Remove as no longer needed: Workaround gcc-8.0: -Wno-error=cast-function-type,stringop-truncation From d790689b7089f54c57541e2a0f0263788d9f6445 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 13 Jul 2018 01:12:54 +0000 Subject: [PATCH 10/35] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- gdb.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb.spec b/gdb.spec index f928885..467383b 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: 33%{?dist} +Release: 34%{?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 @@ -1030,6 +1030,9 @@ fi %endif %changelog +* Fri Jul 13 2018 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Thu Jul 12 2018 Jan Kratochvil - 8.1.90.20180708-33.fc29 - [dts] [rhel6] Do not use mpfr as rhel6 has mpfr-2 while GDB requires mpfr-3. From 17183a1d49e2149ae86d49bf22fbeaa635d6f0c9 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Sat, 14 Jul 2018 16:04:17 -0400 Subject: [PATCH 11/35] Extend specfile to run testsuites for native-gdbserver and native-extended-gdbserver --- gdb.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb.spec b/gdb.spec index 467383b..77a99c2 100644 --- a/gdb.spec +++ b/gdb.spec @@ -733,7 +733,7 @@ gcc -o ./orphanripper %{SOURCE2} -Wall -lutil -ggdb2 then continue fi - CHECK="$CHECK check//unix/$BI" + CHECK="$CHECK check//unix/$BI check//native-gdbserver/$BI check//native-extended-gdbserver/$BI" done # Do not try -m64 inferiors for -m32 GDB as it cannot handle inferiors larger # than itself. @@ -742,7 +742,7 @@ gcc -o ./orphanripper %{SOURCE2} -Wall -lutil -ggdb2 RPM_SIZE="$(file ./biarch|sed -n 's/^.*: ELF \(32\|64\)-bit .*$/\1/p')" if [ "$RPM_SIZE" != "64" ] then - CHECK="$(echo " $CHECK "|sed 's# check//unix/-m64 # #')" + CHECK="$(echo " $CHECK "|sed 's#check//unix/-m64 check//native-gdbserver/-m64 check//native-extended-gdbserver/-m64# #')" fi # Disable some problematic testcases. @@ -765,7 +765,7 @@ for t in sum log do for file in testsuite*/gdb.$t do - suffix="${file#testsuite.unix.}" + suffix="${file#testsuite}" suffix="${suffix%/gdb.$t}" ln $file gdb-%{_target_platform}$suffix.$t || : done From 2cbda85f1ce90ca3d8c1db5743f544e4fc9ebdd6 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Sun, 15 Jul 2018 12:27:21 -0400 Subject: [PATCH 12/35] Rebase to FSF GDB 8.1.90.20180714 (8.2pre). Backport IPv6 patch (RH BZ 881849, Sergio Durigan Junior). --- _gdb.spec.Patch.include | 6 + _gdb.spec.patch.include | 2 + _git_upstream_commit | 2 +- _patch_order | 2 + gdb-container-rh-pkg.patch | 2 +- gdb-rhbz795424-bitpos-20of25.patch | 2 +- gdb-rhbz795424-bitpos-22of25.patch | 6 +- gdb-rhbz881849-ipv6-1of2.patch | 1964 ++++++++++++++++++++++++++++ gdb-rhbz881849-ipv6-2of2.patch | 63 + gdb.spec | 8 +- 10 files changed, 2049 insertions(+), 8 deletions(-) create mode 100644 gdb-rhbz881849-ipv6-1of2.patch create mode 100644 gdb-rhbz881849-ipv6-2of2.patch diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include index edce570..8ba0e48 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -504,3 +504,9 @@ Patch120: gdb-vla-intel-fix-print-char-array.patch # =fedoratest Patch121: gdb-rhbz1553104-s390x-arch12-test.patch +# Implement IPv6 support for GDB/gdbserver (RH BZ 881849, Sergio Durigan Junior). +Patch122: gdb-rhbz881849-ipv6-1of2.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 a663edb..27a39b7 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -119,3 +119,5 @@ %patch119 -p1 %patch120 -p1 %patch121 -p1 +%patch122 -p1 +%patch123 -p1 diff --git a/_git_upstream_commit b/_git_upstream_commit index d890f7b..6eddfd2 100644 --- a/_git_upstream_commit +++ b/_git_upstream_commit @@ -1 +1 @@ -0bad166b920254974ad2e35f087e14aa913afe44 +baa98cb7e6298cd74ad9638e5b02aa192f804659 diff --git a/_patch_order b/_patch_order index 1b3a5fe..11b4131 100644 --- a/_patch_order +++ b/_patch_order @@ -119,3 +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-1of2.patch +gdb-rhbz881849-ipv6-2of2.patch diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch index a58af23..2defc8d 100644 --- a/gdb-container-rh-pkg.patch +++ b/gdb-container-rh-pkg.patch @@ -9,7 +9,7 @@ Subject: gdb-container-rh-pkg.patch diff --git a/gdb/remote.c b/gdb/remote.c --- a/gdb/remote.c +++ b/gdb/remote.c -@@ -13901,7 +13901,17 @@ remote_target::pid_to_exec_file (int pid) +@@ -13909,7 +13909,17 @@ remote_target::pid_to_exec_file (int pid) char *annex = NULL; if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index e3d4713..6ebda52 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -2758,7 +2758,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, struct expression *) override; -@@ -10405,7 +10405,7 @@ int remote_hw_watchpoint_length_limit = -1; +@@ -10413,7 +10413,7 @@ int remote_hw_watchpoint_length_limit = -1; int remote_hw_breakpoint_limit = -1; int diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch index eb81a17..8072f77 100644 --- a/gdb-rhbz795424-bitpos-22of25.patch +++ b/gdb-rhbz795424-bitpos-22of25.patch @@ -384,7 +384,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c int can_use_hw_breakpoint (enum bptype, int, int) override; -@@ -10334,7 +10334,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, +@@ -10342,7 +10342,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); @@ -393,7 +393,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); -@@ -10354,7 +10354,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, +@@ -10362,7 +10362,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, bool remote_target::watchpoint_addr_within_range (CORE_ADDR addr, @@ -402,7 +402,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c { CORE_ADDR diff = remote_address_masked (addr - start); -@@ -10383,7 +10383,7 @@ remote_target::remove_watchpoint (CORE_ADDR addr, int len, +@@ -10391,7 +10391,7 @@ remote_target::remove_watchpoint (CORE_ADDR addr, int len, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); diff --git a/gdb-rhbz881849-ipv6-1of2.patch b/gdb-rhbz881849-ipv6-1of2.patch new file mode 100644 index 0000000..32745c9 --- /dev/null +++ b/gdb-rhbz881849-ipv6-1of2.patch @@ -0,0 +1,1964 @@ +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-1of2.patch + +;; Implement IPv6 support for GDB/gdbserver (RH BZ 881849, Sergio Durigan Junior). + +Implement IPv6 support for GDB/gdbserver + +This patch implements IPv6 support for both GDB and gdbserver. Based +on my research, it is the fourth attempt to do that since 2006. Since +I used ideas from all of the previous patches, I also added their +authors's names on the ChangeLogs as a way to recognize their +efforts. For reference sake, you can find the previous attempts at: + + https://sourceware.org/ml/gdb-patches/2006-09/msg00192.html + + https://sourceware.org/ml/gdb-patches/2014-02/msg00248.html + + https://sourceware.org/ml/gdb-patches/2016-02/msg00226.html + +The basic idea behind the patch is to start using the new +'getaddrinfo'/'getnameinfo' calls, which are responsible for +translating names and addresses in a protocol-independent way. This +means that if we ever have a new version of the IP protocol, we won't +need to change the code again (or, at least, won't have to change the +majority of the code). + +The function 'getaddrinfo' returns a linked list of possible addresses +to connect to. Dealing with multiple addresses proved to be a hard +task with the current TCP auto-retry mechanism implemented on +ser-tcp:net_open. For example, when gdbserver listened only on an +IPv4 socket: + + $ ./gdbserver --once 127.0.0.1:1234 ./a.out + +and GDB was instructed to try to connect to both IPv6 and IPv4 +sockets: + + $ ./gdb -ex 'target extended-remote localhost:1234' ./a.out + +the user would notice a somewhat big delay before GDB was able to +connect to the IPv4 socket. This happened because GDB was trying to +connect to the IPv6 socket first, and had to wait until the connection +timed out before it tried to connect to the IPv4 socket. + +For that reason, I had to rewrite the main loop and implement a new +method for handling multiple connections. After some discussion, +Pedro and I agreed on the following algorithm: + + 1) For each entry returned by 'getaddrinfo', we try to open a socket + and connect to it. + + 2.a) If we have a successful 'connect', we just use that connection. + + 2.b) If we don't have a successfull 'connect', but if we've got a + ECONNREFUSED (meaning the the connection was refused), we keep track + of this fact by using a flag. + + 2.c) If we don't have a successfull 'connect', but if we've got a + EINPROGRESS (meaning that the connection is in progress), we perform + a 'select' call on the socket until we have a result (either a + successful connection, or an error on the socket). + + 3) If tcp_auto_retry is true, and we haven't gotten a successful + connection, and at least one of our attempts failed with + ECONNREFUSED, then we wait a little bit (i.e., call + 'wait_for_connect'), check to see if there was a + timeout/interruption (in which case we bail out), and then go back + to (1). + +After multiple tests, I was able to connect without delay on the +scenario described above, and was also able to connect in all other +types of scenarios. + +I also implemented some hostname parsing functions (along with their +corresponding unit tests) which are used to help GDB and gdbserver to +parse hostname strings provided by the user. These new functions are +living inside common/netstuff.[ch]. I've had to do that since IPv6 +introduces a new URL scheme, which defines that square brackets can be +used to enclose the host part and differentiate it from the +port (e.g., "[::1]:1234" means "host ::1, port 1234"). I spent some +time thinking about a reasonable way to interpret what the user wants, +and I came up with the following: + + - If the user has provided a prefix that doesn't specify the protocol + version (i.e., "tcp:" or "udp:"), or if the user has not provided + any prefix, don't make any assumptions (i.e., assume AF_UNSPEC when + dealing with 'getaddrinfo') *unless* the host starts with "[" (in + which case, assume it's an IPv6 host). + + - If the user has provided a prefix that does specify the protocol + version (i.e., "tcp4:", "tcp6:", "udp4:" or "udp6:"), then respect + that. + +This method doesn't follow strictly what RFC 2732 proposes (that +literal IPv6 addresses should be provided enclosed in "[" and "]") +because IPv6 addresses still can be provided without square brackets +in our case, but since we have prefixes to specify protocol versions I +think this is not an issue. + +Another thing worth mentioning is the new 'GDB_TEST_SOCKETHOST' +testcase parameter, which makes it possible to specify the +hostname (without the port) to be used when testing GDB and +gdbserver. For example, to run IPv6 tests: + + $ make check-gdb RUNTESTFLAGS='GDB_TEST_SOCKETHOST=tcp6:[::1]' + +Or, to run IPv4 tests: + + $ make check-gdb RUNTESTFLAGS='GDB_TEST_SOCKETHOST=tcp4:127.0.0.1' + +This required a few changes on the gdbserver-base.exp, and also a +minimal adjustment on gdb.server/run-without-local-binary.exp. + +Finally, I've implemented a new testcase, +gdb.server/server-connect.exp, which is supposed to run on the native +host and perform various "smoke tests" using different connection +methods. + +This patch has been regression-tested on BuildBot and locally, and +also built using a x86_64-w64-mingw32 GCC, and no problems were found. + +gdb/ChangeLog: +2018-07-11 Sergio Durigan Junior + Jan Kratochvil + Paul Fertser + Tsutomu Seki + Pedro Alves + + * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add + 'unittests/parse-connection-spec-selftests.c'. + (COMMON_SFILES): Add 'common/netstuff.c'. + (HFILES_NO_SRCDIR): Add 'common/netstuff.h'. + * NEWS (Changes since GDB 8.2): Mention IPv6 support. + * common/netstuff.c: New file. + * common/netstuff.h: New file. + * ser-tcp.c: Include 'netstuff.h' and 'wspiapi.h'. + (wait_for_connect): Update comment. New parameter + 'gdb::optional sock' instead of 'struct serial *scb'. + Use 'sock' directly instead of 'scb->fd'. + (try_connect): New function, with code from 'net_open'. + (net_open): Rewrite main loop to deal with multiple + sockets/addresses. Handle IPv6-style hostnames; implement + support for IPv6 connections. + * unittests/parse-connection-spec-selftests.c: New file. + +gdb/gdbserver/ChangeLog: +2018-07-11 Sergio Durigan Junior + Jan Kratochvil + Paul Fertser + Tsutomu Seki + + * Makefile.in (SFILES): Add '$(srcdir)/common/netstuff.c'. + (OBS): Add 'common/netstuff.o'. + (GDBREPLAY_OBS): Likewise. + * gdbreplay.c: Include 'wspiapi.h' and 'netstuff.h'. + (remote_open): Implement support for IPv6 + connections. + * remote-utils.c: Include 'netstuff.h', 'filestuff.h' + and 'wspiapi.h'. + (handle_accept_event): Accept connections from IPv6 sources. + (remote_prepare): Handle IPv6-style hostnames; implement + support for IPv6 connections. + (remote_open): Implement support for printing connections from + IPv6 sources. + +gdb/testsuite/ChangeLog: +2018-07-11 Sergio Durigan Junior + Jan Kratochvil + Paul Fertser + Tsutomu Seki + + * README (Testsuite Parameters): Mention new 'GDB_TEST_SOCKETHOST' + parameter. + * boards/native-extended-gdbserver.exp: Do not set 'sockethost' + by default. + * boards/native-gdbserver.exp: Likewise. + * gdb.server/run-without-local-binary.exp: Improve regexp used + for detecting when a remote debugging connection succeeds. + * gdb.server/server-connect.exp: New file. + * lib/gdbserver-support.exp (gdbserver_default_get_comm_port): + Do not prefix the port number with ":". + (gdbserver_start): New global GDB_TEST_SOCKETHOST. Implement + support for detecting and using it. Add '$debughost_gdbserver' + to the list of arguments used to start gdbserver. Handle case + when gdbserver cannot resolve a network name. + +gdb/doc/ChangeLog: +2018-07-11 Sergio Durigan Junior + Jan Kratochvil + Paul Fertser + Tsutomu Seki + + * gdb.texinfo (Remote Connection Commands): Add explanation + about new IPv6 support. Add new connection prefixes. + +diff --git a/gdb/ChangeLog b/gdb/ChangeLog +--- a/gdb/ChangeLog ++++ b/gdb/ChangeLog +@@ -1,3 +1,26 @@ ++2018-07-11 Sergio Durigan Junior ++ Jan Kratochvil ++ Paul Fertser ++ Tsutomu Seki ++ Pedro Alves ++ ++ * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add ++ 'unittests/parse-connection-spec-selftests.c'. ++ (COMMON_SFILES): Add 'common/netstuff.c'. ++ (HFILES_NO_SRCDIR): Add 'common/netstuff.h'. ++ * NEWS (Changes since GDB 8.2): Mention IPv6 support. ++ * common/netstuff.c: New file. ++ * common/netstuff.h: New file. ++ * ser-tcp.c: Include 'netstuff.h' and 'wspiapi.h'. ++ (wait_for_connect): Update comment. New parameter ++ 'gdb::optional sock' instead of 'struct serial *scb'. ++ Use 'sock' directly instead of 'scb->fd'. ++ (try_connect): New function, with code from 'net_open'. ++ (net_open): Rewrite main loop to deal with multiple ++ sockets/addresses. Handle IPv6-style hostnames; implement ++ support for IPv6 connections. ++ * unittests/parse-connection-spec-selftests.c: New file. ++ + 2018-07-11 Pedro Alves + + PR gdb/23377 +diff --git a/gdb/Makefile.in b/gdb/Makefile.in +--- a/gdb/Makefile.in ++++ b/gdb/Makefile.in +@@ -430,6 +430,7 @@ SUBDIR_UNITTESTS_SRCS = \ + unittests/offset-type-selftests.c \ + unittests/observable-selftests.c \ + unittests/optional-selftests.c \ ++ unittests/parse-connection-spec-selftests.c \ + unittests/ptid-selftests.c \ + unittests/rsp-low-selftests.c \ + unittests/scoped_fd-selftests.c \ +@@ -967,6 +968,7 @@ COMMON_SFILES = \ + common/job-control.c \ + common/gdb_tilde_expand.c \ + common/gdb_vecs.c \ ++ common/netstuff.c \ + common/new-op.c \ + common/pathstuff.c \ + common/print-utils.c \ +@@ -1448,6 +1450,7 @@ HFILES_NO_SRCDIR = \ + common/gdb_vecs.h \ + common/gdb_wait.h \ + common/common-inferior.h \ ++ common/netstuff.h \ + common/host-defs.h \ + common/pathstuff.h \ + common/print-utils.h \ +diff --git a/gdb/NEWS b/gdb/NEWS +--- a/gdb/NEWS ++++ b/gdb/NEWS +@@ -1,6 +1,12 @@ + What has changed in GDB? + (Organized release by release) + ++*** Changes since GDB 8.2 ++ ++* GDB and GDBserver now support IPv6 connections. IPv6 addresses ++ can be passed using the '[ADDRESS]:PORT' notation, or the regular ++ 'ADDRESS:PORT' method. ++ + *** Changes in GDB 8.2 + + * The 'set disassembler-options' command now supports specifying options +diff --git a/gdb/common/netstuff.c b/gdb/common/netstuff.c +new file mode 100644 +--- /dev/null ++++ b/gdb/common/netstuff.c +@@ -0,0 +1,155 @@ ++/* Operations on network stuff. ++ Copyright (C) 2018 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ 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 3 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 . */ ++ ++#include "common-defs.h" ++#include "netstuff.h" ++#include ++ ++#ifdef USE_WIN32API ++#include ++#include ++#else ++#include ++#include ++#include ++#include ++#include ++#endif ++ ++/* See common/netstuff.h. */ ++ ++scoped_free_addrinfo::~scoped_free_addrinfo () ++{ ++ freeaddrinfo (m_res); ++} ++ ++/* See common/netstuff.h. */ ++ ++parsed_connection_spec ++parse_connection_spec_without_prefix (std::string spec, struct addrinfo *hint) ++{ ++ parsed_connection_spec ret; ++ size_t last_colon_pos = 0; ++ /* We're dealing with IPv6 if: ++ ++ - ai_family is AF_INET6, or ++ - ai_family is not AF_INET, and ++ - spec[0] is '[', or ++ - the number of ':' on spec is greater than 1. */ ++ bool is_ipv6 = (hint->ai_family == AF_INET6 ++ || (hint->ai_family != AF_INET ++ && (spec[0] == '[' ++ || std::count (spec.begin (), ++ spec.end (), ':') > 1))); ++ ++ if (is_ipv6) ++ { ++ if (spec[0] == '[') ++ { ++ /* IPv6 addresses can be written as '[ADDR]:PORT', and we ++ support this notation. */ ++ size_t close_bracket_pos = spec.find_first_of (']'); ++ ++ if (close_bracket_pos == std::string::npos) ++ error (_("Missing close bracket in hostname '%s'"), ++ spec.c_str ()); ++ ++ hint->ai_family = AF_INET6; ++ ++ const char c = spec[close_bracket_pos + 1]; ++ ++ if (c == '\0') ++ last_colon_pos = std::string::npos; ++ else if (c != ':') ++ error (_("Invalid cruft after close bracket in '%s'"), ++ spec.c_str ()); ++ ++ /* Erase both '[' and ']'. */ ++ spec.erase (0, 1); ++ spec.erase (close_bracket_pos - 1, 1); ++ } ++ else if (spec.find_first_of (']') != std::string::npos) ++ error (_("Missing open bracket in hostname '%s'"), ++ spec.c_str ()); ++ } ++ ++ if (last_colon_pos == 0) ++ last_colon_pos = spec.find_last_of (':'); ++ ++ /* The length of the hostname part. */ ++ size_t host_len; ++ ++ if (last_colon_pos != std::string::npos) ++ { ++ /* The user has provided a port. */ ++ host_len = last_colon_pos; ++ ret.port_str = spec.substr (last_colon_pos + 1); ++ } ++ else ++ host_len = spec.size (); ++ ++ ret.host_str = spec.substr (0, host_len); ++ ++ /* Default hostname is localhost. */ ++ if (ret.host_str.empty ()) ++ ret.host_str = "localhost"; ++ ++ return ret; ++} ++ ++/* See common/netstuff.h. */ ++ ++parsed_connection_spec ++parse_connection_spec (const char *spec, struct addrinfo *hint) ++{ ++ /* Struct to hold the association between valid prefixes, their ++ family and socktype. */ ++ struct host_prefix ++ { ++ /* The prefix. */ ++ const char *prefix; ++ ++ /* The 'ai_family'. */ ++ int family; ++ ++ /* The 'ai_socktype'. */ ++ int socktype; ++ }; ++ static const struct host_prefix prefixes[] = ++ { ++ { "udp:", AF_UNSPEC, SOCK_DGRAM }, ++ { "tcp:", AF_UNSPEC, SOCK_STREAM }, ++ { "udp4:", AF_INET, SOCK_DGRAM }, ++ { "tcp4:", AF_INET, SOCK_STREAM }, ++ { "udp6:", AF_INET6, SOCK_DGRAM }, ++ { "tcp6:", AF_INET6, SOCK_STREAM }, ++ }; ++ ++ for (const host_prefix prefix : prefixes) ++ if (startswith (spec, prefix.prefix)) ++ { ++ spec += strlen (prefix.prefix); ++ hint->ai_family = prefix.family; ++ hint->ai_socktype = prefix.socktype; ++ hint->ai_protocol ++ = hint->ai_socktype == SOCK_DGRAM ? IPPROTO_UDP : IPPROTO_TCP; ++ break; ++ } ++ ++ return parse_connection_spec_without_prefix (spec, hint); ++} +diff --git a/gdb/common/netstuff.h b/gdb/common/netstuff.h +new file mode 100644 +--- /dev/null ++++ b/gdb/common/netstuff.h +@@ -0,0 +1,76 @@ ++/* Operations on network stuff. ++ Copyright (C) 2018 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ 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 3 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 . */ ++ ++#ifndef NETSTUFF_H ++#define NETSTUFF_H ++ ++#include ++ ++/* Like NI_MAXHOST/NI_MAXSERV, but enough for numeric forms. */ ++#define GDB_NI_MAX_ADDR 64 ++#define GDB_NI_MAX_PORT 16 ++ ++/* Helper class to guarantee that we always call 'freeaddrinfo'. */ ++ ++class scoped_free_addrinfo ++{ ++public: ++ /* Default constructor. */ ++ explicit scoped_free_addrinfo (struct addrinfo *ainfo) ++ : m_res (ainfo) ++ { ++ } ++ ++ /* Destructor responsible for free'ing M_RES by calling ++ 'freeaddrinfo'. */ ++ ~scoped_free_addrinfo (); ++ ++ DISABLE_COPY_AND_ASSIGN (scoped_free_addrinfo); ++ ++private: ++ /* The addrinfo resource. */ ++ struct addrinfo *m_res; ++}; ++ ++/* The struct we return after parsing the connection spec. */ ++ ++struct parsed_connection_spec ++{ ++ /* The hostname. */ ++ std::string host_str; ++ ++ /* The port, if any. */ ++ std::string port_str; ++}; ++ ++ ++/* Parse SPEC (which is a string in the form of "ADDR:PORT") and ++ return a 'parsed_connection_spec' structure with the proper fields ++ filled in. Also adjust HINT accordingly. */ ++extern parsed_connection_spec ++ parse_connection_spec_without_prefix (std::string spec, ++ struct addrinfo *hint); ++ ++/* Parse SPEC (which is a string in the form of ++ "[tcp[6]:|udp[6]:]ADDR:PORT") and return a 'parsed_connection_spec' ++ structure with the proper fields filled in. Also adjust HINT ++ accordingly. */ ++extern parsed_connection_spec parse_connection_spec (const char *spec, ++ struct addrinfo *hint); ++ ++#endif /* ! NETSTUFF_H */ +diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog +--- a/gdb/doc/ChangeLog ++++ b/gdb/doc/ChangeLog +@@ -1,3 +1,11 @@ ++2018-07-11 Sergio Durigan Junior ++ Jan Kratochvil ++ Paul Fertser ++ Tsutomu Seki ++ ++ * gdb.texinfo (Remote Connection Commands): Add explanation ++ about new IPv6 support. Add new connection prefixes. ++ + 2018-07-02 Maciej W. Rozycki + + PR tdep/8282 +diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo +--- a/gdb/doc/gdb.texinfo ++++ b/gdb/doc/gdb.texinfo +@@ -20548,16 +20548,27 @@ If you're using a serial line, you may want to give @value{GDBN} the + @code{target} command. + + @item target remote @code{@var{host}:@var{port}} ++@itemx target remote @code{@var{[host]}:@var{port}} + @itemx target remote @code{tcp:@var{host}:@var{port}} ++@itemx target remote @code{tcp:@var{[host]}:@var{port}} ++@itemx target remote @code{tcp4:@var{host}:@var{port}} ++@itemx target remote @code{tcp6:@var{host}:@var{port}} ++@itemx target remote @code{tcp6:@var{[host]}:@var{port}} + @itemx target extended-remote @code{@var{host}:@var{port}} ++@itemx target extended-remote @code{@var{[host]}:@var{port}} + @itemx target extended-remote @code{tcp:@var{host}:@var{port}} ++@itemx target extended-remote @code{tcp:@var{[host]}:@var{port}} ++@itemx target extended-remote @code{tcp4:@var{host}:@var{port}} ++@itemx target extended-remote @code{tcp6:@var{host}:@var{port}} ++@itemx target extended-remote @code{tcp6:@var{[host]}:@var{port}} + @cindex @acronym{TCP} port, @code{target remote} + Debug using a @acronym{TCP} connection to @var{port} on @var{host}. +-The @var{host} may be either a host name or a numeric @acronym{IP} +-address; @var{port} must be a decimal number. The @var{host} could be +-the target machine itself, if it is directly connected to the net, or +-it might be a terminal server which in turn has a serial line to the +-target. ++The @var{host} may be either a host name, a numeric @acronym{IPv4} ++address, or a numeric @acronym{IPv6} address (with or without the ++square brackets to separate the address from the port); @var{port} ++must be a decimal number. The @var{host} could be the target machine ++itself, if it is directly connected to the net, or it might be a ++terminal server which in turn has a serial line to the target. + + For example, to connect to port 2828 on a terminal server named + @code{manyfarms}: +@@ -20566,6 +20577,28 @@ For example, to connect to port 2828 on a terminal server named + target remote manyfarms:2828 + @end smallexample + ++To connect to port 2828 on a terminal server whose address is ++@code{2001:0db8:85a3:0000:0000:8a2e:0370:7334}, you can either use the ++square bracket syntax: ++ ++@smallexample ++target remote [2001:0db8:85a3:0000:0000:8a2e:0370:7334]:2828 ++@end smallexample ++ ++@noindent ++or explicitly specify the @acronym{IPv6} protocol: ++ ++@smallexample ++target remote tcp6:2001:0db8:85a3:0000:0000:8a2e:0370:7334:2828 ++@end smallexample ++ ++This last example may be confusing to the reader, because there is no ++visible separation between the hostname and the port number. ++Therefore, we recommend the user to provide @acronym{IPv6} addresses ++using square brackets for clarity. However, it is important to ++mention that for @value{GDBN} there is no ambiguity: the number after ++the last colon is considered to be the port number. ++ + If your remote target is actually running on the same machine as your + debugger session (e.g.@: a simulator for your target running on the + same host), you can omit the hostname. For example, to connect to +@@ -20579,7 +20612,15 @@ target remote :1234 + Note that the colon is still required here. + + @item target remote @code{udp:@var{host}:@var{port}} ++@itemx target remote @code{udp:@var{[host]}:@var{port}} ++@itemx target remote @code{udp4:@var{host}:@var{port}} ++@itemx target remote @code{udp6:@var{[host]}:@var{port}} ++@itemx target extended-remote @code{udp:@var{host}:@var{port}} + @itemx target extended-remote @code{udp:@var{host}:@var{port}} ++@itemx target extended-remote @code{udp:@var{[host]}:@var{port}} ++@itemx target extended-remote @code{udp4:@var{host}:@var{port}} ++@itemx target extended-remote @code{udp6:@var{host}:@var{port}} ++@itemx target extended-remote @code{udp6:@var{[host]}:@var{port}} + @cindex @acronym{UDP} port, @code{target remote} + Debug using @acronym{UDP} packets to @var{port} on @var{host}. For example, to + connect to @acronym{UDP} port 2828 on a terminal server named @code{manyfarms}: +diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog +--- a/gdb/gdbserver/ChangeLog ++++ b/gdb/gdbserver/ChangeLog +@@ -1,3 +1,22 @@ ++2018-07-11 Sergio Durigan Junior ++ Jan Kratochvil ++ Paul Fertser ++ Tsutomu Seki ++ ++ * Makefile.in (SFILES): Add '$(srcdir)/common/netstuff.c'. ++ (OBS): Add 'common/netstuff.o'. ++ (GDBREPLAY_OBS): Likewise. ++ * gdbreplay.c: Include 'wspiapi.h' and 'netstuff.h'. ++ (remote_open): Implement support for IPv6 ++ connections. ++ * remote-utils.c: Include 'netstuff.h', 'filestuff.h' ++ and 'wspiapi.h'. ++ (handle_accept_event): Accept connections from IPv6 sources. ++ (remote_prepare): Handle IPv6-style hostnames; implement ++ support for IPv6 connections. ++ (remote_open): Implement support for printing connections from ++ IPv6 sources. ++ + 2018-07-11 Pedro Alves + + PR gdb/23377 +diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in +--- a/gdb/gdbserver/Makefile.in ++++ b/gdb/gdbserver/Makefile.in +@@ -211,6 +211,7 @@ SFILES = \ + $(srcdir)/common/job-control.c \ + $(srcdir)/common/gdb_tilde_expand.c \ + $(srcdir)/common/gdb_vecs.c \ ++ $(srcdir)/common/netstuff.c \ + $(srcdir)/common/new-op.c \ + $(srcdir)/common/pathstuff.c \ + $(srcdir)/common/print-utils.c \ +@@ -254,6 +255,7 @@ OBS = \ + common/format.o \ + common/gdb_tilde_expand.o \ + common/gdb_vecs.o \ ++ common/netstuff.o \ + common/new-op.o \ + common/pathstuff.o \ + common/print-utils.o \ +@@ -290,6 +292,7 @@ GDBREPLAY_OBS = \ + common/common-exceptions.o \ + common/common-utils.o \ + common/errors.o \ ++ common/netstuff.o \ + common/print-utils.o \ + gdbreplay.o \ + utils.o \ +diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c +--- a/gdb/gdbserver/gdbreplay.c ++++ b/gdb/gdbserver/gdbreplay.c +@@ -46,8 +46,11 @@ + + #if USE_WIN32API + #include ++#include + #endif + ++#include "netstuff.h" ++ + #ifndef HAVE_SOCKLEN_T + typedef int socklen_t; + #endif +@@ -142,56 +145,108 @@ remote_close (void) + static void + remote_open (char *name) + { +- if (!strchr (name, ':')) ++ char *last_colon = strrchr (name, ':'); ++ ++ if (last_colon == NULL) + { + fprintf (stderr, "%s: Must specify tcp connection as host:addr\n", name); + fflush (stderr); + exit (1); + } +- else +- { ++ + #ifdef USE_WIN32API +- static int winsock_initialized; ++ static int winsock_initialized; + #endif +- char *port_str; +- int port; +- struct sockaddr_in sockaddr; +- socklen_t tmp; +- int tmp_desc; ++ char *port_str; ++ int tmp; ++ int tmp_desc; ++ struct addrinfo hint; ++ struct addrinfo *ainfo; + +- port_str = strchr (name, ':'); ++ memset (&hint, 0, sizeof (hint)); ++ /* Assume no prefix will be passed, therefore we should use ++ AF_UNSPEC. */ ++ hint.ai_family = AF_UNSPEC; ++ hint.ai_socktype = SOCK_STREAM; ++ hint.ai_protocol = IPPROTO_TCP; + +- port = atoi (port_str + 1); ++ parsed_connection_spec parsed = parse_connection_spec (name, &hint); ++ ++ if (parsed.port_str.empty ()) ++ error (_("Missing port on hostname '%s'"), name); + + #ifdef USE_WIN32API +- if (!winsock_initialized) +- { +- WSADATA wsad; ++ if (!winsock_initialized) ++ { ++ WSADATA wsad; + +- WSAStartup (MAKEWORD (1, 0), &wsad); +- winsock_initialized = 1; +- } ++ WSAStartup (MAKEWORD (1, 0), &wsad); ++ winsock_initialized = 1; ++ } + #endif + +- tmp_desc = socket (PF_INET, SOCK_STREAM, 0); +- if (tmp_desc == -1) +- perror_with_name ("Can't open socket"); ++ int r = getaddrinfo (parsed.host_str.c_str (), parsed.port_str.c_str (), ++ &hint, &ainfo); + +- /* Allow rapid reuse of this port. */ +- tmp = 1; +- setsockopt (tmp_desc, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp, +- sizeof (tmp)); ++ if (r != 0) ++ { ++ fprintf (stderr, "%s:%s: cannot resolve name: %s\n", ++ parsed.host_str.c_str (), parsed.port_str.c_str (), ++ gai_strerror (r)); ++ fflush (stderr); ++ exit (1); ++ } ++ ++ scoped_free_addrinfo free_ainfo (ainfo); ++ ++ struct addrinfo *p; ++ ++ for (p = ainfo; p != NULL; p = p->ai_next) ++ { ++ tmp_desc = socket (p->ai_family, p->ai_socktype, p->ai_protocol); + +- sockaddr.sin_family = PF_INET; +- sockaddr.sin_port = htons (port); +- sockaddr.sin_addr.s_addr = INADDR_ANY; ++ if (tmp_desc >= 0) ++ break; ++ } ++ ++ if (p == NULL) ++ perror_with_name ("Cannot open socket"); + +- if (bind (tmp_desc, (struct sockaddr *) &sockaddr, sizeof (sockaddr)) +- || listen (tmp_desc, 1)) +- perror_with_name ("Can't bind address"); ++ /* Allow rapid reuse of this port. */ ++ tmp = 1; ++ setsockopt (tmp_desc, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp, ++ sizeof (tmp)); ++ ++ switch (p->ai_family) ++ { ++ case AF_INET: ++ ((struct sockaddr_in *) p->ai_addr)->sin_addr.s_addr = INADDR_ANY; ++ break; ++ case AF_INET6: ++ ((struct sockaddr_in6 *) p->ai_addr)->sin6_addr = in6addr_any; ++ break; ++ default: ++ fprintf (stderr, "Invalid 'ai_family' %d\n", p->ai_family); ++ exit (1); ++ } ++ ++ if (bind (tmp_desc, p->ai_addr, p->ai_addrlen) != 0) ++ perror_with_name ("Can't bind address"); ++ ++ if (p->ai_socktype == SOCK_DGRAM) ++ remote_desc = tmp_desc; ++ else ++ { ++ struct sockaddr_storage sockaddr; ++ socklen_t sockaddrsize = sizeof (sockaddr); ++ char orig_host[GDB_NI_MAX_ADDR], orig_port[GDB_NI_MAX_PORT]; ++ ++ if (listen (tmp_desc, 1) != 0) ++ perror_with_name ("Can't listen on socket"); ++ ++ remote_desc = accept (tmp_desc, (struct sockaddr *) &sockaddr, ++ &sockaddrsize); + +- tmp = sizeof (sockaddr); +- remote_desc = accept (tmp_desc, (struct sockaddr *) &sockaddr, &tmp); + if (remote_desc == -1) + perror_with_name ("Accept failed"); + +@@ -206,6 +261,16 @@ remote_open (char *name) + setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY, + (char *) &tmp, sizeof (tmp)); + ++ if (getnameinfo ((struct sockaddr *) &sockaddr, sockaddrsize, ++ orig_host, sizeof (orig_host), ++ orig_port, sizeof (orig_port), ++ NI_NUMERICHOST | NI_NUMERICSERV) == 0) ++ { ++ fprintf (stderr, "Remote debugging from host %s, port %s\n", ++ orig_host, orig_port); ++ fflush (stderr); ++ } ++ + #ifndef USE_WIN32API + close (tmp_desc); /* No longer need this */ + +diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c +--- a/gdb/gdbserver/remote-utils.c ++++ b/gdb/gdbserver/remote-utils.c +@@ -26,6 +26,8 @@ + #include "dll.h" + #include "rsp-low.h" + #include "gdbthread.h" ++#include "netstuff.h" ++#include "filestuff.h" + #include + #if HAVE_SYS_IOCTL_H + #include +@@ -63,6 +65,7 @@ + + #if USE_WIN32API + #include ++#include + #endif + + #if __QNX__ +@@ -151,19 +154,18 @@ enable_async_notification (int fd) + static int + handle_accept_event (int err, gdb_client_data client_data) + { +- struct sockaddr_in sockaddr; +- socklen_t tmp; ++ struct sockaddr_storage sockaddr; ++ socklen_t len = sizeof (sockaddr); + + if (debug_threads) + debug_printf ("handling possible accept event\n"); + +- tmp = sizeof (sockaddr); +- remote_desc = accept (listen_desc, (struct sockaddr *) &sockaddr, &tmp); ++ remote_desc = accept (listen_desc, (struct sockaddr *) &sockaddr, &len); + if (remote_desc == -1) + perror_with_name ("Accept failed"); + + /* Enable TCP keep alive process. */ +- tmp = 1; ++ socklen_t tmp = 1; + setsockopt (remote_desc, SOL_SOCKET, SO_KEEPALIVE, + (char *) &tmp, sizeof (tmp)); + +@@ -192,8 +194,19 @@ handle_accept_event (int err, gdb_client_data client_data) + delete_file_handler (listen_desc); + + /* Convert IP address to string. */ +- fprintf (stderr, "Remote debugging from host %s\n", +- inet_ntoa (sockaddr.sin_addr)); ++ char orig_host[GDB_NI_MAX_ADDR], orig_port[GDB_NI_MAX_PORT]; ++ ++ int r = getnameinfo ((struct sockaddr *) &sockaddr, len, ++ orig_host, sizeof (orig_host), ++ orig_port, sizeof (orig_port), ++ NI_NUMERICHOST | NI_NUMERICSERV); ++ ++ if (r != 0) ++ fprintf (stderr, _("Could not obtain remote address: %s\n"), ++ gai_strerror (r)); ++ else ++ fprintf (stderr, _("Remote debugging from host %s, port %s\n"), ++ orig_host, orig_port); + + enable_async_notification (remote_desc); + +@@ -222,10 +235,7 @@ remote_prepare (const char *name) + #ifdef USE_WIN32API + static int winsock_initialized; + #endif +- int port; +- struct sockaddr_in sockaddr; + socklen_t tmp; +- char *port_end; + + remote_is_stdio = 0; + if (strcmp (name, STDIO_CONNECTION_NAME) == 0) +@@ -238,17 +248,25 @@ remote_prepare (const char *name) + return; + } + +- port_str = strchr (name, ':'); +- if (port_str == NULL) ++ struct addrinfo hint; ++ struct addrinfo *ainfo; ++ ++ memset (&hint, 0, sizeof (hint)); ++ /* Assume no prefix will be passed, therefore we should use ++ AF_UNSPEC. */ ++ hint.ai_family = AF_UNSPEC; ++ hint.ai_socktype = SOCK_STREAM; ++ hint.ai_protocol = IPPROTO_TCP; ++ ++ parsed_connection_spec parsed ++ = parse_connection_spec_without_prefix (name, &hint); ++ ++ if (parsed.port_str.empty ()) + { + cs.transport_is_reliable = 0; + return; + } + +- port = strtoul (port_str + 1, &port_end, 10); +- if (port_str[1] == '\0' || *port_end != '\0') +- error ("Bad port argument: %s", name); +- + #ifdef USE_WIN32API + if (!winsock_initialized) + { +@@ -259,8 +277,26 @@ remote_prepare (const char *name) + } + #endif + +- listen_desc = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); +- if (listen_desc == -1) ++ int r = getaddrinfo (parsed.host_str.c_str (), parsed.port_str.c_str (), ++ &hint, &ainfo); ++ ++ if (r != 0) ++ error (_("%s: cannot resolve name: %s"), name, gai_strerror (r)); ++ ++ scoped_free_addrinfo freeaddrinfo (ainfo); ++ ++ struct addrinfo *iter; ++ ++ for (iter = ainfo; iter != NULL; iter = iter->ai_next) ++ { ++ listen_desc = gdb_socket_cloexec (iter->ai_family, iter->ai_socktype, ++ iter->ai_protocol); ++ ++ if (listen_desc >= 0) ++ break; ++ } ++ ++ if (iter == NULL) + perror_with_name ("Can't open socket"); + + /* Allow rapid reuse of this port. */ +@@ -268,14 +304,25 @@ remote_prepare (const char *name) + setsockopt (listen_desc, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp, + sizeof (tmp)); + +- sockaddr.sin_family = PF_INET; +- sockaddr.sin_port = htons (port); +- sockaddr.sin_addr.s_addr = INADDR_ANY; ++ switch (iter->ai_family) ++ { ++ case AF_INET: ++ ((struct sockaddr_in *) iter->ai_addr)->sin_addr.s_addr = INADDR_ANY; ++ break; ++ case AF_INET6: ++ ((struct sockaddr_in6 *) iter->ai_addr)->sin6_addr = in6addr_any; ++ break; ++ default: ++ internal_error (__FILE__, __LINE__, ++ _("Invalid 'ai_family' %d\n"), iter->ai_family); ++ } + +- if (bind (listen_desc, (struct sockaddr *) &sockaddr, sizeof (sockaddr)) +- || listen (listen_desc, 1)) ++ if (bind (listen_desc, iter->ai_addr, iter->ai_addrlen) != 0) + perror_with_name ("Can't bind address"); + ++ if (listen (listen_desc, 1) != 0) ++ perror_with_name ("Can't listen on socket"); ++ + cs.transport_is_reliable = 1; + } + +@@ -350,18 +397,24 @@ remote_open (const char *name) + #endif /* USE_WIN32API */ + else + { +- int port; +- socklen_t len; +- struct sockaddr_in sockaddr; +- +- len = sizeof (sockaddr); +- if (getsockname (listen_desc, +- (struct sockaddr *) &sockaddr, &len) < 0 +- || len < sizeof (sockaddr)) ++ char listen_port[GDB_NI_MAX_PORT]; ++ struct sockaddr_storage sockaddr; ++ socklen_t len = sizeof (sockaddr); ++ ++ if (getsockname (listen_desc, (struct sockaddr *) &sockaddr, &len) < 0) + perror_with_name ("Can't determine port"); +- port = ntohs (sockaddr.sin_port); + +- fprintf (stderr, "Listening on port %d\n", port); ++ int r = getnameinfo ((struct sockaddr *) &sockaddr, len, ++ NULL, 0, ++ listen_port, sizeof (listen_port), ++ NI_NUMERICSERV); ++ ++ if (r != 0) ++ fprintf (stderr, _("Can't obtain port where we are listening: %s"), ++ gai_strerror (r)); ++ else ++ fprintf (stderr, _("Listening on port %s\n"), listen_port); ++ + fflush (stderr); + + /* Register the event loop handler. */ +diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c +--- a/gdb/ser-tcp.c ++++ b/gdb/ser-tcp.c +@@ -25,6 +25,7 @@ + #include "cli/cli-decode.h" + #include "cli/cli-setshow.h" + #include "filestuff.h" ++#include "netstuff.h" + + #include + +@@ -39,6 +40,7 @@ + + #ifdef USE_WIN32API + #include ++#include + #ifndef ETIMEDOUT + #define ETIMEDOUT WSAETIMEDOUT + #endif +@@ -81,12 +83,13 @@ static unsigned int tcp_retry_limit = 15; + + #define POLL_INTERVAL 5 + +-/* Helper function to wait a while. If SCB is non-null, wait on its +- file descriptor. Otherwise just wait on a timeout, updating *POLLS. +- Returns -1 on timeout or interrupt, otherwise the value of select. */ ++/* Helper function to wait a while. If SOCK is not -1, wait on its ++ file descriptor. Otherwise just wait on a timeout, updating ++ *POLLS. Returns -1 on timeout or interrupt, otherwise the value of ++ select. */ + + static int +-wait_for_connect (struct serial *scb, unsigned int *polls) ++wait_for_connect (int sock, unsigned int *polls) + { + struct timeval t; + int n; +@@ -120,24 +123,24 @@ wait_for_connect (struct serial *scb, unsigned int *polls) + t.tv_usec = 0; + } + +- if (scb) ++ if (sock >= 0) + { + fd_set rset, wset, eset; + + FD_ZERO (&rset); +- FD_SET (scb->fd, &rset); ++ FD_SET (sock, &rset); + wset = rset; + eset = rset; +- ++ + /* POSIX systems return connection success or failure by signalling + wset. Windows systems return success in wset and failure in + eset. +- ++ + We must call select here, rather than gdb_select, because + the serial structure has not yet been initialized - the + MinGW select wrapper will not know that this FD refers + to a socket. */ +- n = select (scb->fd + 1, &rset, &wset, &eset, &t); ++ n = select (sock + 1, &rset, &wset, &eset, &t); + } + else + /* Use gdb_select here, since we have no file descriptors, and on +@@ -153,80 +156,28 @@ wait_for_connect (struct serial *scb, unsigned int *polls) + return n; + } + +-/* Open a tcp socket. */ ++/* Try to connect to the host represented by AINFO. If the connection ++ succeeds, return its socket. Otherwise, return -1 and set ERRNO ++ accordingly. POLLS is used when 'connect' returns EINPROGRESS, and ++ we need to invoke 'wait_for_connect' to obtain the status. */ + +-int +-net_open (struct serial *scb, const char *name) ++static int ++try_connect (const struct addrinfo *ainfo, unsigned int *polls) + { +- char hostname[100]; +- const char *port_str; +- int n, port, tmp; +- int use_udp; +- struct hostent *hostent; +- struct sockaddr_in sockaddr; +-#ifdef USE_WIN32API +- u_long ioarg; +-#else +- int ioarg; +-#endif +- unsigned int polls = 0; +- +- use_udp = 0; +- if (startswith (name, "udp:")) +- { +- use_udp = 1; +- name = name + 4; +- } +- else if (startswith (name, "tcp:")) +- name = name + 4; +- +- port_str = strchr (name, ':'); +- +- if (!port_str) +- error (_("net_open: No colon in host name!")); /* Shouldn't ever +- happen. */ +- +- tmp = std::min (port_str - name, (ptrdiff_t) sizeof hostname - 1); +- strncpy (hostname, name, tmp); /* Don't want colon. */ +- hostname[tmp] = '\000'; /* Tie off host name. */ +- port = atoi (port_str + 1); +- +- /* Default hostname is localhost. */ +- if (!hostname[0]) +- strcpy (hostname, "localhost"); +- +- hostent = gethostbyname (hostname); +- if (!hostent) +- { +- fprintf_unfiltered (gdb_stderr, "%s: unknown host\n", hostname); +- errno = ENOENT; +- return -1; +- } ++ int sock = gdb_socket_cloexec (ainfo->ai_family, ainfo->ai_socktype, ++ ainfo->ai_protocol); + +- sockaddr.sin_family = PF_INET; +- sockaddr.sin_port = htons (port); +- memcpy (&sockaddr.sin_addr.s_addr, hostent->h_addr, +- sizeof (struct in_addr)); +- +- retry: +- +- if (use_udp) +- scb->fd = gdb_socket_cloexec (PF_INET, SOCK_DGRAM, 0); +- else +- scb->fd = gdb_socket_cloexec (PF_INET, SOCK_STREAM, 0); +- +- if (scb->fd == -1) ++ if (sock < 0) + return -1; +- ++ + /* Set socket nonblocking. */ +- ioarg = 1; +- ioctl (scb->fd, FIONBIO, &ioarg); ++ int ioarg = 1; ++ ++ ioctl (sock, FIONBIO, &ioarg); + + /* Use Non-blocking connect. connect() will return 0 if connected + already. */ +- n = connect (scb->fd, (struct sockaddr *) &sockaddr, sizeof (sockaddr)); +- +- if (n < 0) ++ if (connect (sock, ainfo->ai_addr, ainfo->ai_addrlen) < 0) + { + #ifdef USE_WIN32API + int err = WSAGetLastError(); +@@ -234,21 +185,26 @@ net_open (struct serial *scb, const char *name) + int err = errno; + #endif + +- /* Maybe we're waiting for the remote target to become ready to +- accept connections. */ +- if (tcp_auto_retry ++ /* If we've got a "connection refused" error, just return ++ -1. The caller will know what to do. */ ++ if ( + #ifdef USE_WIN32API +- && err == WSAECONNREFUSED ++ err == WSAECONNREFUSED + #else +- && err == ECONNREFUSED ++ err == ECONNREFUSED + #endif +- && wait_for_connect (NULL, &polls) >= 0) ++ ) + { +- close (scb->fd); +- goto retry; ++ close (sock); ++ errno = err; ++ return -1; + } + + if ( ++ /* Any other error (except EINPROGRESS) will be "swallowed" ++ here. We return without specifying a return value, and ++ set errno if the caller wants to inspect what ++ happened. */ + #ifdef USE_WIN32API + /* Under Windows, calling "connect" with a non-blocking socket + results in WSAEWOULDBLOCK, not WSAEINPROGRESS. */ +@@ -258,66 +214,166 @@ net_open (struct serial *scb, const char *name) + #endif + ) + { ++ close (sock); + errno = err; +- net_close (scb); + return -1; + } + + /* Looks like we need to wait for the connect. */ +- do +- { +- n = wait_for_connect (scb, &polls); +- } ++ int n; ++ ++ do ++ n = wait_for_connect (sock, polls); + while (n == 0); ++ + if (n < 0) + { +- net_close (scb); ++ int saved_errno = errno; ++ ++ /* A negative value here means that we either timed out or ++ got interrupted by the user. Just return. */ ++ close (sock); ++ errno = saved_errno; + return -1; + } + } + + /* Got something. Is it an error? */ +- { +- int res, err; +- socklen_t len; +- +- len = sizeof (err); +- /* On Windows, the fourth parameter to getsockopt is a "char *"; +- on UNIX systems it is generally "void *". The cast to "char *" +- is OK everywhere, since in C++ any data pointer type can be +- implicitly converted to "void *". */ +- res = getsockopt (scb->fd, SOL_SOCKET, SO_ERROR, (char *) &err, &len); +- if (res < 0 || err) +- { +- /* Maybe the target still isn't ready to accept the connection. */ +- if (tcp_auto_retry ++ int err; ++ socklen_t len = sizeof (err); ++ ++ /* On Windows, the fourth parameter to getsockopt is a "char *"; ++ on UNIX systems it is generally "void *". The cast to "char *" ++ is OK everywhere, since in C++ any data pointer type can be ++ implicitly converted to "void *". */ ++ int ret = getsockopt (sock, SOL_SOCKET, SO_ERROR, (char *) &err, &len); ++ ++ if (ret < 0) ++ { ++ int saved_errno = errno; ++ ++ close (sock); ++ errno = saved_errno; ++ return -1; ++ } ++ else if (ret == 0 && err != 0) ++ { ++ close (sock); ++ errno = err; ++ return -1; ++ } ++ ++ /* The connection succeeded. Return the socket. */ ++ return sock; ++} ++ ++/* Open a tcp socket. */ ++ ++int ++net_open (struct serial *scb, const char *name) ++{ ++ struct addrinfo hint; ++ struct addrinfo *ainfo; ++ ++ memset (&hint, 0, sizeof (hint)); ++ /* Assume no prefix will be passed, therefore we should use ++ AF_UNSPEC. */ ++ hint.ai_family = AF_UNSPEC; ++ hint.ai_socktype = SOCK_STREAM; ++ hint.ai_protocol = IPPROTO_TCP; ++ ++ parsed_connection_spec parsed = parse_connection_spec (name, &hint); ++ ++ if (parsed.port_str.empty ()) ++ error (_("Missing port on hostname '%s'"), name); ++ ++ int r = getaddrinfo (parsed.host_str.c_str (), ++ parsed.port_str.c_str (), ++ &hint, &ainfo); ++ ++ if (r != 0) ++ { ++ fprintf_unfiltered (gdb_stderr, _("%s: cannot resolve name: %s\n"), ++ name, gai_strerror (r)); ++ errno = ENOENT; ++ return -1; ++ } ++ ++ scoped_free_addrinfo free_ainfo (ainfo); ++ ++ /* Flag to indicate whether we've got a connection refused. It will ++ be true if any of the connections tried was refused. */ ++ bool got_connrefused; ++ /* If a connection succeeeds, SUCCESS_AINFO will point to the ++ 'struct addrinfo' that succeed. */ ++ struct addrinfo *success_ainfo = NULL; ++ unsigned int polls = 0; ++ ++ /* Assume the worst. */ ++ scb->fd = -1; ++ ++ do ++ { ++ got_connrefused = false; ++ ++ for (struct addrinfo *iter = ainfo; iter != NULL; iter = iter->ai_next) ++ { ++ /* Iterate over the list of possible addresses to connect ++ to. For each, we'll try to connect and see if it ++ succeeds. */ ++ int sock = try_connect (iter, &polls); ++ ++ if (sock >= 0) ++ { ++ /* We've gotten a successful connection. Save its ++ 'struct addrinfo', the socket, and break. */ ++ success_ainfo = iter; ++ scb->fd = sock; ++ break; ++ } ++ else if ( + #ifdef USE_WIN32API +- && err == WSAECONNREFUSED ++ errno == WSAECONNREFUSED + #else +- && err == ECONNREFUSED ++ errno == ECONNREFUSED + #endif +- && wait_for_connect (NULL, &polls) >= 0) +- { +- close (scb->fd); +- goto retry; +- } +- if (err) +- errno = err; +- net_close (scb); +- return -1; +- } +- } ++ ) ++ got_connrefused = true; ++ } ++ } ++ /* Just retry if: ++ ++ - tcp_auto_retry is true, and ++ - We haven't gotten a connection yet, and ++ - Any of our connection attempts returned with ECONNREFUSED, and ++ - wait_for_connect signals that we can keep going. */ ++ while (tcp_auto_retry ++ && success_ainfo == NULL ++ && got_connrefused ++ && wait_for_connect (-1, &polls) >= 0); ++ ++ if (success_ainfo == NULL) ++ { ++ net_close (scb); ++ return -1; ++ } + + /* Turn off nonblocking. */ +- ioarg = 0; ++#ifdef USE_WIN32API ++ u_long ioarg = 0; ++#else ++ int ioarg = 0; ++#endif ++ + ioctl (scb->fd, FIONBIO, &ioarg); + +- if (use_udp == 0) ++ if (success_ainfo->ai_socktype == IPPROTO_TCP) + { + /* Disable Nagle algorithm. Needed in some cases. */ +- tmp = 1; ++ int tmp = 1; ++ + setsockopt (scb->fd, IPPROTO_TCP, TCP_NODELAY, +- (char *)&tmp, sizeof (tmp)); ++ (char *) &tmp, sizeof (tmp)); + } + + #ifdef SIGPIPE +diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog +--- a/gdb/testsuite/ChangeLog ++++ b/gdb/testsuite/ChangeLog +@@ -1,3 +1,23 @@ ++2018-07-11 Sergio Durigan Junior ++ Jan Kratochvil ++ Paul Fertser ++ Tsutomu Seki ++ ++ * README (Testsuite Parameters): Mention new 'GDB_TEST_SOCKETHOST' ++ parameter. ++ * boards/native-extended-gdbserver.exp: Do not set 'sockethost' ++ by default. ++ * boards/native-gdbserver.exp: Likewise. ++ * gdb.server/run-without-local-binary.exp: Improve regexp used ++ for detecting when a remote debugging connection succeeds. ++ * gdb.server/server-connect.exp: New file. ++ * lib/gdbserver-support.exp (gdbserver_default_get_comm_port): ++ Do not prefix the port number with ":". ++ (gdbserver_start): New global GDB_TEST_SOCKETHOST. Implement ++ support for detecting and using it. Add '$debughost_gdbserver' ++ to the list of arguments used to start gdbserver. Handle case ++ when gdbserver cannot resolve a network name. ++ + 2018-07-11 Sergio Durigan Junior + + PR c++/23373 +diff --git a/gdb/testsuite/README b/gdb/testsuite/README +--- a/gdb/testsuite/README ++++ b/gdb/testsuite/README +@@ -259,6 +259,20 @@ This make (not runtest) variable is used to specify whether the + testsuite preloads the read1.so library into expect. Any non-empty + value means true. See "Race detection" below. + ++GDB_TEST_SOCKETHOST ++ ++This variable can provide the hostname/address that should be used ++when performing GDBserver-related tests. This is useful in some ++situations, e.g., when you want to test the IPv6 connectivity of GDB ++and GDBserver, or when using a different hostname/address is needed. ++For example, to make GDB and GDBserver use IPv6-only connections, you ++can do: ++ ++ make check TESTS="gdb.server/*.exp" RUNTESTFLAGS='GDB_TEST_SOCKETHOST=tcp6:[::1]' ++ ++Note that only a hostname/address can be provided, without a port ++number. ++ + Race detection + ************** + +diff --git a/gdb/testsuite/boards/native-extended-gdbserver.exp b/gdb/testsuite/boards/native-extended-gdbserver.exp +--- a/gdb/testsuite/boards/native-extended-gdbserver.exp ++++ b/gdb/testsuite/boards/native-extended-gdbserver.exp +@@ -24,8 +24,6 @@ load_generic_config "extended-gdbserver" + load_board_description "gdbserver-base" + load_board_description "local-board" + +-set_board_info sockethost "localhost:" +- + # We will be using the extended GDB remote protocol. + set_board_info gdb_protocol "extended-remote" + +diff --git a/gdb/testsuite/boards/native-gdbserver.exp b/gdb/testsuite/boards/native-gdbserver.exp +--- a/gdb/testsuite/boards/native-gdbserver.exp ++++ b/gdb/testsuite/boards/native-gdbserver.exp +@@ -30,7 +30,6 @@ set_board_info gdb,do_reload_on_run 1 + # There's no support for argument-passing (yet). + set_board_info noargs 1 + +-set_board_info sockethost "localhost:" + set_board_info use_gdb_stub 1 + set_board_info exit_is_reliable 1 + +diff --git a/gdb/testsuite/gdb.server/run-without-local-binary.exp b/gdb/testsuite/gdb.server/run-without-local-binary.exp +--- a/gdb/testsuite/gdb.server/run-without-local-binary.exp ++++ b/gdb/testsuite/gdb.server/run-without-local-binary.exp +@@ -53,7 +53,7 @@ save_vars { GDBFLAGS } { + set use_gdb_stub 0 + + gdb_test "target ${gdbserver_protocol} ${gdbserver_gdbport}" \ +- "Remote debugging using $gdbserver_gdbport" \ ++ "Remote debugging using [string_to_regexp $gdbserver_gdbport]" \ + "connect to gdbserver" + + gdb_test "run" \ +diff --git a/gdb/testsuite/gdb.server/server-connect.exp b/gdb/testsuite/gdb.server/server-connect.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.server/server-connect.exp +@@ -0,0 +1,111 @@ ++# This testcase is part of GDB, the GNU debugger. ++# ++# Copyright 2018 Free Software Foundation, Inc. ++# ++# 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 3 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 . ++ ++# Test multiple types of connection (IPv4, IPv6, TCP, UDP) and make ++# sure both gdbserver and GDB work. ++ ++load_lib gdbserver-support.exp ++ ++standard_testfile normal.c ++ ++if {[skip_gdbserver_tests]} { ++ return 0 ++} ++ ++# We want to have control over where we start gdbserver. ++if { [is_remote target] } { ++ return 0 ++} ++ ++if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } { ++ return -1 ++} ++ ++# Make sure we're disconnected, in case we're testing with an ++# extended-remote board, therefore already connected. ++gdb_test "disconnect" ".*" ++ ++set target_exec [gdbserver_download_current_prog] ++ ++# An array containing the test instructions for each scenario. The ++# description of each field is as follows: ++# ++# - The connection specification to be used when starting ++# gdbserver/GDB. This string will be used to set the ++# GDB_TEST_SOCKETHOST when calling gdbserver_start. ++# ++# - A flag indicating whether gdbserver should fail when we attempt to ++# start it. Useful when testing erroneous connection specs such as ++# "tcp8:". ++# ++# - The prefix that should be prepended to the test messages. ++set test_params \ ++ { \ ++ { "tcp4:127.0.0.1" 0 "tcp4" } \ ++ { "tcp6:::1" 0 "tcp6" } \ ++ { "tcp6:[::1]" 0 "tcp6-with-brackets" } \ ++ { "tcp:localhost" 0 "tcp" } \ ++ { "udp4:127.0.0.1" 0 "udp4" } \ ++ { "udp6:::1" 0 "udp6" } \ ++ { "udp6:[::1]" 0 "udp6-with-brackets" } \ ++ { "tcp8:123" 1 "tcp8" } \ ++ { "udp123:::" 1 "udp123" } \ ++ { "garbage:1234" 1 "garbage:1234" } \ ++ } ++ ++# The best way to test different types of connections is to set the ++# GDB_TEST_SOCKETHOST variable accordingly. ++save_vars { GDB_TEST_SOCKETHOST } { ++ foreach line $test_params { ++ set sockhost [lindex $line 0] ++ set gdbserver_should_fail [lindex $line 1] ++ set prefix [lindex $line 2] ++ ++ with_test_prefix $prefix { ++ set GDB_TEST_SOCKETHOST $sockhost ++ set test "start gdbserver" ++ ++ # Try to start gdbserver. ++ set catchres [catch {set res [gdbserver_start "" $target_exec]} errmsg] ++ ++ if { $catchres != 0 } { ++ if { $gdbserver_should_fail } { ++ pass "$test: gdbserver failed as expected" ++ } else { ++ fail "$test: $errmsg" ++ } ++ continue ++ } else { ++ if { $gdbserver_should_fail } { ++ fail "$test: gdbserver should fail but did not" ++ } else { ++ pass "$test" ++ } ++ } ++ ++ set gdbserver_protocol [lindex $res 0] ++ set gdbserver_gdbport [lindex $res 1] ++ set test "connect to gdbserver using $sockhost" ++ ++ if { [gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport] == 0 } { ++ pass $test ++ } else { ++ fail $test ++ } ++ } ++ } ++} +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 +@@ -211,7 +211,7 @@ proc gdbserver_default_get_remote_address { host port } { + # Default routine to compute the "comm" argument for gdbserver. + + proc gdbserver_default_get_comm_port { port } { +- return ":$port" ++ return "$port" + } + + # Start a gdbserver process with initial OPTIONS and trailing ARGUMENTS. +@@ -221,6 +221,7 @@ proc gdbserver_default_get_comm_port { port } { + + proc gdbserver_start { options arguments } { + global portnum ++ global GDB_TEST_SOCKETHOST + + # Port id -- either specified in baseboard file, or managed here. + if [target_info exists gdb,socketport] { +@@ -231,10 +232,22 @@ proc gdbserver_start { options arguments } { + } + + # Extract the local and remote host ids from the target board struct. +- if [target_info exists sockethost] { ++ if { [info exists GDB_TEST_SOCKETHOST] } { ++ # The user is not supposed to provide a port number, just a ++ # hostname/address, therefore we add the trailing ":" here. ++ set debughost "${GDB_TEST_SOCKETHOST}:" ++ # Escape open and close square brackets. ++ set debughost_tmp [string map { [ \\[ ] \\] } $debughost] ++ # We need a "gdbserver" version of the debughost, which will ++ # have the possible connection prefix stripped. This is ++ # because gdbserver currently doesn't recognize the prefixes. ++ regsub -all "^\(tcp:|udp:|tcp4:|udp4:|tcp6:|udp6:\)" $debughost_tmp "" debughost_gdbserver ++ } elseif [target_info exists sockethost] { + set debughost [target_info sockethost] ++ set debughost_gdbserver $debughost + } else { + set debughost "localhost:" ++ set debughost_gdbserver $debughost + } + + # Some boards use a different value for the port that is passed to +@@ -277,8 +290,14 @@ proc gdbserver_start { options arguments } { + if { $options != "" } { + append gdbserver_command " $options" + } ++ if { $debughost_gdbserver != "" } { ++ append gdbserver_command " $debughost_gdbserver" ++ } + if { $portnum != "" } { +- append gdbserver_command " [$get_comm_port $portnum]" ++ if { $debughost_gdbserver == "" } { ++ append gdbserver_command " " ++ } ++ append gdbserver_command "[$get_comm_port $portnum]" + } + if { $arguments != "" } { + append gdbserver_command " $arguments" +@@ -307,6 +326,9 @@ proc gdbserver_start { options arguments } { + continue + } + } ++ -re ".*: cannot resolve name: Name or service not known\r\n" { ++ error "gdbserver cannot resolve name." ++ } + timeout { + error "Timeout waiting for gdbserver response." + } +diff --git a/gdb/unittests/parse-connection-spec-selftests.c b/gdb/unittests/parse-connection-spec-selftests.c +new file mode 100644 +--- /dev/null ++++ b/gdb/unittests/parse-connection-spec-selftests.c +@@ -0,0 +1,249 @@ ++/* Self tests for parsing connection specs for GDB, the GNU debugger. ++ ++ Copyright (C) 2018 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ 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 3 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 . */ ++ ++#include "defs.h" ++#include "selftest.h" ++#include "common/netstuff.h" ++#include "diagnostics.h" ++#ifdef USE_WIN32API ++#include ++#include ++#else ++#include ++#include ++#include ++#include ++#include ++#endif ++ ++namespace selftests { ++namespace parse_connection_spec_tests { ++ ++/* Auxiliary struct that holds info about a specific test for a ++ connection spec. */ ++ ++struct parse_conn_test ++{ ++ /* The connection spec. */ ++ const char *connspec; ++ ++ /* Expected result from 'parse_connection_spec'. */ ++ parsed_connection_spec expected_result; ++ ++ /* True if this test should fail, false otherwise. If true, only ++ the CONNSPEC field should be considered as valid. */ ++ bool should_fail; ++ ++ /* The expected AI_FAMILY to be found on the 'struct addrinfo' ++ HINT. */ ++ int exp_ai_family; ++ ++ /* The expected AI_SOCKTYPE to be found on the 'struct addrinfo' ++ HINT. */ ++ int exp_ai_socktype; ++ ++ /* The expected AI_PROTOCOL to be found on the 'struct addrinfo' ++ HINT. */ ++ int exp_ai_protocol; ++}; ++ ++/* Some defines to help us fill a 'struct parse_conn_test'. */ ++ ++/* Initialize a full entry. */ ++#define INIT_ENTRY(ADDR, EXP_HOST, EXP_PORT, SHOULD_FAIL, EXP_AI_FAMILY, \ ++ EXP_AI_SOCKTYPE, EXP_AI_PROTOCOL) \ ++ { ADDR, { EXP_HOST, EXP_PORT }, SHOULD_FAIL, EXP_AI_FAMILY, \ ++ EXP_AI_SOCKTYPE, EXP_AI_PROTOCOL } ++ ++/* Initialize an unprefixed entry. In this case, we don't expect ++ anything on the 'struct addrinfo' HINT. */ ++#define INIT_UNPREFIXED_ENTRY(ADDR, EXP_HOST, EXP_PORT) \ ++ INIT_ENTRY (ADDR, EXP_HOST, EXP_PORT, false, 0, 0, 0) ++ ++/* Initialized an unprefixed IPv6 entry. In this case, we don't ++ expect anything on the 'struct addrinfo' HINT. */ ++#define INIT_UNPREFIXED_IPV6_ENTRY(ADDR, EXP_HOST, EXP_PORT) \ ++ INIT_ENTRY (ADDR, EXP_HOST, EXP_PORT, false, AF_INET6, 0, 0) ++ ++/* Initialize a prefixed entry. */ ++#define INIT_PREFIXED_ENTRY(ADDR, EXP_HOST, EXP_PORT, EXP_AI_FAMILY, \ ++ EXP_AI_SOCKTYPE, EXP_AI_PROTOCOL) \ ++ INIT_ENTRY (ADDR, EXP_HOST, EXP_PORT, false, EXP_AI_FAMILY, \ ++ EXP_AI_SOCKTYPE, EXP_AI_PROTOCOL) ++ ++/* Initialize an entry prefixed with "tcp4:". */ ++#define INIT_PREFIXED_IPV4_TCP(ADDR, EXP_HOST, EXP_PORT) \ ++ INIT_PREFIXED_ENTRY (ADDR, EXP_HOST, EXP_PORT, AF_INET, SOCK_STREAM, \ ++ IPPROTO_TCP) ++ ++/* Initialize an entry prefixed with "tcp6:". */ ++#define INIT_PREFIXED_IPV6_TCP(ADDR, EXP_HOST, EXP_PORT) \ ++ INIT_PREFIXED_ENTRY (ADDR, EXP_HOST, EXP_PORT, AF_INET6, SOCK_STREAM, \ ++ IPPROTO_TCP) ++ ++/* Initialize an entry prefixed with "udp4:". */ ++#define INIT_PREFIXED_IPV4_UDP(ADDR, EXP_HOST, EXP_PORT) \ ++ INIT_PREFIXED_ENTRY (ADDR, EXP_HOST, EXP_PORT, AF_INET, SOCK_DGRAM, \ ++ IPPROTO_UDP) ++ ++/* Initialize an entry prefixed with "udp6:". */ ++#define INIT_PREFIXED_IPV6_UDP(ADDR, EXP_HOST, EXP_PORT) \ ++ INIT_PREFIXED_ENTRY (ADDR, EXP_HOST, EXP_PORT, AF_INET6, SOCK_DGRAM, \ ++ IPPROTO_UDP) ++ ++/* Initialize a bogus entry, i.e., a connection spec that should ++ fail. */ ++#define INIT_BOGUS_ENTRY(ADDR) \ ++ INIT_ENTRY (ADDR, "", "", true, 0, 0, 0) ++ ++/* The variable which holds all of our tests. */ ++ ++static const parse_conn_test conn_test[] = ++ { ++ /* Unprefixed addresses. */ ++ ++ /* IPv4, host and port present. */ ++ INIT_UNPREFIXED_ENTRY ("127.0.0.1:1234", "127.0.0.1", "1234"), ++ /* IPv4, only host. */ ++ INIT_UNPREFIXED_ENTRY ("127.0.0.1", "127.0.0.1", ""), ++ /* IPv4, missing port. */ ++ INIT_UNPREFIXED_ENTRY ("127.0.0.1:", "127.0.0.1", ""), ++ ++ /* IPv6, host and port present, no brackets. */ ++ INIT_UNPREFIXED_ENTRY ("::1:1234", "::1", "1234"), ++ /* IPv6, missing port, no brackets. */ ++ INIT_UNPREFIXED_ENTRY ("::1:", "::1", ""), ++ /* IPv6, host and port present, with brackets. */ ++ INIT_UNPREFIXED_IPV6_ENTRY ("[::1]:1234", "::1", "1234"), ++ /* IPv6, only host, with brackets. */ ++ INIT_UNPREFIXED_IPV6_ENTRY ("[::1]", "::1", ""), ++ /* IPv6, missing port, with brackets. */ ++ INIT_UNPREFIXED_IPV6_ENTRY ("[::1]:", "::1", ""), ++ ++ /* Unspecified, only port. */ ++ INIT_UNPREFIXED_ENTRY (":1234", "localhost", "1234"), ++ ++ /* Prefixed addresses. */ ++ ++ /* Prefixed "tcp4:" IPv4, host and port presents. */ ++ INIT_PREFIXED_IPV4_TCP ("tcp4:127.0.0.1:1234", "127.0.0.1", "1234"), ++ /* Prefixed "tcp4:" IPv4, only port. */ ++ INIT_PREFIXED_IPV4_TCP ("tcp4::1234", "localhost", "1234"), ++ /* Prefixed "tcp4:" IPv4, only host. */ ++ INIT_PREFIXED_IPV4_TCP ("tcp4:127.0.0.1", "127.0.0.1", ""), ++ /* Prefixed "tcp4:" IPv4, missing port. */ ++ INIT_PREFIXED_IPV4_TCP ("tcp4:127.0.0.1:", "127.0.0.1", ""), ++ ++ /* Prefixed "udp4:" IPv4, host and port present. */ ++ INIT_PREFIXED_IPV4_UDP ("udp4:127.0.0.1:1234", "127.0.0.1", "1234"), ++ /* Prefixed "udp4:" IPv4, only port. */ ++ INIT_PREFIXED_IPV4_UDP ("udp4::1234", "localhost", "1234"), ++ /* Prefixed "udp4:" IPv4, only host. */ ++ INIT_PREFIXED_IPV4_UDP ("udp4:127.0.0.1", "127.0.0.1", ""), ++ /* Prefixed "udp4:" IPv4, missing port. */ ++ INIT_PREFIXED_IPV4_UDP ("udp4:127.0.0.1:", "127.0.0.1", ""), ++ ++ ++ /* Prefixed "tcp6:" IPv6, host and port present. */ ++ INIT_PREFIXED_IPV6_TCP ("tcp6:::1:1234", "::1", "1234"), ++ /* Prefixed "tcp6:" IPv6, only port. */ ++ INIT_PREFIXED_IPV6_TCP ("tcp6::1234", "localhost", "1234"), ++ /* Prefixed "tcp6:" IPv6, only host. */ ++ //INIT_PREFIXED_IPV6_TCP ("tcp6:::1", "::1", ""), ++ /* Prefixed "tcp6:" IPv6, missing port. */ ++ INIT_PREFIXED_IPV6_TCP ("tcp6:::1:", "::1", ""), ++ ++ /* Prefixed "udp6:" IPv6, host and port present. */ ++ INIT_PREFIXED_IPV6_UDP ("udp6:::1:1234", "::1", "1234"), ++ /* Prefixed "udp6:" IPv6, only port. */ ++ INIT_PREFIXED_IPV6_UDP ("udp6::1234", "localhost", "1234"), ++ /* Prefixed "udp6:" IPv6, only host. */ ++ //INIT_PREFIXED_IPV6_UDP ("udp6:::1", "::1", ""), ++ /* Prefixed "udp6:" IPv6, missing port. */ ++ INIT_PREFIXED_IPV6_UDP ("udp6:::1:", "::1", ""), ++ ++ /* Prefixed "tcp6:" IPv6 with brackets, host and port present. */ ++ INIT_PREFIXED_IPV6_TCP ("tcp6:[::1]:1234", "::1", "1234"), ++ /* Prefixed "tcp6:" IPv6 with brackets, only host. */ ++ INIT_PREFIXED_IPV6_TCP ("tcp6:[::1]", "::1", ""), ++ /* Prefixed "tcp6:" IPv6 with brackets, missing port. */ ++ INIT_PREFIXED_IPV6_TCP ("tcp6:[::1]:", "::1", ""), ++ ++ /* Prefixed "udp6:" IPv6 with brackets, host and port present. */ ++ INIT_PREFIXED_IPV6_UDP ("udp6:[::1]:1234", "::1", "1234"), ++ /* Prefixed "udp6:" IPv6 with brackets, only host. */ ++ INIT_PREFIXED_IPV6_UDP ("udp6:[::1]", "::1", ""), ++ /* Prefixed "udp6:" IPv6 with brackets, missing port. */ ++ INIT_PREFIXED_IPV6_UDP ("udp6:[::1]:", "::1", ""), ++ ++ ++ /* Bogus addresses. */ ++ INIT_BOGUS_ENTRY ("tcp6:[::1]123:44"), ++ INIT_BOGUS_ENTRY ("[::1"), ++ INIT_BOGUS_ENTRY ("tcp6:::1]:"), ++ }; ++ ++/* Test a connection spec C. */ ++ ++static void ++test_conn (const parse_conn_test &c) ++{ ++ struct addrinfo hint; ++ parsed_connection_spec ret; ++ ++ memset (&hint, 0, sizeof (hint)); ++ ++ TRY ++ { ++ ret = parse_connection_spec (c.connspec, &hint); ++ } ++ CATCH (ex, RETURN_MASK_ERROR) ++ { ++ /* If we caught an error, we should check if this connection ++ spec was supposed to fail. */ ++ SELF_CHECK (c.should_fail); ++ return; ++ } ++ END_CATCH ++ ++ SELF_CHECK (!c.should_fail); ++ SELF_CHECK (ret.host_str == c.expected_result.host_str); ++ SELF_CHECK (ret.port_str == c.expected_result.port_str); ++ SELF_CHECK (hint.ai_family == c.exp_ai_family); ++ SELF_CHECK (hint.ai_socktype == c.exp_ai_socktype); ++ SELF_CHECK (hint.ai_protocol == c.exp_ai_protocol); ++} ++ ++/* Run the tests associated with parsing connection specs. */ ++ ++static void ++run_tests () ++{ ++ for (const parse_conn_test &c : conn_test) ++ test_conn (c); ++} ++} /* namespace parse_connection_spec_tests */ ++} /* namespace selftests */ ++ ++void ++_initialize_parse_connection_spec_selftests () ++{ ++ selftests::register_test ("parse_connection_spec", ++ selftests::parse_connection_spec_tests::run_tests); ++} 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.spec b/gdb.spec index 77a99c2..fc6d32b 100644 --- a/gdb.spec +++ b/gdb.spec @@ -18,7 +18,7 @@ Name: %{?scl_prefix}gdb # Freeze it when GDB gets branched -%global snapsrc 20180708 +%global snapsrc 20180714 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20161115 %global tarname gdb-%{version} @@ -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: 34%{?dist} +Release: 35%{?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 @@ -1030,6 +1030,10 @@ fi %endif %changelog +* Sat Jul 14 2018 Sergio Durigan Junior - 8.1.90.20180714-35.fc29 +- Rebase to FSF GDB 8.1.90.20180714 (8.2pre). +- Backport IPv6 patch (RH BZ 881849, Sergio Durigan Junior). + * Fri Jul 13 2018 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 2f6fc56e9aeaa8cf4d8773807ef9b26a9a545e6b Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Sun, 15 Jul 2018 12:31:12 -0400 Subject: [PATCH 13/35] Upload source files for last version --- .gitignore | 2 +- sources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 641e0d7..658f701 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.20180708.tar.xz +/gdb-8.1.90.20180714.tar.xz diff --git a/sources b/sources index f21c314..8d5a2e4 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.20180708.tar.xz) = 95e0a841327536df7ba25e970e9696ebdbe8454203ac5fdb060a408ce6021ab353dc98ba292100f2c7d60f382f08d9972dcf35221c256f907f5af12b656a94bd +SHA512 (gdb-8.1.90.20180714.tar.xz) = 30554d2d709fa77c53260aa37d79a0a0b39c2be337eabe4a887eb2e58690ef4e9db3188e66eab992977431e21c7b2bf6d7aa42b3a41d6129bec532a1f9648524 From 2e649f71e0bc00324654788b7c9c1c7efe5490d9 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 25 Jul 2018 17:35:59 -0400 Subject: [PATCH 14/35] Improve error handling on generate-* scripts --- generate-git-repo-from-patches.sh | 6 ++++++ generate-patches-from-git-repo.sh | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/generate-git-repo-from-patches.sh b/generate-git-repo-from-patches.sh index 8f68477..490cca9 100755 --- a/generate-git-repo-from-patches.sh +++ b/generate-git-repo-from-patches.sh @@ -35,8 +35,14 @@ test -f _git_upstream_commit || die "Cannot find _git_upstream_commit file." test -f _patch_order || die "Cannot find _patch_order file." last_ancestor_commit=`cat _git_upstream_commit` + cd $1 + +git name-rev $last_ancestor_commit +test $? -eq 0 || die "Could not find $last_ancestor_commit in the repository $1. Did you run 'git fetch'?" + git checkout $last_ancestor_commit for p in `cat ../_patch_order` ; do git am ../$p + test $? -eq 0 || die "Could not apply patch '$p'." done diff --git a/generate-patches-from-git-repo.sh b/generate-patches-from-git-repo.sh index 3d454b7..faa64a2 100755 --- a/generate-patches-from-git-repo.sh +++ b/generate-patches-from-git-repo.sh @@ -51,6 +51,10 @@ for f in `cat _patch_order` ; do done cd $1 + +git name-rev $commit_or_tag +test $? -eq 0 || die "Could not find $commit_or_tag in the repository. Did you run 'git fetch'?" + idx=1 common_ancestor=`git merge-base HEAD $commit_or_tag` From 47b02ba87c19b9aee0aeb6cd33169cd96216cc78 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 25 Jul 2018 21:03:56 -0400 Subject: [PATCH 15/35] Rebase to FSF GDB 8.1.90.20180724 (8.2pre). --- .gitignore | 2 +- _git_upstream_commit | 2 +- gdb-glibc-strstr-workaround.patch | 2 +- gdb-gnat-dwarf-crash-3of3.patch | 2 +- gdb-rhbz795424-bitpos-20of25.patch | 2 +- gdb-rhbz881849-ipv6-1of2.patch | 30 ------------------------- gdb-vla-intel-fortran-strides.patch | 8 +++---- gdb-vla-intel-fortran-vla-strings.patch | 24 ++++++++++---------- gdb.spec | 7 ++++-- sources | 2 +- 10 files changed, 27 insertions(+), 54 deletions(-) diff --git a/.gitignore b/.gitignore index 658f701..8c81aca 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.20180714.tar.xz +/gdb-8.1.90.20180724.tar.xz diff --git a/_git_upstream_commit b/_git_upstream_commit index 6eddfd2..418b7ff 100644 --- a/_git_upstream_commit +++ b/_git_upstream_commit @@ -1 +1 @@ -baa98cb7e6298cd74ad9638e5b02aa192f804659 +8a993b61804a32e0086ca2fecbc715b6f9c1b308 diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch index c087a68..2fec7cf 100644 --- a/gdb-glibc-strstr-workaround.patch +++ b/gdb-glibc-strstr-workaround.patch @@ -9,7 +9,7 @@ Subject: gdb-glibc-strstr-workaround.patch diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -21254,6 +21254,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, +@@ -21270,6 +21270,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* Cache this symbol's name and the name's demangled form (if any). */ SYMBOL_SET_LANGUAGE (sym, cu->language, &objfile->objfile_obstack); linkagename = dwarf2_physname (name, die, cu); diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch index e36ec7c..c7b8643 100644 --- a/gdb-gnat-dwarf-crash-3of3.patch +++ b/gdb-gnat-dwarf-crash-3of3.patch @@ -42,7 +42,7 @@ gdb/ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -10482,6 +10482,13 @@ private: +@@ -10499,6 +10499,13 @@ private: static void process_die (struct die_info *die, struct dwarf2_cu *cu) { diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index 6ebda52..e2c2f48 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -1650,7 +1650,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } static void -@@ -14933,8 +14933,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, +@@ -14949,8 +14949,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, object, and then subtract off the number of bits of the field itself. The result is the bit offset of the LSB of the field. */ diff --git a/gdb-rhbz881849-ipv6-1of2.patch b/gdb-rhbz881849-ipv6-1of2.patch index 32745c9..50510c8 100644 --- a/gdb-rhbz881849-ipv6-1of2.patch +++ b/gdb-rhbz881849-ipv6-1of2.patch @@ -195,36 +195,6 @@ gdb/doc/ChangeLog: * gdb.texinfo (Remote Connection Commands): Add explanation about new IPv6 support. Add new connection prefixes. -diff --git a/gdb/ChangeLog b/gdb/ChangeLog ---- a/gdb/ChangeLog -+++ b/gdb/ChangeLog -@@ -1,3 +1,26 @@ -+2018-07-11 Sergio Durigan Junior -+ Jan Kratochvil -+ Paul Fertser -+ Tsutomu Seki -+ Pedro Alves -+ -+ * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add -+ 'unittests/parse-connection-spec-selftests.c'. -+ (COMMON_SFILES): Add 'common/netstuff.c'. -+ (HFILES_NO_SRCDIR): Add 'common/netstuff.h'. -+ * NEWS (Changes since GDB 8.2): Mention IPv6 support. -+ * common/netstuff.c: New file. -+ * common/netstuff.h: New file. -+ * ser-tcp.c: Include 'netstuff.h' and 'wspiapi.h'. -+ (wait_for_connect): Update comment. New parameter -+ 'gdb::optional sock' instead of 'struct serial *scb'. -+ Use 'sock' directly instead of 'scb->fd'. -+ (try_connect): New function, with code from 'net_open'. -+ (net_open): Rewrite main loop to deal with multiple -+ sockets/addresses. Handle IPv6-style hostnames; implement -+ support for IPv6 connections. -+ * unittests/parse-connection-spec-selftests.c: New file. -+ - 2018-07-11 Pedro Alves - - PR gdb/23377 diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch index ddd2be0..faf836c 100644 --- a/gdb-vla-intel-fortran-strides.patch +++ b/gdb-vla-intel-fortran-strides.patch @@ -143,7 +143,7 @@ diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -17534,7 +17534,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17550,7 +17550,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type, *orig_base_type; struct type *range_type; struct attribute *attr; @@ -152,7 +152,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c int low_default_is_valid; int high_bound_is_count = 0; const char *name; -@@ -17554,7 +17554,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17570,7 +17570,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) low.kind = PROP_CONST; high.kind = PROP_CONST; @@ -162,7 +162,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow omitting DW_AT_lower_bound. */ -@@ -17587,6 +17589,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17603,6 +17605,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) break; } @@ -177,7 +177,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) attr_to_dynamic_prop (attr, die, cu, &low); -@@ -17664,7 +17674,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17680,7 +17690,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask)) high.data.const_val |= negative_mask; diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch index 29cb4ec..8c15121 100644 --- a/gdb-vla-intel-fortran-vla-strings.patch +++ b/gdb-vla-intel-fortran-vla-strings.patch @@ -87,7 +87,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c /* memory allocation interface */ -@@ -13632,7 +13633,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -13648,7 +13649,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) { newobj->static_link = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop); @@ -96,7 +96,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } cu->list_in_scope = &local_symbols; -@@ -16297,7 +16298,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -16313,7 +16314,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) byte_stride_prop = (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop)); @@ -106,7 +106,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (!stride_ok) { complaint (_("unable to read array DW_AT_byte_stride " -@@ -17058,29 +17060,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17074,29 +17076,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -208,7 +208,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -17428,7 +17491,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17444,7 +17507,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, @@ -218,7 +218,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c { struct dwarf2_property_baton *baton; struct obstack *obstack -@@ -17439,14 +17503,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17455,14 +17519,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, if (attr_form_is_block (attr)) { @@ -256,7 +256,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } else if (attr_form_is_ref (attr)) { -@@ -17479,8 +17562,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17495,8 +17578,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, baton = XOBNEW (obstack, struct dwarf2_property_baton); baton->referenced_type = die_type (target_die, target_cu); baton->locexpr.per_cu = cu->per_cu; @@ -287,7 +287,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c prop->data.baton = baton; prop->kind = PROP_LOCEXPR; gdb_assert (prop->data.baton != NULL); -@@ -17591,7 +17694,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17607,7 +17710,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_byte_stride, cu); if (attr) @@ -296,7 +296,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c complaint (_("Missing DW_AT_byte_stride " "- DIE at 0x%s [in module %s]"), sect_offset_str (die->sect_off), -@@ -17599,7 +17702,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17615,7 +17718,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) @@ -305,7 +305,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c else if (!low_default_is_valid) complaint (_("Missing DW_AT_lower_bound " "- DIE at %s [in module %s]"), -@@ -17607,10 +17710,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17623,10 +17726,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) objfile_name (cu->per_cu->dwarf2_per_objfile->objfile)); attr = dwarf2_attr (die, DW_AT_upper_bound, cu); @@ -318,7 +318,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c { /* If bounds are constant do the final calculation here. */ if (low.kind == PROP_CONST && high.kind == PROP_CONST) -@@ -25111,7 +25214,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25127,7 +25230,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_allocated, cu); if (attr_form_is_block (attr)) { @@ -327,7 +327,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ALLOCATED, prop, type); } else if (attr != NULL) -@@ -25125,7 +25228,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25141,7 +25244,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_associated, cu); if (attr_form_is_block (attr)) { @@ -336,7 +336,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type); } else if (attr != NULL) -@@ -25137,7 +25240,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25153,7 +25256,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) /* Read DW_AT_data_location and set in type. */ attr = dwarf2_attr (die, DW_AT_data_location, cu); diff --git a/gdb.spec b/gdb.spec index fc6d32b..d3cfedc 100644 --- a/gdb.spec +++ b/gdb.spec @@ -18,7 +18,7 @@ Name: %{?scl_prefix}gdb # Freeze it when GDB gets branched -%global snapsrc 20180714 +%global snapsrc 20180724 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20161115 %global tarname gdb-%{version} @@ -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: 35%{?dist} +Release: 36%{?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 @@ -1030,6 +1030,9 @@ fi %endif %changelog +* Wed Jul 25 2018 Sergio Durigan Junior - 8.1.90.20180724-36.fc29 +- Rebase to FSF GDB 8.1.90.20180724 (8.2pre). + * Sat Jul 14 2018 Sergio Durigan Junior - 8.1.90.20180714-35.fc29 - Rebase to FSF GDB 8.1.90.20180714 (8.2pre). - Backport IPv6 patch (RH BZ 881849, Sergio Durigan Junior). diff --git a/sources b/sources index 8d5a2e4..6c1193b 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.20180714.tar.xz) = 30554d2d709fa77c53260aa37d79a0a0b39c2be337eabe4a887eb2e58690ef4e9db3188e66eab992977431e21c7b2bf6d7aa42b3a41d6129bec532a1f9648524 +SHA512 (gdb-8.1.90.20180724.tar.xz) = 1124f5c03eee5c0f0aedf2746296bff6609a88857a25a524295a09066d42accedd7b1693084ca9f28e5669a3cd84ce3bb5e5621389dc855120ad8b0355cdb8fa From 4f0bc6641e9e8e544ea7e1d5f5a82713093f7176 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Sat, 28 Jul 2018 15:23:17 -0400 Subject: [PATCH 16/35] Rebase to FSF GDB 8.1.90.20180727 (8.2pre). --- .gitignore | 2 +- _git_upstream_commit | 2 +- gdb.spec | 7 +++++-- sources | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 8c81aca..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.20180724.tar.xz +/gdb-8.1.90.20180727.tar.xz diff --git a/_git_upstream_commit b/_git_upstream_commit index 418b7ff..06f33fd 100644 --- a/_git_upstream_commit +++ b/_git_upstream_commit @@ -1 +1 @@ -8a993b61804a32e0086ca2fecbc715b6f9c1b308 +ab080c102869dd3ad300a99d0c00b256404fd76b diff --git a/gdb.spec b/gdb.spec index d3cfedc..b8420e8 100644 --- a/gdb.spec +++ b/gdb.spec @@ -18,7 +18,7 @@ Name: %{?scl_prefix}gdb # Freeze it when GDB gets branched -%global snapsrc 20180724 +%global snapsrc 20180727 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20161115 %global tarname gdb-%{version} @@ -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: 36%{?dist} +Release: 37%{?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 @@ -1030,6 +1030,9 @@ fi %endif %changelog +* Sat Jul 28 2018 Sergio Durigan Junior - 8.1.90.20180727-37.fc29 +- Rebase to FSF GDB 8.1.90.20180727 (8.2pre). + * Wed Jul 25 2018 Sergio Durigan Junior - 8.1.90.20180724-36.fc29 - Rebase to FSF GDB 8.1.90.20180724 (8.2pre). diff --git a/sources b/sources index 6c1193b..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.20180724.tar.xz) = 1124f5c03eee5c0f0aedf2746296bff6609a88857a25a524295a09066d42accedd7b1693084ca9f28e5669a3cd84ce3bb5e5621389dc855120ad8b0355cdb8fa +SHA512 (gdb-8.1.90.20180727.tar.xz) = 0f8e9cfaeaf9f22361b3b8d5d490d0a8bea3eeaaa0c6813d5df0a6d5267ff3f597747cc0e97d70c4196d78ee32e0e82d5893283d71b449d89703893bf1ae0014 From 2ef085ccae56c07b054c726186c3ac9494490116 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Mon, 30 Jul 2018 16:01:20 -0400 Subject: [PATCH 17/35] Recompile to fix RH BZ 1609504 (due to RH BZ 1609577). --- gdb.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb.spec b/gdb.spec index b8420e8..2f93ff8 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: 37%{?dist} +Release: 38%{?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 @@ -1030,6 +1030,9 @@ fi %endif %changelog +* Mon Jul 30 2018 Sergio Durigan Junior - 8.1.90.20180727-38.fc29 +- Recompile to fix RH BZ 1609504 (due to RH BZ 1609577). + * Sat Jul 28 2018 Sergio Durigan Junior - 8.1.90.20180727-37.fc29 - Rebase to FSF GDB 8.1.90.20180727 (8.2pre). From f21bb2353c6f59848f9f90ab18cbe832b792ca9d Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Wed, 8 Aug 2018 17:30:20 +0200 Subject: [PATCH 18/35] [dts] Fix build by removing a patch for already removed pahole.py . [dts rhel6] Fix build by updating gdb-gnat-dwarf-crash-3of3.patch . --- gdb-gnat-dwarf-crash-3of3.patch | 8 ++++---- gdb-pahole-python2.patch | 36 --------------------------------- gdb.spec | 10 ++++----- 3 files changed, 9 insertions(+), 45 deletions(-) delete mode 100644 gdb-pahole-python2.patch diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch index c7b8643..a20da46 100644 --- a/gdb-gnat-dwarf-crash-3of3.patch +++ b/gdb-gnat-dwarf-crash-3of3.patch @@ -94,7 +94,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c fprintf_unfiltered (gdb_stdlog, "LNPAW: Attaching to a stopped process\n"); +#ifdef NEED_DETACH_SIGSTOP -+ pid_was_stopped = ptid_get_pid (ptid); ++ pid_was_stopped = ptid.pid (); +#endif /* The process is definitely stopped. It is in a job control @@ -106,12 +106,12 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c +#ifdef NEED_DETACH_SIGSTOP + /* Workaround RHEL-5 kernel which has unreliable PTRACE_DETACH, SIGSTOP (that + many TIDs are left unstopped). See RH Bug 496732. */ -+ if (ptid_get_pid (lp->ptid) == pid_was_stopped) ++ if (lp->ptid.pid () == pid_was_stopped) + { + int err; + + errno = 0; -+ err = kill_lwp (ptid_get_lwp (lp->ptid), SIGSTOP); ++ err = kill_lwp (lp->ptid.lwp (), SIGSTOP); + if (debug_linux_nat) + { + fprintf_unfiltered (gdb_stdlog, @@ -146,7 +146,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c + it as stopped if the user detaches. PTID variable has PID set to LWP + while we need to check the real PID here. */ + -+ if (!step && lp && pid_was_stopped == ptid_get_pid (lp->ptid)) ++ if (!step && lp && pid_was_stopped == lp->ptid.pid ()) + pid_was_stopped = 0; + +#endif diff --git a/gdb-pahole-python2.patch b/gdb-pahole-python2.patch deleted file mode 100644 index 473a32e..0000000 --- a/gdb-pahole-python2.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py -index e08eaf5..56c1737 100644 ---- a/gdb/python/lib/gdb/command/pahole.py -+++ b/gdb/python/lib/gdb/command/pahole.py -@@ -55,19 +55,19 @@ It prints the type and displays comments showing where holes are.""" - fieldsize = 8 * ftype.sizeof - - # TARGET_CHAR_BIT -- print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "") -+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8))), - bitpos = bitpos + fieldsize - - if ftype.code == gdb.TYPE_CODE_STRUCT: - self.pahole (ftype, level + 1, field.name) - else: -- print (' ' * (2 + 2 * level), end = "") -+ print (' ' * (2 + 2 * level)), - print ('%s %s' % (str (ftype), field.name)) - - if level == 0: - self.maybe_print_hole(bitpos, 8 * type.sizeof) - -- print (' ' * (14 + 2 * level), end = "") -+ print (' ' * (14 + 2 * level)), - print ('} %s' % name) - - def invoke (self, arg, from_tty): -@@ -75,7 +75,7 @@ It prints the type and displays comments showing where holes are.""" - type = type.strip_typedefs () - if type.code != gdb.TYPE_CODE_STRUCT: - raise (TypeError, '%s is not a struct type' % arg) -- print (' ' * 14, end = "") -+ print (' ' * 14), - self.pahole (type, 0, '') - - Pahole() diff --git a/gdb.spec b/gdb.spec index 2f93ff8..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: 38%{?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 @@ -178,9 +178,6 @@ Patch1142: v1.5-libipt-static.patch #=push+jan Patch1171: v1.6.1-implicit-fallthrough.patch -## Fix the pahole command breakage due to its Python3 port (RH BZ 1264532). -##=fedora -Patch1044: gdb-pahole-python2.patch ## [testsuite] Fix false selftest.exp FAIL from system readline-6.3+ (Patrick Palka). ##=fedoratest #Patch1075: gdb-testsuite-readline63-sigint.patch @@ -448,7 +445,6 @@ done %if 0%{?rhel:1} && 0%{?rhel} <= 7 %patch1119 -p1 -%patch1044 -p1 %endif find -name "*.orig" | xargs rm -f @@ -1030,6 +1026,10 @@ fi %endif %changelog +* 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 . + * Mon Jul 30 2018 Sergio Durigan Junior - 8.1.90.20180727-38.fc29 - Recompile to fix RH BZ 1609504 (due to RH BZ 1609577). From 76ddc56b6d88fe6d25622d1c4937491491fa1dc0 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 8 Aug 2018 15:04:49 -0400 Subject: [PATCH 19/35] Rebuild due to new libipt release. Adjust bundled libipt; remove unnecessary patch. Sync IPv6 patch with F-28 GDB. --- .gitignore | 2 +- _gdb.spec.Patch.include | 9 ++- _gdb.spec.patch.include | 1 + _patch_order | 5 +- ...f2.patch => gdb-rhbz881849-ipv6-1of3.patch | 2 +- gdb-rhbz881849-ipv6-2of2.patch | 63 ---------------- gdb-rhbz881849-ipv6-2of3.patch | 54 ++++++++++++++ gdb-rhbz881849-ipv6-3of3.patch | 72 +++++++++++++++++++ gdb.spec | 13 ++-- sources | 2 +- v1.5-libipt-static.patch | 14 ++-- v1.6.1-implicit-fallthrough.patch | 23 ------ 12 files changed, 155 insertions(+), 105 deletions(-) rename gdb-rhbz881849-ipv6-1of2.patch => gdb-rhbz881849-ipv6-1of3.patch (99%) delete mode 100644 gdb-rhbz881849-ipv6-2of2.patch create mode 100644 gdb-rhbz881849-ipv6-2of3.patch create mode 100644 gdb-rhbz881849-ipv6-3of3.patch delete mode 100644 v1.6.1-implicit-fallthrough.patch diff --git a/.gitignore b/.gitignore index 0abe58a..949c204 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 8ba0e48..946c4af 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -505,8 +505,11 @@ 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-1of2.patch +Patch122: gdb-rhbz881849-ipv6-1of3.patch -# Implement IPv6 support for GDB/gdbserver (RH BZ 881849, Sergio Durigan Junior). -Patch123: gdb-rhbz881849-ipv6-2of2.patch + +Patch123: gdb-rhbz881849-ipv6-2of3.patch + + +Patch124: gdb-rhbz881849-ipv6-3of3.patch diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include index 27a39b7..97f12c4 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -121,3 +121,4 @@ %patch121 -p1 %patch122 -p1 %patch123 -p1 +%patch124 -p1 diff --git a/_patch_order b/_patch_order index 11b4131..b10536c 100644 --- a/_patch_order +++ b/_patch_order @@ -119,5 +119,6 @@ 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-1of2.patch -gdb-rhbz881849-ipv6-2of2.patch +gdb-rhbz881849-ipv6-1of3.patch +gdb-rhbz881849-ipv6-2of3.patch +gdb-rhbz881849-ipv6-3of3.patch diff --git a/gdb-rhbz881849-ipv6-1of2.patch b/gdb-rhbz881849-ipv6-1of3.patch similarity index 99% rename from gdb-rhbz881849-ipv6-1of2.patch rename to gdb-rhbz881849-ipv6-1of3.patch index 50510c8..7c3a664 100644 --- a/gdb-rhbz881849-ipv6-1of2.patch +++ b/gdb-rhbz881849-ipv6-1of3.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-1of2.patch +Subject: gdb-rhbz881849-ipv6-1of3.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 deleted file mode 100644 index 339c966..0000000 --- a/gdb-rhbz881849-ipv6-2of2.patch +++ /dev/null @@ -1,63 +0,0 @@ -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 new file mode 100644 index 0000000..390be0f --- /dev/null +++ b/gdb-rhbz881849-ipv6-2of3.patch @@ -0,0 +1,54 @@ +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 new file mode 100644 index 0000000..789cb18 --- /dev/null +++ b/gdb-rhbz881849-ipv6-3of3.patch @@ -0,0 +1,72 @@ +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 7db6f72..6f3872a 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: 39%{?dist} +Release: 40%{?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,14 +169,11 @@ Source5: %{libstdcxxpython}.tar.xz Source6: gdbtui # libipt: Intel Processor Trace Decoder Library -%global libipt_version 1.6.1 +%global libipt_version 2.0 #=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 @@ -415,7 +412,6 @@ tar xzf %{SOURCE7} ( cd processor-trace-%{libipt_version} %patch1142 -p1 -%patch1171 -p1 ) %endif @@ -1026,6 +1022,11 @@ 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 193c57d..5d8b853 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 477b6c4..6599445 100644 --- a/v1.5-libipt-static.patch +++ b/v1.5-libipt-static.patch @@ -1,6 +1,8 @@ ---- 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) +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) set(LIBIPT_FILES ${LIBIPT_FILES} ${LIBIPT_SECTION_FILES}) @@ -9,8 +11,10 @@ ${LIBIPT_FILES} ) ---- 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 +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 @@ -29,7 +29,7 @@ #include "pt_ild.h" diff --git a/v1.6.1-implicit-fallthrough.patch b/v1.6.1-implicit-fallthrough.patch deleted file mode 100644 index db844d3..0000000 --- a/v1.6.1-implicit-fallthrough.patch +++ /dev/null @@ -1,23 +0,0 @@ -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; From c26726c3ff7cc1e77a92867a28a1cb9fd76f83ae Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 8 Aug 2018 16:27:05 -0400 Subject: [PATCH 20/35] Revert "Rebuild due to new libipt release." This reverts commit 76ddc56b6d88fe6d25622d1c4937491491fa1dc0. --- .gitignore | 2 +- _gdb.spec.Patch.include | 9 +-- _gdb.spec.patch.include | 1 - _patch_order | 5 +- ...f3.patch => gdb-rhbz881849-ipv6-1of2.patch | 2 +- gdb-rhbz881849-ipv6-2of2.patch | 63 ++++++++++++++++ gdb-rhbz881849-ipv6-2of3.patch | 54 -------------- gdb-rhbz881849-ipv6-3of3.patch | 72 ------------------- gdb.spec | 13 ++-- sources | 2 +- v1.5-libipt-static.patch | 14 ++-- v1.6.1-implicit-fallthrough.patch | 23 ++++++ 12 files changed, 105 insertions(+), 155 deletions(-) rename gdb-rhbz881849-ipv6-1of3.patch => gdb-rhbz881849-ipv6-1of2.patch (99%) create mode 100644 gdb-rhbz881849-ipv6-2of2.patch delete mode 100644 gdb-rhbz881849-ipv6-2of3.patch delete mode 100644 gdb-rhbz881849-ipv6-3of3.patch create mode 100644 v1.6.1-implicit-fallthrough.patch 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; From 657623c611905abe139c64350d062dabd15e2771 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 8 Aug 2018 16:28:40 -0400 Subject: [PATCH 21/35] Temporarily disable libipt (needed to upgrade libipt to 2.0). --- gdb.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gdb.spec b/gdb.spec index 7db6f72..e03b7cf 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: 39%{?dist} +Release: 40%{?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 @@ -237,7 +237,7 @@ BuildRequires: guile-devel%{buildisa} %if 0%{?el7:1} && 0%{?scl:1} BuildRequires: cmake %else -BuildRequires: libipt-devel%{buildisa} +#BuildRequires: libipt-devel%{buildisa} %endif %endif %endif @@ -608,7 +608,7 @@ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \ --disable-inprocess-agent \ %endif --with-system-zlib \ -%if %{have_libipt} +%if 0 && %{have_libipt} --with-intel-pt \ %else --without-intel-pt \ @@ -1026,6 +1026,9 @@ fi %endif %changelog +* Wed Aug 8 2018 Sergio Durigan Junior - 8.1.90.20180727-40.fc29 +- Temporarily disable libipt (needed to upgrade libipt to 2.0). + * 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 . From f774761950008e9d9b0aab80044f135191b1e63c Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 8 Aug 2018 15:04:49 -0400 Subject: [PATCH 22/35] Reenable libipt. Rebuild due to new libipt release. Adjust bundled libipt; remove unnecessary patch. Sync IPv6 patch with F-28 GDB. --- .gitignore | 2 +- _gdb.spec.Patch.include | 9 ++- _gdb.spec.patch.include | 1 + _patch_order | 5 +- ...f2.patch => gdb-rhbz881849-ipv6-1of3.patch | 2 +- gdb-rhbz881849-ipv6-2of2.patch | 63 ---------------- gdb-rhbz881849-ipv6-2of3.patch | 54 ++++++++++++++ gdb-rhbz881849-ipv6-3of3.patch | 72 +++++++++++++++++++ gdb.spec | 18 ++--- sources | 2 +- v1.5-libipt-static.patch | 14 ++-- v1.6.1-implicit-fallthrough.patch | 23 ------ 12 files changed, 158 insertions(+), 107 deletions(-) rename gdb-rhbz881849-ipv6-1of2.patch => gdb-rhbz881849-ipv6-1of3.patch (99%) delete mode 100644 gdb-rhbz881849-ipv6-2of2.patch create mode 100644 gdb-rhbz881849-ipv6-2of3.patch create mode 100644 gdb-rhbz881849-ipv6-3of3.patch delete mode 100644 v1.6.1-implicit-fallthrough.patch diff --git a/.gitignore b/.gitignore index 0abe58a..949c204 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 8ba0e48..946c4af 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -505,8 +505,11 @@ 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-1of2.patch +Patch122: gdb-rhbz881849-ipv6-1of3.patch -# Implement IPv6 support for GDB/gdbserver (RH BZ 881849, Sergio Durigan Junior). -Patch123: gdb-rhbz881849-ipv6-2of2.patch + +Patch123: gdb-rhbz881849-ipv6-2of3.patch + + +Patch124: gdb-rhbz881849-ipv6-3of3.patch diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include index 27a39b7..97f12c4 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -121,3 +121,4 @@ %patch121 -p1 %patch122 -p1 %patch123 -p1 +%patch124 -p1 diff --git a/_patch_order b/_patch_order index 11b4131..b10536c 100644 --- a/_patch_order +++ b/_patch_order @@ -119,5 +119,6 @@ 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-1of2.patch -gdb-rhbz881849-ipv6-2of2.patch +gdb-rhbz881849-ipv6-1of3.patch +gdb-rhbz881849-ipv6-2of3.patch +gdb-rhbz881849-ipv6-3of3.patch diff --git a/gdb-rhbz881849-ipv6-1of2.patch b/gdb-rhbz881849-ipv6-1of3.patch similarity index 99% rename from gdb-rhbz881849-ipv6-1of2.patch rename to gdb-rhbz881849-ipv6-1of3.patch index 50510c8..7c3a664 100644 --- a/gdb-rhbz881849-ipv6-1of2.patch +++ b/gdb-rhbz881849-ipv6-1of3.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-1of2.patch +Subject: gdb-rhbz881849-ipv6-1of3.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 deleted file mode 100644 index 339c966..0000000 --- a/gdb-rhbz881849-ipv6-2of2.patch +++ /dev/null @@ -1,63 +0,0 @@ -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 new file mode 100644 index 0000000..390be0f --- /dev/null +++ b/gdb-rhbz881849-ipv6-2of3.patch @@ -0,0 +1,54 @@ +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 new file mode 100644 index 0000000..789cb18 --- /dev/null +++ b/gdb-rhbz881849-ipv6-3of3.patch @@ -0,0 +1,72 @@ +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 e03b7cf..1c6d868 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: 41%{?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,14 +169,11 @@ Source5: %{libstdcxxpython}.tar.xz Source6: gdbtui # libipt: Intel Processor Trace Decoder Library -%global libipt_version 1.6.1 +%global libipt_version 2.0 #=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 @@ -237,7 +234,7 @@ BuildRequires: guile-devel%{buildisa} %if 0%{?el7:1} && 0%{?scl:1} BuildRequires: cmake %else -#BuildRequires: libipt-devel%{buildisa} +BuildRequires: libipt-devel%{buildisa} %endif %endif %endif @@ -415,7 +412,6 @@ tar xzf %{SOURCE7} ( cd processor-trace-%{libipt_version} %patch1142 -p1 -%patch1171 -p1 ) %endif @@ -608,7 +604,7 @@ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \ --disable-inprocess-agent \ %endif --with-system-zlib \ -%if 0 && %{have_libipt} +%if %{have_libipt} --with-intel-pt \ %else --without-intel-pt \ @@ -1026,6 +1022,12 @@ fi %endif %changelog +* Wed Aug 8 2018 Sergio Durigan Junior - 8.1.90.20180727-41.fc29 +- Reenable libipt. +- Rebuild due to new libipt release. +- Adjust bundled libipt; remove unnecessary patch. +- Sync IPv6 patch with F-28 GDB. + * Wed Aug 8 2018 Sergio Durigan Junior - 8.1.90.20180727-40.fc29 - Temporarily disable libipt (needed to upgrade libipt to 2.0). diff --git a/sources b/sources index 193c57d..5d8b853 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 477b6c4..6599445 100644 --- a/v1.5-libipt-static.patch +++ b/v1.5-libipt-static.patch @@ -1,6 +1,8 @@ ---- 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) +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) set(LIBIPT_FILES ${LIBIPT_FILES} ${LIBIPT_SECTION_FILES}) @@ -9,8 +11,10 @@ ${LIBIPT_FILES} ) ---- 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 +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 @@ -29,7 +29,7 @@ #include "pt_ild.h" diff --git a/v1.6.1-implicit-fallthrough.patch b/v1.6.1-implicit-fallthrough.patch deleted file mode 100644 index db844d3..0000000 --- a/v1.6.1-implicit-fallthrough.patch +++ /dev/null @@ -1,23 +0,0 @@ -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; From b9ce1a28337f2699fe10f0cf134bf08c7d8fe8d3 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 8 Aug 2018 18:33:33 -0400 Subject: [PATCH 23/35] Again, temporarily disable libipt (needed to upgrade libipt to 2.0). --- gdb.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gdb.spec b/gdb.spec index 1c6d868..2735b3c 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: 41%{?dist} +Release: 42%{?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 @@ -234,7 +234,7 @@ BuildRequires: guile-devel%{buildisa} %if 0%{?el7:1} && 0%{?scl:1} BuildRequires: cmake %else -BuildRequires: libipt-devel%{buildisa} +#BuildRequires: libipt-devel%{buildisa} %endif %endif %endif @@ -604,7 +604,7 @@ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \ --disable-inprocess-agent \ %endif --with-system-zlib \ -%if %{have_libipt} +%if 0 && %{have_libipt} --with-intel-pt \ %else --without-intel-pt \ @@ -1022,6 +1022,9 @@ fi %endif %changelog +* Wed Aug 8 2018 Sergio Durigan Junior - 8.1.90.20180727-42.fc29 +- Again, temporarily disable libipt (needed to upgrade libipt to 2.0). + * Wed Aug 8 2018 Sergio Durigan Junior - 8.1.90.20180727-41.fc29 - Reenable libipt. - Rebuild due to new libipt release. From af8b9991347d824d574192154eb17949832f46cd Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Thu, 9 Aug 2018 00:50:25 -0400 Subject: [PATCH 24/35] Reenable libipt. --- gdb.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gdb.spec b/gdb.spec index 2735b3c..4271cff 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: 42%{?dist} +Release: 43%{?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 @@ -234,7 +234,7 @@ BuildRequires: guile-devel%{buildisa} %if 0%{?el7:1} && 0%{?scl:1} BuildRequires: cmake %else -#BuildRequires: libipt-devel%{buildisa} +BuildRequires: libipt-devel%{buildisa} %endif %endif %endif @@ -604,7 +604,7 @@ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \ --disable-inprocess-agent \ %endif --with-system-zlib \ -%if 0 && %{have_libipt} +%if %{have_libipt} --with-intel-pt \ %else --without-intel-pt \ @@ -1022,6 +1022,9 @@ fi %endif %changelog +* Thu Aug 9 2018 Sergio Durigan Junior - 8.1.90.20180727-43.fc29 +- Reenable libipt. + * Wed Aug 8 2018 Sergio Durigan Junior - 8.1.90.20180727-42.fc29 - Again, temporarily disable libipt (needed to upgrade libipt to 2.0). From 22998d94f750fbba57ca3ddf5648ae2b772366ee Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 9 Aug 2018 18:37:55 +0200 Subject: [PATCH 25/35] Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). --- _gdb.spec.Patch.include | 21 ++ _gdb.spec.patch.include | 7 + _patch_order | 7 + gdb-rhbz1187581-power8-regs-1of7.patch | 65 ++++ gdb-rhbz1187581-power8-regs-2of7.patch | 45 +++ gdb-rhbz1187581-power8-regs-3of7.patch | 258 ++++++++++++++ gdb-rhbz1187581-power8-regs-4of7.patch | 449 +++++++++++++++++++++++++ gdb-rhbz1187581-power8-regs-5of7.patch | 215 ++++++++++++ gdb-rhbz1187581-power8-regs-6of7.patch | 187 ++++++++++ gdb-rhbz1187581-power8-regs-7of7.patch | 129 +++++++ gdb.spec | 5 +- 11 files changed, 1387 insertions(+), 1 deletion(-) create mode 100644 gdb-rhbz1187581-power8-regs-1of7.patch create mode 100644 gdb-rhbz1187581-power8-regs-2of7.patch create mode 100644 gdb-rhbz1187581-power8-regs-3of7.patch create mode 100644 gdb-rhbz1187581-power8-regs-4of7.patch create mode 100644 gdb-rhbz1187581-power8-regs-5of7.patch create mode 100644 gdb-rhbz1187581-power8-regs-6of7.patch create mode 100644 gdb-rhbz1187581-power8-regs-7of7.patch diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include index 946c4af..b3c5633 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -513,3 +513,24 @@ Patch123: gdb-rhbz881849-ipv6-2of3.patch Patch124: gdb-rhbz881849-ipv6-3of3.patch +# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). +Patch125: gdb-rhbz1187581-power8-regs-1of7.patch + +# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). +Patch126: gdb-rhbz1187581-power8-regs-2of7.patch + +# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). +Patch127: gdb-rhbz1187581-power8-regs-3of7.patch + +# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). +Patch128: gdb-rhbz1187581-power8-regs-4of7.patch + +# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). +Patch129: gdb-rhbz1187581-power8-regs-5of7.patch + +# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). +Patch130: gdb-rhbz1187581-power8-regs-6of7.patch + +# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). +Patch131: gdb-rhbz1187581-power8-regs-7of7.patch + diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include index 97f12c4..ca390b7 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -122,3 +122,10 @@ %patch122 -p1 %patch123 -p1 %patch124 -p1 +%patch125 -p1 +%patch126 -p1 +%patch127 -p1 +%patch128 -p1 +%patch129 -p1 +%patch130 -p1 +%patch131 -p1 diff --git a/_patch_order b/_patch_order index b10536c..ec2f86f 100644 --- a/_patch_order +++ b/_patch_order @@ -122,3 +122,10 @@ gdb-rhbz1553104-s390x-arch12-test.patch gdb-rhbz881849-ipv6-1of3.patch gdb-rhbz881849-ipv6-2of3.patch gdb-rhbz881849-ipv6-3of3.patch +gdb-rhbz1187581-power8-regs-1of7.patch +gdb-rhbz1187581-power8-regs-2of7.patch +gdb-rhbz1187581-power8-regs-3of7.patch +gdb-rhbz1187581-power8-regs-4of7.patch +gdb-rhbz1187581-power8-regs-5of7.patch +gdb-rhbz1187581-power8-regs-6of7.patch +gdb-rhbz1187581-power8-regs-7of7.patch diff --git a/gdb-rhbz1187581-power8-regs-1of7.patch b/gdb-rhbz1187581-power8-regs-1of7.patch new file mode 100644 index 0000000..29bd798 --- /dev/null +++ b/gdb-rhbz1187581-power8-regs-1of7.patch @@ -0,0 +1,65 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Jan Kratochvil +Date: Thu, 9 Aug 2018 17:09:48 +0200 +Subject: gdb-rhbz1187581-power8-regs-1of7.patch + +;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). + +commit 05abfc39c719e740530000059bb963ad33462479 +Author: Pedro Franco de Carvalho +Date: Mon Aug 6 16:24:55 2018 -0300 + + Fix indentation in remote_target::download_tracepoint + + gdb/ChangeLog: + 2018-08-06 Pedro Franco de Carvalho + + * remote.c (remote_target::download_tracepoint): Fix indentation + in for block. + +diff --git a/gdb/remote.c b/gdb/remote.c +--- a/gdb/remote.c ++++ b/gdb/remote.c +@@ -12912,24 +12912,24 @@ remote_target::download_tracepoint (struct bp_location *loc) + error (_("Error on target while setting tracepoints.")); + } + +- for (auto action_it = stepping_actions.begin (); +- action_it != stepping_actions.end (); action_it++) +- { +- QUIT; /* Allow user to bail out with ^C. */ +- +- bool is_first = action_it == stepping_actions.begin (); +- bool has_more = action_it != stepping_actions.end (); +- +- xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s", +- b->number, addrbuf, /* address */ +- is_first ? "S" : "", +- action_it->c_str (), +- has_more ? "-" : ""); +- putpkt (buf); +- remote_get_noisy_reply (); +- if (strcmp (rs->buf, "OK")) +- error (_("Error on target while setting tracepoints.")); +- } ++ for (auto action_it = stepping_actions.begin (); ++ action_it != stepping_actions.end (); action_it++) ++ { ++ QUIT; /* Allow user to bail out with ^C. */ ++ ++ bool is_first = action_it == stepping_actions.begin (); ++ bool has_more = action_it != stepping_actions.end (); ++ ++ xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s", ++ b->number, addrbuf, /* address */ ++ is_first ? "S" : "", ++ action_it->c_str (), ++ has_more ? "-" : ""); ++ putpkt (buf); ++ remote_get_noisy_reply (); ++ if (strcmp (rs->buf, "OK")) ++ error (_("Error on target while setting tracepoints.")); ++ } + + if (packet_support (PACKET_TracepointSource) == PACKET_ENABLE) + { diff --git a/gdb-rhbz1187581-power8-regs-2of7.patch b/gdb-rhbz1187581-power8-regs-2of7.patch new file mode 100644 index 0000000..b0d42cd --- /dev/null +++ b/gdb-rhbz1187581-power8-regs-2of7.patch @@ -0,0 +1,45 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Jan Kratochvil +Date: Thu, 9 Aug 2018 17:10:46 +0200 +Subject: gdb-rhbz1187581-power8-regs-2of7.patch + +;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). + +commit aa6f3694ce867884e43d1c0406c64df08ea24bd3 +Author: Pedro Franco de Carvalho +Date: Mon Aug 6 16:24:55 2018 -0300 + + Remove trailing '-' from the last QTDP action packet + + The has_more predicate in remote_target::download_tracepoint always + evaluates to true, so the last action packet will be sent with a + trailing '-'. This patch changes the predicate to remove the last + trailing '-'. + + gdb/ChangeLog: + 2018-08-06 Pedro Franco de Carvalho + + * remote.c (remote_target::download_tracepoint): Fix the has_more + predicate in the QTDP action list iteration. + +diff --git a/gdb/remote.c b/gdb/remote.c +--- a/gdb/remote.c ++++ b/gdb/remote.c +@@ -12899,7 +12899,7 @@ remote_target::download_tracepoint (struct bp_location *loc) + { + QUIT; /* Allow user to bail out with ^C. */ + +- bool has_more = (action_it != tdp_actions.end () ++ bool has_more = ((action_it + 1) != tdp_actions.end () + || !stepping_actions.empty ()); + + xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%c", +@@ -12918,7 +12918,7 @@ remote_target::download_tracepoint (struct bp_location *loc) + QUIT; /* Allow user to bail out with ^C. */ + + bool is_first = action_it == stepping_actions.begin (); +- bool has_more = action_it != stepping_actions.end (); ++ bool has_more = (action_it + 1) != stepping_actions.end (); + + xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s", + b->number, addrbuf, /* address */ diff --git a/gdb-rhbz1187581-power8-regs-3of7.patch b/gdb-rhbz1187581-power8-regs-3of7.patch new file mode 100644 index 0000000..5546f2b --- /dev/null +++ b/gdb-rhbz1187581-power8-regs-3of7.patch @@ -0,0 +1,258 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Jan Kratochvil +Date: Thu, 9 Aug 2018 17:11:09 +0200 +Subject: gdb-rhbz1187581-power8-regs-3of7.patch + +;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). + +commit 3df3a985a475db004706d64f83d9085f99053611 +Author: Pedro Franco de Carvalho +Date: Mon Aug 6 16:24:55 2018 -0300 + + Use get_remote_packet_size in download_tracepoint + + This patch changes the remote target to use the remote packet size to + build QTDP packets, and to check if there is enough room for the + packet. + + I changed the function to raise an error if the packet is too small, + instead of aborting gdb (through xsnprintf). It isn't clear if gdb + will be in a consistent state with respect to the stub after this, + since it's possible that some packets will be sent but not others, and + there could be an incomplete tracepoint on the stub. + + The char array used to build the packets is changed to a + gdb::char_vector and sized with the result from + get_remote_packet_size. + + When checking if the buffer is large enough to hold the tracepoint + condition agent expression, the length of the expression is multiplied + by two, since it is encoded with two hex digits per expression + byte. For simplicity, I assume that the result won't overflow, which + can happen for very long condition expressions. + + gdb/ChangeLog: + 2018-08-06 Pedro Franco de Carvalho + + * remote.c (remote_target::download_tracepoint): Remove BUF_SIZE. + Replace array buf with gdb::char_vector buf, of size + get_remote_packet_size (). Replace references to buf and + BUF_SIZE to buf.data () and buf.size (). Replace strcpy, strcat + and xsnprintf with snprintf. Raise errors if the buffer is too + small. + +diff --git a/gdb/remote.c b/gdb/remote.c +--- a/gdb/remote.c ++++ b/gdb/remote.c +@@ -12799,26 +12799,35 @@ remote_target::remote_download_command_source (int num, ULONGEST addr, + void + remote_target::download_tracepoint (struct bp_location *loc) + { +-#define BUF_SIZE 2048 +- + CORE_ADDR tpaddr; + char addrbuf[40]; +- char buf[BUF_SIZE]; + std::vector tdp_actions; + std::vector stepping_actions; + char *pkt; + struct breakpoint *b = loc->owner; + struct tracepoint *t = (struct tracepoint *) b; + struct remote_state *rs = get_remote_state (); ++ int ret; ++ char *err_msg = _("Tracepoint packet too large for target."); ++ size_t size_left; ++ ++ /* We use a buffer other than rs->buf because we'll build strings ++ across multiple statements, and other statements in between could ++ modify rs->buf. */ ++ gdb::char_vector buf (get_remote_packet_size ()); + + encode_actions_rsp (loc, &tdp_actions, &stepping_actions); + + tpaddr = loc->address; + sprintf_vma (addrbuf, tpaddr); +- xsnprintf (buf, BUF_SIZE, "QTDP:%x:%s:%c:%lx:%x", b->number, +- addrbuf, /* address */ +- (b->enable_state == bp_enabled ? 'E' : 'D'), +- t->step_count, t->pass_count); ++ ret = snprintf (buf.data (), buf.size (), "QTDP:%x:%s:%c:%lx:%x", ++ b->number, addrbuf, /* address */ ++ (b->enable_state == bp_enabled ? 'E' : 'D'), ++ t->step_count, t->pass_count); ++ ++ if (ret < 0 || ret >= buf.size ()) ++ error (err_msg); ++ + /* Fast tracepoints are mostly handled by the target, but we can + tell the target how big of an instruction block should be moved + around. */ +@@ -12830,8 +12839,15 @@ remote_target::download_tracepoint (struct bp_location *loc) + { + if (gdbarch_fast_tracepoint_valid_at (loc->gdbarch, tpaddr, + NULL)) +- xsnprintf (buf + strlen (buf), BUF_SIZE - strlen (buf), ":F%x", +- gdb_insn_length (loc->gdbarch, tpaddr)); ++ { ++ size_left = buf.size () - strlen (buf.data ()); ++ ret = snprintf (buf.data () + strlen (buf.data ()), ++ size_left, ":F%x", ++ gdb_insn_length (loc->gdbarch, tpaddr)); ++ ++ if (ret < 0 || ret >= size_left) ++ error (err_msg); ++ } + else + /* If it passed validation at definition but fails now, + something is very wrong. */ +@@ -12855,7 +12871,14 @@ remote_target::download_tracepoint (struct bp_location *loc) + struct static_tracepoint_marker marker; + + if (target_static_tracepoint_marker_at (tpaddr, &marker)) +- strcat (buf, ":S"); ++ { ++ size_left = buf.size () - strlen (buf.data ()); ++ ret = snprintf (buf.data () + strlen (buf.data ()), ++ size_left, ":S"); ++ ++ if (ret < 0 || ret >= size_left) ++ error (err_msg); ++ } + else + error (_("Static tracepoint not valid during download")); + } +@@ -12873,10 +12896,26 @@ remote_target::download_tracepoint (struct bp_location *loc) + capabilities at definition time. */ + if (remote_supports_cond_tracepoints ()) + { +- agent_expr_up aexpr = gen_eval_for_expr (tpaddr, loc->cond.get ()); +- xsnprintf (buf + strlen (buf), BUF_SIZE - strlen (buf), ":X%x,", +- aexpr->len); +- pkt = buf + strlen (buf); ++ agent_expr_up aexpr = gen_eval_for_expr (tpaddr, ++ loc->cond.get ()); ++ ++ size_left = buf.size () - strlen (buf.data ()); ++ ++ ret = snprintf (buf.data () + strlen (buf.data ()), ++ size_left, ":X%x,", aexpr->len); ++ ++ if (ret < 0 || ret >= size_left) ++ error (err_msg); ++ ++ size_left = buf.size () - strlen (buf.data ()); ++ ++ /* Two bytes to encode each aexpr byte, plus the terminating ++ null byte. */ ++ if (aexpr->len * 2 + 1 > size_left) ++ error (err_msg); ++ ++ pkt = buf.data () + strlen (buf.data ()); ++ + for (int ndx = 0; ndx < aexpr->len; ++ndx) + pkt = pack_hex_byte (pkt, aexpr->buf[ndx]); + *pkt = '\0'; +@@ -12887,8 +12926,17 @@ remote_target::download_tracepoint (struct bp_location *loc) + } + + if (b->commands || *default_collect) +- strcat (buf, "-"); +- putpkt (buf); ++ { ++ size_left = buf.size () - strlen (buf.data ()); ++ ++ ret = snprintf (buf.data () + strlen (buf.data ()), ++ size_left, "-"); ++ ++ if (ret < 0 || ret >= size_left) ++ error (err_msg); ++ } ++ ++ putpkt (buf.data ()); + remote_get_noisy_reply (); + if (strcmp (rs->buf, "OK")) + error (_("Target does not support tracepoints.")); +@@ -12902,11 +12950,15 @@ remote_target::download_tracepoint (struct bp_location *loc) + bool has_more = ((action_it + 1) != tdp_actions.end () + || !stepping_actions.empty ()); + +- xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%c", +- b->number, addrbuf, /* address */ +- action_it->c_str (), +- has_more ? '-' : 0); +- putpkt (buf); ++ ret = snprintf (buf.data (), buf.size (), "QTDP:-%x:%s:%s%c", ++ b->number, addrbuf, /* address */ ++ action_it->c_str (), ++ has_more ? '-' : 0); ++ ++ if (ret < 0 || ret >= buf.size ()) ++ error (err_msg); ++ ++ putpkt (buf.data ()); + remote_get_noisy_reply (); + if (strcmp (rs->buf, "OK")) + error (_("Error on target while setting tracepoints.")); +@@ -12920,12 +12972,16 @@ remote_target::download_tracepoint (struct bp_location *loc) + bool is_first = action_it == stepping_actions.begin (); + bool has_more = (action_it + 1) != stepping_actions.end (); + +- xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s", +- b->number, addrbuf, /* address */ +- is_first ? "S" : "", +- action_it->c_str (), +- has_more ? "-" : ""); +- putpkt (buf); ++ ret = snprintf (buf.data (), buf.size (), "QTDP:-%x:%s:%s%s%s", ++ b->number, addrbuf, /* address */ ++ is_first ? "S" : "", ++ action_it->c_str (), ++ has_more ? "-" : ""); ++ ++ if (ret < 0 || ret >= buf.size ()) ++ error (err_msg); ++ ++ putpkt (buf.data ()); + remote_get_noisy_reply (); + if (strcmp (rs->buf, "OK")) + error (_("Error on target while setting tracepoints.")); +@@ -12935,22 +12991,32 @@ remote_target::download_tracepoint (struct bp_location *loc) + { + if (b->location != NULL) + { +- strcpy (buf, "QTDPsrc:"); ++ ret = snprintf (buf.data (), buf.size (), "QTDPsrc:"); ++ ++ if (ret < 0 || ret >= buf.size ()) ++ error (err_msg); ++ + encode_source_string (b->number, loc->address, "at", + event_location_to_string (b->location.get ()), +- buf + strlen (buf), 2048 - strlen (buf)); +- putpkt (buf); ++ buf.data () + strlen (buf.data ()), ++ buf.size () - strlen (buf.data ())); ++ putpkt (buf.data ()); + remote_get_noisy_reply (); + if (strcmp (rs->buf, "OK")) + warning (_("Target does not support source download.")); + } + if (b->cond_string) + { +- strcpy (buf, "QTDPsrc:"); ++ ret = snprintf (buf.data (), buf.size (), "QTDPsrc:"); ++ ++ if (ret < 0 || ret >= buf.size ()) ++ error (err_msg); ++ + encode_source_string (b->number, loc->address, +- "cond", b->cond_string, buf + strlen (buf), +- 2048 - strlen (buf)); +- putpkt (buf); ++ "cond", b->cond_string, ++ buf.data () + strlen (buf.data ()), ++ buf.size () - strlen (buf.data ())); ++ putpkt (buf.data ()); + remote_get_noisy_reply (); + if (strcmp (rs->buf, "OK")) + warning (_("Target does not support source download.")); diff --git a/gdb-rhbz1187581-power8-regs-4of7.patch b/gdb-rhbz1187581-power8-regs-4of7.patch new file mode 100644 index 0000000..8c553a8 --- /dev/null +++ b/gdb-rhbz1187581-power8-regs-4of7.patch @@ -0,0 +1,449 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Jan Kratochvil +Date: Thu, 9 Aug 2018 17:17:16 +0200 +Subject: gdb-rhbz1187581-power8-regs-4of7.patch + +;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). + +commit 4277c4b87addb5354cc47b98d7a73e44cfaf22c2 +Author: Pedro Franco de Carvalho +Date: Mon Aug 6 16:24:55 2018 -0300 + + Use remote register numbers in tracepoint mask + + Currently, tracepoint register masks in the QTDP packets include both + internal and remote register numbers, as well as pseudo-register + numbers. + + This patch changes this so that the mask only includes remote register + numbers. + + Register numbers from agent expressions are already set in the mask + using remote numbers. Other tracepoint actions used internal numbers, + e.g. "collect $regs" or "collect $". To handle pseudoreg + numbers, an empty agent expression is created and ax_reg_mask is + called for this expression and the pseudoreg. This will cause the ax + to set its mask with the corresponding remote raw register + numbers (using ax_regs_mask, which calls + gdbarch_ax_pseudo_register_collect). + + If ax_regs_mask and gdbarch_ax_pseudo_register_collect also generate + more ax bytecode, the ax is also appended to the collection list. It + isn't clear that this was the original intent for + gdbarch_ax_pseudo_register_collect, and none of the arches seem to do + this, but if this changes in the future, it should work. + + The patch also refactors the code used by validate_action line to + validate axs into a function that is now called from every place that + generates axs. Previously, some parts of tracepoint.c that generated + axs didn't check if the ax length was greater than MAX_AGENT_EXPR_LEN. + + gdb/ChangeLog: + 2018-08-06 Pedro Franco de Carvalho + + * tracepoint.h (class collection_list) : Remove. + : + Declare. + : Add scope parameter. + * tracepoint.c (encode_actions_1): Likewise. + (collection_list::add_register): Rename to ... + (collection_list::add_remote_register): ... this. Update + comment. + (collection_list::add_ax_registers, add_local_register): New + methods. + (collection_list::add_memrange): Add scope parameter. Call + add_local_register instead of add_register. + (finalize_tracepoint_aexpr): New function. + (collection_list::collect_symbol): Update calls to add_memrange. + Call add_local_register instead of add_register. Call + add_ax_registers. Call finalize_tracepoint_aexpr. + (encode_actions_1): Get remote regnos for $reg action. Call + add_remote_register, add_ax_registers, and add_local_register. + Update call to add_memrange. Call finalize_tracepoint_aexpr. + (validate_actionline): Call finalize_tracepoint_aexpr. + ++2018-08-06 Pedro Franco de Carvalho ++ ++ * tracepoint.h (class collection_list) : Remove. ++ : ++ Declare. ++ : Add scope parameter. ++ * tracepoint.c (encode_actions_1): Likewise. ++ (collection_list::add_register): Rename to ... ++ (collection_list::add_remote_register): ... this. Update ++ comment. ++ (collection_list::add_ax_registers, add_local_register): New ++ methods. ++ (collection_list::add_memrange): Add scope parameter. Call ++ add_local_register instead of add_register. ++ (finalize_tracepoint_aexpr): New function. ++ (collection_list::collect_symbol): Update calls to add_memrange. ++ Call add_local_register instead of add_register. Call ++ add_ax_registers. Call finalize_tracepoint_aexpr. ++ (encode_actions_1): Get remote regnos for $reg action. Call ++ add_remote_register, add_ax_registers, and add_local_register. ++ Update call to add_memrange. Call finalize_tracepoint_aexpr. ++ (validate_actionline): Call finalize_tracepoint_aexpr. ++ + 2018-08-06 Pedro Franco de Carvalho + + * remote.c (remote_target::download_tracepoint): Remove BUF_SIZE. + +diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c +--- a/gdb/tracepoint.c ++++ b/gdb/tracepoint.c +@@ -615,6 +615,19 @@ report_agent_reqs_errors (struct agent_expr *aexpr) + error (_("Expression is too complicated.")); + } + ++/* Call ax_reqs on AEXPR and raise an error if something is wrong. */ ++ ++static void ++finalize_tracepoint_aexpr (struct agent_expr *aexpr) ++{ ++ ax_reqs (aexpr); ++ ++ if (aexpr->len > MAX_AGENT_EXPR_LEN) ++ error (_("Expression is too complicated.")); ++ ++ report_agent_reqs_errors (aexpr); ++} ++ + /* worker function */ + void + validate_actionline (const char *line, struct breakpoint *b) +@@ -699,12 +712,7 @@ validate_actionline (const char *line, struct breakpoint *b) + exp.get (), + trace_string); + +- if (aexpr->len > MAX_AGENT_EXPR_LEN) +- error (_("Expression is too complicated.")); +- +- ax_reqs (aexpr.get ()); +- +- report_agent_reqs_errors (aexpr.get ()); ++ finalize_tracepoint_aexpr (aexpr.get ()); + } + } + while (p && *p++ == ','); +@@ -731,11 +739,7 @@ validate_actionline (const char *line, struct breakpoint *b) + long. */ + agent_expr_up aexpr = gen_eval_for_expr (loc->address, exp.get ()); + +- if (aexpr->len > MAX_AGENT_EXPR_LEN) +- error (_("Expression is too complicated.")); +- +- ax_reqs (aexpr.get ()); +- report_agent_reqs_errors (aexpr.get ()); ++ finalize_tracepoint_aexpr (aexpr.get ()); + } + } + while (p && *p++ == ','); +@@ -811,10 +815,10 @@ memrange_sortmerge (std::vector &memranges) + } + } + +-/* Add a register to a collection list. */ ++/* Add remote register number REGNO to the collection list mask. */ + + void +-collection_list::add_register (unsigned int regno) ++collection_list::add_remote_register (unsigned int regno) + { + if (info_verbose) + printf_filtered ("collect register %d\n", regno); +@@ -824,12 +828,74 @@ collection_list::add_register (unsigned int regno) + m_regs_mask[regno / 8] |= 1 << (regno % 8); + } + ++/* Add all the registers from the mask in AEXPR to the mask in the ++ collection list. Registers in the AEXPR mask are already remote ++ register numbers. */ ++ ++void ++collection_list::add_ax_registers (struct agent_expr *aexpr) ++{ ++ if (aexpr->reg_mask_len > 0) ++ { ++ for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++) ++ { ++ QUIT; /* Allow user to bail out with ^C. */ ++ if (aexpr->reg_mask[ndx1] != 0) ++ { ++ /* Assume chars have 8 bits. */ ++ for (int ndx2 = 0; ndx2 < 8; ndx2++) ++ if (aexpr->reg_mask[ndx1] & (1 << ndx2)) ++ /* It's used -- record it. */ ++ add_remote_register (ndx1 * 8 + ndx2); ++ } ++ } ++ } ++} ++ ++/* If REGNO is raw, add its corresponding remote register number to ++ the mask. If REGNO is a pseudo-register, figure out the necessary ++ registers using a temporary agent expression, and add it to the ++ list if it needs more than just a mask. */ ++ ++void ++collection_list::add_local_register (struct gdbarch *gdbarch, ++ unsigned int regno, ++ CORE_ADDR scope) ++{ ++ if (regno < gdbarch_num_regs (gdbarch)) ++ { ++ int remote_regno = gdbarch_remote_register_number (gdbarch, regno); ++ ++ if (remote_regno < 0) ++ error (_("Can't collect register %d"), regno); ++ ++ add_remote_register (remote_regno); ++ } ++ else ++ { ++ agent_expr_up aexpr (new agent_expr (gdbarch, scope)); ++ ++ ax_reg_mask (aexpr.get (), regno); ++ ++ finalize_tracepoint_aexpr (aexpr.get ()); ++ ++ add_ax_registers (aexpr.get ()); ++ ++ /* Usually ax_reg_mask for a pseudo-regiser only sets the ++ corresponding raw registers in the ax mask, but if this isn't ++ the case add the expression that is generated to the ++ collection list. */ ++ if (aexpr->len > 0) ++ add_aexpr (std::move (aexpr)); ++ } ++} ++ + /* Add a memrange to a collection list. */ + + void + collection_list::add_memrange (struct gdbarch *gdbarch, + int type, bfd_signed_vma base, +- ULONGEST len) ++ ULONGEST len, CORE_ADDR scope) + { + if (info_verbose) + printf_filtered ("(%d,%s,%s)\n", type, paddress (gdbarch, base), pulongest (len)); +@@ -840,7 +906,7 @@ collection_list::add_memrange (struct gdbarch *gdbarch, + m_memranges.emplace_back (type, base, base + len); + + if (type != memrange_absolute) /* Better collect the base register! */ +- add_register (type); ++ add_local_register (gdbarch, type, scope); + } + + /* Add a symbol to a collection list. */ +@@ -882,19 +948,19 @@ collection_list::collect_symbol (struct symbol *sym, + if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT) + treat_as_expr = 1; + else +- add_memrange (gdbarch, memrange_absolute, offset, len); ++ add_memrange (gdbarch, memrange_absolute, offset, len, scope); + break; + case LOC_REGISTER: + reg = SYMBOL_REGISTER_OPS (sym)->register_number (sym, gdbarch); + if (info_verbose) + printf_filtered ("LOC_REG[parm] %s: ", + SYMBOL_PRINT_NAME (sym)); +- add_register (reg); ++ add_local_register (gdbarch, reg, scope); + /* Check for doubles stored in two registers. */ + /* FIXME: how about larger types stored in 3 or more regs? */ + if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FLT && + len > register_size (gdbarch, reg)) +- add_register (reg + 1); ++ add_local_register (gdbarch, reg + 1, scope); + break; + case LOC_REF_ARG: + printf_filtered ("Sorry, don't know how to do LOC_REF_ARG yet.\n"); +@@ -911,7 +977,7 @@ collection_list::collect_symbol (struct symbol *sym, + SYMBOL_PRINT_NAME (sym), pulongest (len), + paddress (gdbarch, offset), reg); + } +- add_memrange (gdbarch, reg, offset, len); ++ add_memrange (gdbarch, reg, offset, len, scope); + break; + case LOC_REGPARM_ADDR: + reg = SYMBOL_VALUE (sym); +@@ -923,7 +989,7 @@ collection_list::collect_symbol (struct symbol *sym, + SYMBOL_PRINT_NAME (sym), pulongest (len), + paddress (gdbarch, offset), reg); + } +- add_memrange (gdbarch, reg, offset, len); ++ add_memrange (gdbarch, reg, offset, len, scope); + break; + case LOC_LOCAL: + reg = frame_regno; +@@ -935,7 +1001,7 @@ collection_list::collect_symbol (struct symbol *sym, + SYMBOL_PRINT_NAME (sym), pulongest (len), + paddress (gdbarch, offset), reg); + } +- add_memrange (gdbarch, reg, offset, len); ++ add_memrange (gdbarch, reg, offset, len, scope); + break; + + case LOC_UNRESOLVED: +@@ -968,26 +1034,10 @@ collection_list::collect_symbol (struct symbol *sym, + return; + } + +- ax_reqs (aexpr.get ()); +- +- report_agent_reqs_errors (aexpr.get ()); ++ finalize_tracepoint_aexpr (aexpr.get ()); + + /* Take care of the registers. */ +- if (aexpr->reg_mask_len > 0) +- { +- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++) +- { +- QUIT; /* Allow user to bail out with ^C. */ +- if (aexpr->reg_mask[ndx1] != 0) +- { +- /* Assume chars have 8 bits. */ +- for (int ndx2 = 0; ndx2 < 8; ndx2++) +- if (aexpr->reg_mask[ndx1] & (1 << ndx2)) +- /* It's used -- record it. */ +- add_register (ndx1 * 8 + ndx2); +- } +- } +- } ++ add_ax_registers (aexpr.get ()); + + add_aexpr (std::move (aexpr)); + } +@@ -1257,8 +1307,18 @@ encode_actions_1 (struct command_line *action, + + if (0 == strncasecmp ("$reg", action_exp, 4)) + { +- for (i = 0; i < gdbarch_num_regs (target_gdbarch ()); i++) +- collect->add_register (i); ++ for (i = 0; i < gdbarch_num_regs (target_gdbarch ()); ++ i++) ++ { ++ int remote_regno = (gdbarch_remote_register_number ++ (target_gdbarch (), i)); ++ ++ /* Ignore arch regnos without a corresponding ++ remote regno. This can happen for regnos not ++ in the tdesc. */ ++ if (remote_regno >= 0) ++ collect->add_remote_register (remote_regno); ++ } + action_exp = strchr (action_exp, ','); /* more? */ + } + else if (0 == strncasecmp ("$arg", action_exp, 4)) +@@ -1288,27 +1348,10 @@ encode_actions_1 (struct command_line *action, + target_gdbarch (), + trace_string); + +- ax_reqs (aexpr.get ()); +- report_agent_reqs_errors (aexpr.get ()); ++ finalize_tracepoint_aexpr (aexpr.get ()); + + /* take care of the registers */ +- if (aexpr->reg_mask_len > 0) +- { +- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++) +- { +- QUIT; /* allow user to bail out with ^C */ +- if (aexpr->reg_mask[ndx1] != 0) +- { +- /* assume chars have 8 bits */ +- for (int ndx2 = 0; ndx2 < 8; ndx2++) +- if (aexpr->reg_mask[ndx1] & (1 << ndx2)) +- { +- /* It's used -- record it. */ +- collect->add_register (ndx1 * 8 + ndx2); +- } +- } +- } +- } ++ collect->add_ax_registers (aexpr.get ()); + + collect->add_aexpr (std::move (aexpr)); + action_exp = strchr (action_exp, ','); /* more? */ +@@ -1340,7 +1383,8 @@ encode_actions_1 (struct command_line *action, + name); + if (info_verbose) + printf_filtered ("OP_REGISTER: "); +- collect->add_register (i); ++ collect->add_local_register (target_gdbarch (), ++ i, tloc->address); + break; + } + +@@ -1352,7 +1396,8 @@ encode_actions_1 (struct command_line *action, + check_typedef (exp->elts[1].type); + collect->add_memrange (target_gdbarch (), + memrange_absolute, addr, +- TYPE_LENGTH (exp->elts[1].type)); ++ TYPE_LENGTH (exp->elts[1].type), ++ tloc->address); + collect->append_exp (exp.get ()); + break; + +@@ -1376,28 +1421,10 @@ encode_actions_1 (struct command_line *action, + exp.get (), + trace_string); + +- ax_reqs (aexpr.get ()); +- +- report_agent_reqs_errors (aexpr.get ()); ++ finalize_tracepoint_aexpr (aexpr.get ()); + + /* Take care of the registers. */ +- if (aexpr->reg_mask_len > 0) +- { +- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++) +- { +- QUIT; /* Allow user to bail out with ^C. */ +- if (aexpr->reg_mask[ndx1] != 0) +- { +- /* Assume chars have 8 bits. */ +- for (int ndx2 = 0; ndx2 < 8; ndx2++) +- if (aexpr->reg_mask[ndx1] & (1 << ndx2)) +- { +- /* It's used -- record it. */ +- collect->add_register (ndx1 * 8 + ndx2); +- } +- } +- } +- } ++ collect->add_ax_registers (aexpr.get ()); + + collect->add_aexpr (std::move (aexpr)); + collect->append_exp (exp.get ()); +@@ -1422,8 +1449,7 @@ encode_actions_1 (struct command_line *action, + agent_expr_up aexpr = gen_eval_for_expr (tloc->address, + exp.get ()); + +- ax_reqs (aexpr.get ()); +- report_agent_reqs_errors (aexpr.get ()); ++ finalize_tracepoint_aexpr (aexpr.get ()); + + /* Even though we're not officially collecting, add + to the collect list anyway. */ +diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h +--- a/gdb/tracepoint.h ++++ b/gdb/tracepoint.h +@@ -263,9 +263,14 @@ public: + void add_aexpr (agent_expr_up aexpr); + + void add_register (unsigned int regno); ++ void add_remote_register (unsigned int regno); ++ void add_ax_registers (struct agent_expr *aexpr); ++ void add_local_register (struct gdbarch *gdbarch, ++ unsigned int regno, ++ CORE_ADDR scope); + void add_memrange (struct gdbarch *gdbarch, + int type, bfd_signed_vma base, +- ULONGEST len); ++ ULONGEST len, CORE_ADDR scope); + void collect_symbol (struct symbol *sym, + struct gdbarch *gdbarch, + long frame_regno, long frame_offset, diff --git a/gdb-rhbz1187581-power8-regs-5of7.patch b/gdb-rhbz1187581-power8-regs-5of7.patch new file mode 100644 index 0000000..eaca52f --- /dev/null +++ b/gdb-rhbz1187581-power8-regs-5of7.patch @@ -0,0 +1,215 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Jan Kratochvil +Date: Thu, 9 Aug 2018 17:17:46 +0200 +Subject: gdb-rhbz1187581-power8-regs-5of7.patch + +;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). + +commit a04b9d62a234923826e431a209d396a628661548 +Author: Pedro Franco de Carvalho +Date: Mon Aug 6 16:24:55 2018 -0300 + + Variable size for regs mask in collection list + + This patch changes collection_list to allow larger register masks. + + The mask is changed from an array to a vector and is initialized to + hold the maximum possible remote register number. The stringify + method is updated to resize temp_buf if needed. + + gdb/ChangeLog: + 2018-08-06 Pedro Franco de Carvalho + + * tracepoint.h (collection_list) : Change type to + std::vector. + * tracepoint.c (collection_list::collection_list): Remove + m_regs_mask initializer from initializer list. Resize + m_regs_mask using the largest remote register number. + (collection_list::add_remote_register): Remove size check on + m_regs_mask. Use at to access element. + (collection_list::stringify): Change type of temp_buf to + gdb::char_vector. Update uses of temp_buf. Resize if needed to + stringify the register mask. Use pack_hex_byte for the register + mask. + ++2018-08-06 Pedro Franco de Carvalho ++ ++ * tracepoint.h (collection_list) : Change type to ++ std::vector. ++ * tracepoint.c (collection_list::collection_list): Remove ++ m_regs_mask initializer from initializer list. Resize ++ m_regs_mask using the largest remote register number. ++ (collection_list::add_remote_register): Remove size check on ++ m_regs_mask. Use at to access element. ++ (collection_list::stringify): Change type of temp_buf to ++ gdb::char_vector. Update uses of temp_buf. Resize if needed to ++ stringify the register mask. Use pack_hex_byte for the register ++ mask. ++ + 2018-08-06 Pedro Franco de Carvalho + + * tracepoint.h (class collection_list) : Remove. + +diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c +--- a/gdb/tracepoint.c ++++ b/gdb/tracepoint.c +@@ -822,10 +822,8 @@ collection_list::add_remote_register (unsigned int regno) + { + if (info_verbose) + printf_filtered ("collect register %d\n", regno); +- if (regno >= (8 * sizeof (m_regs_mask))) +- error (_("Internal: register number %d too large for tracepoint"), +- regno); +- m_regs_mask[regno / 8] |= 1 << (regno % 8); ++ ++ m_regs_mask.at (regno / 8) |= 1 << (regno % 8); + } + + /* Add all the registers from the mask in AEXPR to the mask in the +@@ -1136,9 +1134,20 @@ collection_list::add_static_trace_data () + } + + collection_list::collection_list () +- : m_regs_mask (), +- m_strace_data (false) ++ : m_strace_data (false) + { ++ int max_remote_regno = 0; ++ for (int i = 0; i < gdbarch_num_regs (target_gdbarch ()); i++) ++ { ++ int remote_regno = (gdbarch_remote_register_number ++ (target_gdbarch (), i)); ++ ++ if (remote_regno >= 0 && remote_regno > max_remote_regno) ++ max_remote_regno = remote_regno; ++ } ++ ++ m_regs_mask.resize ((max_remote_regno / 8) + 1); ++ + m_memranges.reserve (128); + m_aexprs.reserve (128); + } +@@ -1148,7 +1157,8 @@ collection_list::collection_list () + std::vector + collection_list::stringify () + { +- char temp_buf[2048]; ++ gdb::char_vector temp_buf (2048); ++ + int count; + char *end; + long i; +@@ -1158,35 +1168,45 @@ collection_list::stringify () + { + if (info_verbose) + printf_filtered ("\nCollecting static trace data\n"); +- end = temp_buf; ++ end = temp_buf.data (); + *end++ = 'L'; +- str_list.emplace_back (temp_buf, end - temp_buf); ++ str_list.emplace_back (temp_buf.data (), end - temp_buf.data ()); + } + +- for (i = sizeof (m_regs_mask) - 1; i > 0; i--) ++ for (i = m_regs_mask.size () - 1; i > 0; i--) + if (m_regs_mask[i] != 0) /* Skip leading zeroes in regs_mask. */ + break; + if (m_regs_mask[i] != 0) /* Prepare to send regs_mask to the stub. */ + { + if (info_verbose) + printf_filtered ("\nCollecting registers (mask): 0x"); +- end = temp_buf; ++ ++ /* One char for 'R', one for the null terminator and two per ++ mask byte. */ ++ std::size_t new_size = (i + 1) * 2 + 2; ++ if (new_size > temp_buf.size ()) ++ temp_buf.resize (new_size); ++ ++ end = temp_buf.data (); + *end++ = 'R'; + for (; i >= 0; i--) + { + QUIT; /* Allow user to bail out with ^C. */ + if (info_verbose) + printf_filtered ("%02X", m_regs_mask[i]); +- sprintf (end, "%02X", m_regs_mask[i]); +- end += 2; ++ ++ end = pack_hex_byte (end, m_regs_mask[i]); + } +- str_list.emplace_back (temp_buf); ++ *end = '\0'; ++ ++ str_list.emplace_back (temp_buf.data ()); + } + if (info_verbose) + printf_filtered ("\n"); + if (!m_memranges.empty () && info_verbose) + printf_filtered ("Collecting memranges: \n"); +- for (i = 0, count = 0, end = temp_buf; i < m_memranges.size (); i++) ++ for (i = 0, count = 0, end = temp_buf.data (); ++ i < m_memranges.size (); i++) + { + QUIT; /* Allow user to bail out with ^C. */ + if (info_verbose) +@@ -1200,9 +1220,9 @@ collection_list::stringify () + } + if (count + 27 > MAX_AGENT_EXPR_LEN) + { +- str_list.emplace_back (temp_buf, count); ++ str_list.emplace_back (temp_buf.data (), count); + count = 0; +- end = temp_buf; ++ end = temp_buf.data (); + } + + { +@@ -1222,7 +1242,7 @@ collection_list::stringify () + } + + count += strlen (end); +- end = temp_buf + count; ++ end = temp_buf.data () + count; + } + + for (i = 0; i < m_aexprs.size (); i++) +@@ -1230,9 +1250,9 @@ collection_list::stringify () + QUIT; /* Allow user to bail out with ^C. */ + if ((count + 10 + 2 * m_aexprs[i]->len) > MAX_AGENT_EXPR_LEN) + { +- str_list.emplace_back (temp_buf, count); ++ str_list.emplace_back (temp_buf.data (), count); + count = 0; +- end = temp_buf; ++ end = temp_buf.data (); + } + sprintf (end, "X%08X,", m_aexprs[i]->len); + end += 10; /* 'X' + 8 hex digits + ',' */ +@@ -1244,9 +1264,9 @@ collection_list::stringify () + + if (count != 0) + { +- str_list.emplace_back (temp_buf, count); ++ str_list.emplace_back (temp_buf.data (), count); + count = 0; +- end = temp_buf; ++ end = temp_buf.data (); + } + + return str_list; +diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h +--- a/gdb/tracepoint.h ++++ b/gdb/tracepoint.h +@@ -293,8 +293,9 @@ public: + { return m_computed; } + + private: +- /* room for up to 256 regs */ +- unsigned char m_regs_mask[32]; ++ /* We need the allocator zero-initialize the mask, so we don't use ++ gdb::byte_vector. */ ++ std::vector m_regs_mask; + + std::vector m_memranges; + diff --git a/gdb-rhbz1187581-power8-regs-6of7.patch b/gdb-rhbz1187581-power8-regs-6of7.patch new file mode 100644 index 0000000..b0a5e1f --- /dev/null +++ b/gdb-rhbz1187581-power8-regs-6of7.patch @@ -0,0 +1,187 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Jan Kratochvil +Date: Thu, 9 Aug 2018 17:18:15 +0200 +Subject: gdb-rhbz1187581-power8-regs-6of7.patch + +;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). + +commit 296956befef3711ed458c7cba8041fde0dab9c50 +Author: Pedro Franco de Carvalho +Date: Mon Aug 6 16:24:55 2018 -0300 + + Allow larger regblock sizes when saving tracefiles + + The tracefile.c:trace_save function assumes trace_regblock_size won't + be larger than the MAX_TRACE_UPLOAD constant, used to size the buffer + which holds trace data. This can cause buffer overruns when this is + not the case. This patch changes this function so that the larger + size is used to size the buffer. + + gdb/ChangeLog: + 2018-08-06 Pedro Franco de Carvalho + + * tracefile.c: Include common/byte-vector.h. + (trace_save): Change type of buf to gdb::byte_vector. Initialize + with trace_regblock_size if needed. Update uses of buf. + ++2018-08-06 Pedro Franco de Carvalho ++ ++ * tracefile.c: Include common/byte-vector.h. ++ (trace_save): Change type of buf to gdb::byte_vector. Initialize ++ with trace_regblock_size if needed. Update uses of buf. ++ + 2018-08-06 Pedro Franco de Carvalho + + * tracepoint.h (collection_list) : Change type to + +diff --git a/gdb/tracefile.c b/gdb/tracefile.c +--- a/gdb/tracefile.c ++++ b/gdb/tracefile.c +@@ -22,6 +22,7 @@ + #include "ctf.h" + #include "exec.h" + #include "regcache.h" ++#include "common/byte-vector.h" + + /* Helper macros. */ + +@@ -67,7 +68,7 @@ trace_save (const char *filename, struct trace_file_writer *writer, + + ULONGEST offset = 0; + #define MAX_TRACE_UPLOAD 2000 +- gdb_byte buf[MAX_TRACE_UPLOAD]; ++ gdb::byte_vector buf (std::max (MAX_TRACE_UPLOAD, trace_regblock_size)); + enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ()); + + /* If the target is to save the data to a file on its own, then just +@@ -144,7 +145,7 @@ trace_save (const char *filename, struct trace_file_writer *writer, + /* We ask for big blocks, in the hopes of efficiency, but + will take less if the target has packet size limitations + or some such. */ +- gotten = target_get_raw_trace_data (buf, offset, ++ gotten = target_get_raw_trace_data (buf.data (), offset, + MAX_TRACE_UPLOAD); + if (gotten < 0) + error (_("Failure to get requested trace buffer data")); +@@ -152,7 +153,7 @@ trace_save (const char *filename, struct trace_file_writer *writer, + if (gotten == 0) + break; + +- writer->ops->write_trace_buffer (writer, buf, gotten); ++ writer->ops->write_trace_buffer (writer, buf.data (), gotten); + + offset += gotten; + } +@@ -163,7 +164,7 @@ trace_save (const char *filename, struct trace_file_writer *writer, + /* Parse the trace buffers according to how data are stored + in trace buffer in GDBserver. */ + +- gotten = target_get_raw_trace_data (buf, offset, 6); ++ gotten = target_get_raw_trace_data (buf.data (), offset, 6); + + if (gotten == 0) + break; +@@ -171,10 +172,10 @@ trace_save (const char *filename, struct trace_file_writer *writer, + /* Read the first six bytes in, which is the tracepoint + number and trace frame size. */ + tp_num = (uint16_t) +- extract_unsigned_integer (&buf[0], 2, byte_order); ++ extract_unsigned_integer (&((buf.data ())[0]), 2, byte_order); + + tf_size = (uint32_t) +- extract_unsigned_integer (&buf[2], 4, byte_order); ++ extract_unsigned_integer (&((buf.data ())[2]), 4, byte_order); + + writer->ops->frame_ops->start (writer, tp_num); + gotten = 6; +@@ -192,7 +193,8 @@ trace_save (const char *filename, struct trace_file_writer *writer, + /* We'll fetch one block each time, in order to + handle the extremely large 'M' block. We first + fetch one byte to get the type of the block. */ +- gotten = target_get_raw_trace_data (buf, offset, 1); ++ gotten = target_get_raw_trace_data (buf.data (), ++ offset, 1); + if (gotten < 1) + error (_("Failure to get requested trace buffer data")); + +@@ -205,13 +207,13 @@ trace_save (const char *filename, struct trace_file_writer *writer, + { + case 'R': + gotten +- = target_get_raw_trace_data (buf, offset, ++ = target_get_raw_trace_data (buf.data (), offset, + trace_regblock_size); + if (gotten < trace_regblock_size) + error (_("Failure to get requested trace" + " buffer data")); + +- TRACE_WRITE_R_BLOCK (writer, buf, ++ TRACE_WRITE_R_BLOCK (writer, buf.data (), + trace_regblock_size); + break; + case 'M': +@@ -221,7 +223,8 @@ trace_save (const char *filename, struct trace_file_writer *writer, + LONGEST t; + int j; + +- t = target_get_raw_trace_data (buf,offset, 10); ++ t = target_get_raw_trace_data (buf.data (), ++ offset, 10); + if (t < 10) + error (_("Failure to get requested trace" + " buffer data")); +@@ -231,10 +234,10 @@ trace_save (const char *filename, struct trace_file_writer *writer, + + gotten = 0; + addr = (ULONGEST) +- extract_unsigned_integer (buf, 8, ++ extract_unsigned_integer (buf.data (), 8, + byte_order); + mlen = (unsigned short) +- extract_unsigned_integer (&buf[8], 2, ++ extract_unsigned_integer (&((buf.data ())[8]), 2, + byte_order); + + TRACE_WRITE_M_BLOCK_HEADER (writer, addr, +@@ -252,14 +255,15 @@ trace_save (const char *filename, struct trace_file_writer *writer, + else + read_length = mlen - j; + +- t = target_get_raw_trace_data (buf, ++ t = target_get_raw_trace_data (buf.data (), + offset + j, + read_length); + if (t < read_length) + error (_("Failure to get requested" + " trace buffer data")); + +- TRACE_WRITE_M_BLOCK_MEMORY (writer, buf, ++ TRACE_WRITE_M_BLOCK_MEMORY (writer, ++ buf.data (), + read_length); + + j += read_length; +@@ -274,18 +278,18 @@ trace_save (const char *filename, struct trace_file_writer *writer, + LONGEST val; + + gotten +- = target_get_raw_trace_data (buf, offset, +- 12); ++ = target_get_raw_trace_data (buf.data (), ++ offset, 12); + if (gotten < 12) + error (_("Failure to get requested" + " trace buffer data")); + +- vnum = (int) extract_signed_integer (buf, ++ vnum = (int) extract_signed_integer (buf.data (), + 4, + byte_order); + val +- = extract_signed_integer (&buf[4], 8, +- byte_order); ++ = extract_signed_integer (&((buf.data ())[4]), ++ 8, byte_order); + + TRACE_WRITE_V_BLOCK (writer, vnum, val); + } diff --git a/gdb-rhbz1187581-power8-regs-7of7.patch b/gdb-rhbz1187581-power8-regs-7of7.patch new file mode 100644 index 0000000..ee82673 --- /dev/null +++ b/gdb-rhbz1187581-power8-regs-7of7.patch @@ -0,0 +1,129 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Jan Kratochvil +Date: Thu, 9 Aug 2018 17:18:49 +0200 +Subject: gdb-rhbz1187581-power8-regs-7of7.patch + +;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). + +commit a7f25a84f4cc1df5248c46346337f19a2a66af5a +Author: Simon Marchi +Date: Mon Aug 6 16:54:47 2018 -0400 + + Fix compilation failure in remote.c + + A recent patch introduced a few of these: + + /home/emaisin/src/binutils-gdb/gdb/remote.c:12862:19: error: format not a string literal and no format arguments [-Werror=format-security] + error (err_msg); + ^ + + Fix them by replacing the call to error with + + error ("%s", err_msg); + + gdb/ChangeLog: + + * remote.c (remote_target::download_tracepoint): Fix format + string errors. + ++2018-08-06 Simon Marchi ++ ++ * remote.c (remote_target::download_tracepoint): Fix format ++ string errors. ++ + 2018-08-06 Pedro Franco de Carvalho + + * tracefile.c: Include common/byte-vector.h. + +diff --git a/gdb/remote.c b/gdb/remote.c +--- a/gdb/remote.c ++++ b/gdb/remote.c +@@ -12826,7 +12826,7 @@ remote_target::download_tracepoint (struct bp_location *loc) + t->step_count, t->pass_count); + + if (ret < 0 || ret >= buf.size ()) +- error (err_msg); ++ error ("%s", err_msg); + + /* Fast tracepoints are mostly handled by the target, but we can + tell the target how big of an instruction block should be moved +@@ -12846,7 +12846,7 @@ remote_target::download_tracepoint (struct bp_location *loc) + gdb_insn_length (loc->gdbarch, tpaddr)); + + if (ret < 0 || ret >= size_left) +- error (err_msg); ++ error ("%s", err_msg); + } + else + /* If it passed validation at definition but fails now, +@@ -12877,7 +12877,7 @@ remote_target::download_tracepoint (struct bp_location *loc) + size_left, ":S"); + + if (ret < 0 || ret >= size_left) +- error (err_msg); ++ error ("%s", err_msg); + } + else + error (_("Static tracepoint not valid during download")); +@@ -12905,14 +12905,14 @@ remote_target::download_tracepoint (struct bp_location *loc) + size_left, ":X%x,", aexpr->len); + + if (ret < 0 || ret >= size_left) +- error (err_msg); ++ error ("%s", err_msg); + + size_left = buf.size () - strlen (buf.data ()); + + /* Two bytes to encode each aexpr byte, plus the terminating + null byte. */ + if (aexpr->len * 2 + 1 > size_left) +- error (err_msg); ++ error ("%s", err_msg); + + pkt = buf.data () + strlen (buf.data ()); + +@@ -12933,7 +12933,7 @@ remote_target::download_tracepoint (struct bp_location *loc) + size_left, "-"); + + if (ret < 0 || ret >= size_left) +- error (err_msg); ++ error ("%s", err_msg); + } + + putpkt (buf.data ()); +@@ -12956,7 +12956,7 @@ remote_target::download_tracepoint (struct bp_location *loc) + has_more ? '-' : 0); + + if (ret < 0 || ret >= buf.size ()) +- error (err_msg); ++ error ("%s", err_msg); + + putpkt (buf.data ()); + remote_get_noisy_reply (); +@@ -12979,7 +12979,7 @@ remote_target::download_tracepoint (struct bp_location *loc) + has_more ? "-" : ""); + + if (ret < 0 || ret >= buf.size ()) +- error (err_msg); ++ error ("%s", err_msg); + + putpkt (buf.data ()); + remote_get_noisy_reply (); +@@ -12994,7 +12994,7 @@ remote_target::download_tracepoint (struct bp_location *loc) + ret = snprintf (buf.data (), buf.size (), "QTDPsrc:"); + + if (ret < 0 || ret >= buf.size ()) +- error (err_msg); ++ error ("%s", err_msg); + + encode_source_string (b->number, loc->address, "at", + event_location_to_string (b->location.get ()), +@@ -13010,7 +13010,7 @@ remote_target::download_tracepoint (struct bp_location *loc) + ret = snprintf (buf.data (), buf.size (), "QTDPsrc:"); + + if (ret < 0 || ret >= buf.size ()) +- error (err_msg); ++ error ("%s", err_msg); + + encode_source_string (b->number, loc->address, + "cond", b->cond_string, diff --git a/gdb.spec b/gdb.spec index 4271cff..809aeae 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: 43%{?dist} +Release: 44%{?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 @@ -1022,6 +1022,9 @@ fi %endif %changelog +* Thu Aug 9 2018 Jan Kratochvil - 8.1.90.20180727-44.fc29 +- Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). + * Thu Aug 9 2018 Sergio Durigan Junior - 8.1.90.20180727-43.fc29 - Reenable libipt. From 56040033ea1cce5ea0df0bfe40e0ede6af47a34e Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Tue, 21 Aug 2018 15:33:32 -0400 Subject: [PATCH 26/35] Enable verbose output when running "make". --- gdb.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb.spec b/gdb.spec index 809aeae..4997f0c 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: 44%{?dist} +Release: 45%{?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 @@ -656,10 +656,10 @@ else fi # Prepare gdb/config.h first. -make %{?_smp_mflags} CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" maybe-configure-gdb +make %{?_smp_mflags} CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" V=1 maybe-configure-gdb perl -i.relocatable -pe 's/^(D\[".*_RELOCATABLE"\]=" )1(")$/${1}0$2/' gdb/config.status -make %{?_smp_mflags} CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" +make %{?_smp_mflags} CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" V=1 ! grep '_RELOCATABLE.*1' gdb/config.h grep '^#define HAVE_LIBSELINUX 1$' gdb/config.h @@ -682,7 +682,7 @@ done # fprofile cd %{gdb_build} make %{?_smp_mflags} \ - -C gdb/doc {gdb,annotate}{.info,/index.html,.pdf} MAKEHTMLFLAGS=--no-split MAKEINFOFLAGS=--no-split + -C gdb/doc {gdb,annotate}{.info,/index.html,.pdf} MAKEHTMLFLAGS=--no-split MAKEINFOFLAGS=--no-split V=1 # Copy the /gdb/NEWS file to the directory above it. cp $RPM_BUILD_DIR/%{gdb_src}/gdb/NEWS $RPM_BUILD_DIR/%{gdb_src} @@ -1022,6 +1022,9 @@ fi %endif %changelog +* Tue Aug 21 2018 Sergio Durigan Junior - 8.1.90.20180727-45.fc30 +- Enable verbose output when running "make". + * Thu Aug 9 2018 Jan Kratochvil - 8.1.90.20180727-44.fc29 - Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). From 0702d0d3e8313c1dc588ee5326b3f8af1cfe9a4d Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Mon, 17 Sep 2018 18:38:14 -0400 Subject: [PATCH 27/35] Rebase to FSF GDB 8.2.50.20180917 (8.3pre). Add 'gdb-rhbz795424-bitpos-arrayview.patch'. --- .gitignore | 2 +- _gdb.spec.Patch.include | 33 +- _gdb.spec.patch.include | 9 - _git_upstream_commit | 2 +- _patch_order | 11 +- gdb-6.3-gstack-20050411.patch | 6 +- gdb-6.3-readnever-20050907.patch | 2 +- gdb-6.5-bz216711-clone-is-outermost.patch | 2 +- ...379-solib-trampoline-lookup-lock-fix.patch | 2 +- gdb-6.6-buildid-locate-core-as-arg.patch | 27 +- ...warning-missing-debuginfo-rhbz981154.patch | 2 +- ...buildid-locate-rpm-librpm-workaround.patch | 2 +- gdb-6.6-buildid-locate-rpm-scl.patch | 12 +- gdb-6.6-buildid-locate-rpm.patch | 20 +- ...6.6-buildid-locate-solib-missing-ids.patch | 4 +- gdb-6.6-buildid-locate.patch | 72 +- gdb-6.8-quit-never-aborts.patch | 4 +- gdb-archer-pie-addons-keep-disabled.patch | 6 +- gdb-archer-pie-addons.patch | 12 +- gdb-archer.patch | 36 +- gdb-attach-fail-reasons-5of5.patch | 12 +- gdb-btrobust.patch | 6 +- gdb-bz1219747-attach-kills.patch | 16 +- gdb-bz533176-fortran-omp-step.patch | 4 +- gdb-bz541866-rwatch-before-run.patch | 8 +- gdb-bz568248-oom-is-error.patch | 2 +- gdb-container-rh-pkg.patch | 2 +- gdb-fedora-libncursesw.patch | 12 +- gdb-follow-child-stale-parent.patch | 2 +- gdb-glibc-strstr-workaround.patch | 2 +- gdb-gnat-dwarf-crash-3of3.patch | 18 +- gdb-jit-reader-multilib.patch | 4 +- gdb-linux_perf-bundle.patch | 4 +- gdb-moribund-utrace-workaround.patch | 4 +- gdb-python-gil.patch | 26 +- gdb-rhbz1187581-power8-regs-1of7.patch | 65 - gdb-rhbz1187581-power8-regs-2of7.patch | 45 - gdb-rhbz1187581-power8-regs-3of7.patch | 258 --- gdb-rhbz1187581-power8-regs-4of7.patch | 449 ---- gdb-rhbz1187581-power8-regs-5of7.patch | 215 -- gdb-rhbz1187581-power8-regs-6of7.patch | 187 -- gdb-rhbz1187581-power8-regs-7of7.patch | 129 -- gdb-rhbz795424-bitpos-20of25.patch | 204 +- gdb-rhbz795424-bitpos-21of25.patch | 6 +- gdb-rhbz795424-bitpos-22of25.patch | 46 +- gdb-rhbz795424-bitpos-23of25.patch | 56 +- gdb-rhbz795424-bitpos-arrayview.patch | 60 + gdb-rhbz881849-ipv6-1of3.patch | 1934 ----------------- gdb-rhbz881849-ipv6-2of3.patch | 54 - gdb-rhbz881849-ipv6-3of3.patch | 72 - gdb-vla-intel-fortran-strides.patch | 91 +- gdb-vla-intel-fortran-vla-strings.patch | 50 +- gdb-vla-intel-stringbt-fix.patch | 2 +- gdb.spec | 10 +- sources | 2 +- 55 files changed, 483 insertions(+), 3840 deletions(-) delete mode 100644 gdb-rhbz1187581-power8-regs-1of7.patch delete mode 100644 gdb-rhbz1187581-power8-regs-2of7.patch delete mode 100644 gdb-rhbz1187581-power8-regs-3of7.patch delete mode 100644 gdb-rhbz1187581-power8-regs-4of7.patch delete mode 100644 gdb-rhbz1187581-power8-regs-5of7.patch delete mode 100644 gdb-rhbz1187581-power8-regs-6of7.patch delete mode 100644 gdb-rhbz1187581-power8-regs-7of7.patch create mode 100644 gdb-rhbz795424-bitpos-arrayview.patch delete mode 100644 gdb-rhbz881849-ipv6-1of3.patch delete mode 100644 gdb-rhbz881849-ipv6-2of3.patch delete mode 100644 gdb-rhbz881849-ipv6-3of3.patch diff --git a/.gitignore b/.gitignore index 949c204..912afa8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz -/gdb-8.1.90.20180727.tar.xz /v2.0.tar.gz +/gdb-8.2.50.20180917.tar.xz diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include index b3c5633..47bf685 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -504,33 +504,8 @@ Patch120: gdb-vla-intel-fix-print-char-array.patch # =fedoratest 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 - - -Patch123: gdb-rhbz881849-ipv6-2of3.patch - - -Patch124: gdb-rhbz881849-ipv6-3of3.patch - -# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). -Patch125: gdb-rhbz1187581-power8-regs-1of7.patch - -# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). -Patch126: gdb-rhbz1187581-power8-regs-2of7.patch - -# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). -Patch127: gdb-rhbz1187581-power8-regs-3of7.patch - -# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). -Patch128: gdb-rhbz1187581-power8-regs-4of7.patch - -# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). -Patch129: gdb-rhbz1187581-power8-regs-5of7.patch - -# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). -Patch130: gdb-rhbz1187581-power8-regs-6of7.patch - -# Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). -Patch131: gdb-rhbz1187581-power8-regs-7of7.patch +# This patch is needed to compile GDB after -Werror=narrowing has +# been enabled by default. +# Author: Sergio Durigan Junior. +Patch122: gdb-rhbz795424-bitpos-arrayview.patch diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include index ca390b7..131cf93 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -120,12 +120,3 @@ %patch120 -p1 %patch121 -p1 %patch122 -p1 -%patch123 -p1 -%patch124 -p1 -%patch125 -p1 -%patch126 -p1 -%patch127 -p1 -%patch128 -p1 -%patch129 -p1 -%patch130 -p1 -%patch131 -p1 diff --git a/_git_upstream_commit b/_git_upstream_commit index 06f33fd..5d82e25 100644 --- a/_git_upstream_commit +++ b/_git_upstream_commit @@ -1 +1 @@ -ab080c102869dd3ad300a99d0c00b256404fd76b +e08ef628a7e3098699ec6939584e2c9f7a9e1952 diff --git a/_patch_order b/_patch_order index ec2f86f..4d199ce 100644 --- a/_patch_order +++ b/_patch_order @@ -119,13 +119,4 @@ 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-rhbz1187581-power8-regs-1of7.patch -gdb-rhbz1187581-power8-regs-2of7.patch -gdb-rhbz1187581-power8-regs-3of7.patch -gdb-rhbz1187581-power8-regs-4of7.patch -gdb-rhbz1187581-power8-regs-5of7.patch -gdb-rhbz1187581-power8-regs-6of7.patch -gdb-rhbz1187581-power8-regs-7of7.patch +gdb-rhbz795424-bitpos-arrayview.patch diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 37b09de..523d0d0 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -1735,7 +1735,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force +@@ -1732,7 +1732,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force install: all @$(MAKE) $(FLAGS_TO_PASS) install-only @@ -25,7 +25,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -1784,7 +1784,25 @@ install-guile: +@@ -1781,7 +1781,25 @@ install-guile: install-python: $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb @@ -52,7 +52,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ -@@ -1807,6 +1825,18 @@ uninstall: force $(CONFIG_UNINSTALL) +@@ -1804,6 +1822,18 @@ uninstall: force $(CONFIG_UNINSTALL) fi @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do diff --git a/gdb-6.3-readnever-20050907.patch b/gdb-6.3-readnever-20050907.patch index b70b58f..8a51aef 100644 --- a/gdb-6.3-readnever-20050907.patch +++ b/gdb-6.3-readnever-20050907.patch @@ -32,4 +32,4 @@ diff --git a/gdb/gcore.in b/gdb/gcore.in + "$binary_path/@GDB_TRANSFORM_NAME@" xsave_xcr0_offset = -1; diff --git a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch index 45d8570..20577ed 100644 --- a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +++ b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch @@ -11,7 +11,7 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379 diff --git a/gdb/symtab.c b/gdb/symtab.c --- a/gdb/symtab.c +++ b/gdb/symtab.c -@@ -3165,6 +3165,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) +@@ -3166,6 +3166,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) SYMBOL_LINKAGE_NAME (msymbol)); */ ; /* fall through */ diff --git a/gdb-6.6-buildid-locate-core-as-arg.patch b/gdb-6.6-buildid-locate-core-as-arg.patch index 40938a5..5876a47 100644 --- a/gdb-6.6-buildid-locate-core-as-arg.patch +++ b/gdb-6.6-buildid-locate-core-as-arg.patch @@ -85,7 +85,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c #include #include "readline/readline.h" -@@ -357,12 +358,27 @@ exec_file_attach (const char *filename, int from_tty) +@@ -356,12 +357,27 @@ exec_file_attach (const char *filename, int from_tty) if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching)) { @@ -102,7 +102,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c exec_close (); - error (_("\"%s\": not in executable format: %s"), - scratch_pathname, -- gdb_bfd_errmsg (bfd_get_error (), matching)); +- gdb_bfd_errmsg (bfd_get_error (), matching).c_str ()); + + if (is_core != 0) + throw_error (IS_CORE_ERROR, @@ -112,14 +112,14 @@ diff --git a/gdb/exec.c b/gdb/exec.c + else + error (_("\"%s\": not in executable format: %s"), + scratch_pathname, -+ gdb_bfd_errmsg (bfd_get_error (), matching)); ++ gdb_bfd_errmsg (bfd_get_error (), matching).c_str ()); } if (build_section_table (exec_bfd, §ions, §ions_end)) diff --git a/gdb/main.c b/gdb/main.c --- a/gdb/main.c +++ b/gdb/main.c -@@ -447,6 +447,37 @@ struct cmdarg +@@ -447,6 +447,35 @@ struct cmdarg char *string; }; @@ -130,8 +130,6 @@ diff --git a/gdb/main.c b/gdb/main.c +static void +exec_or_core_file_attach (const char *filename, int from_tty) +{ -+ volatile struct gdb_exception e; -+ + gdb_assert (exec_bfd == NULL); + + TRY @@ -157,7 +155,7 @@ diff --git a/gdb/main.c b/gdb/main.c static void captured_main_1 (struct captured_main_args *context) { -@@ -883,6 +914,8 @@ captured_main_1 (struct captured_main_args *context) +@@ -884,6 +913,8 @@ captured_main_1 (struct captured_main_args *context) { symarg = argv[optind]; execarg = argv[optind]; @@ -166,7 +164,7 @@ diff --git a/gdb/main.c b/gdb/main.c optind++; } -@@ -1033,11 +1066,25 @@ captured_main_1 (struct captured_main_args *context) +@@ -1034,12 +1065,25 @@ captured_main_1 (struct captured_main_args *context) && symarg != NULL && strcmp (execarg, symarg) == 0) { @@ -185,13 +183,14 @@ diff --git a/gdb/main.c b/gdb/main.c /* The exec file and the symbol-file are the same. If we can't open it, better only print one error message. - catch_command_errors returns non-zero on success! */ -- if (catch_command_errors (exec_file_attach, execarg, -- !batch_flag)) +- ret = catch_command_errors (exec_file_attach, execarg, +- !batch_flag); +- if (ret != 0) + catch_command_errors returns non-zero on success! + Do not load EXECARG as a symbol file if it has been already processed + as a core file. */ -+ if (catch_command_errors (func, execarg, !batch_flag) -+ && core_bfd == NULL) - catch_command_errors (symbol_file_add_main_adapter, symarg, - !batch_flag); ++ ret = catch_command_errors (func, execarg, !batch_flag); ++ if (ret != 0 && core_bfd == NULL) + ret = catch_command_errors (symbol_file_add_main_adapter, + symarg, !batch_flag); } diff --git a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch index a25057e..162f3d7 100644 --- a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +++ b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch @@ -28,7 +28,7 @@ Comments by Sergio Durigan Junior : diff --git a/gdb/build-id.c b/gdb/build-id.c --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -581,7 +581,10 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id, +@@ -578,7 +578,10 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id, do_cleanups (inner); if (abfd == NULL) diff --git a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch index 375b178..e4935f5 100644 --- a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +++ b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch @@ -9,7 +9,7 @@ Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch diff --git a/gdb/build-id.c b/gdb/build-id.c --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -652,6 +652,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) +@@ -649,6 +649,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) #include #endif diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch index 7e39488..da2bf5d 100644 --- a/gdb-6.6-buildid-locate-rpm-scl.patch +++ b/gdb-6.6-buildid-locate-rpm-scl.patch @@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=953585 diff --git a/gdb/build-id.c b/gdb/build-id.c --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -689,7 +689,11 @@ static int missing_rpm_list_entries; +@@ -686,7 +686,11 @@ static int missing_rpm_list_entries; /* Returns the count of newly added rpms. */ static int @@ -24,7 +24,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c { static int rpm_init_done = 0; rpmts ts; -@@ -796,7 +800,11 @@ missing_rpm_enlist (const char *filename) +@@ -793,7 +797,11 @@ missing_rpm_enlist (const char *filename) mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0); if (mi != NULL) { @@ -36,7 +36,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c { Header h; char *debuginfo, **slot, *s, *s2; -@@ -914,6 +922,37 @@ missing_rpm_enlist (const char *filename) +@@ -911,6 +919,37 @@ missing_rpm_enlist (const char *filename) xfree (debuginfo); count++; } @@ -74,7 +74,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c rpmdbFreeIterator_p (mi); } -@@ -924,6 +963,21 @@ missing_rpm_enlist (const char *filename) +@@ -921,6 +960,21 @@ missing_rpm_enlist (const char *filename) } static int @@ -99,7 +99,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -3469,6 +3469,16 @@ read_gdb_index_from_section (struct objfile *objfile, +@@ -3467,6 +3467,16 @@ read_gdb_index_from_buffer (struct objfile *objfile, "set use-deprecated-index-sections on". */ if (version < 6 && !deprecated_ok) { @@ -116,7 +116,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c static int warning_printed = 0; if (!warning_printed) { -@@ -3480,6 +3490,10 @@ to use the section anyway."), +@@ -3478,6 +3488,10 @@ to use the section anyway."), warning_printed = 1; } return 0; diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index d5ec4b0..c9cdce4 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -244,7 +244,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c #define BUILD_ID_VERBOSE_NONE 0 #define BUILD_ID_VERBOSE_FILENAMES 1 -@@ -640,8 +642,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) +@@ -637,8 +639,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) return result; } @@ -612,7 +612,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c avoidance. */ struct missing_filepair -@@ -695,11 +1055,17 @@ missing_filepair_change (void) +@@ -692,11 +1052,17 @@ missing_filepair_change (void) /* All their memory came just from missing_filepair_OBSTACK. */ missing_filepair_hash = NULL; } @@ -630,7 +630,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c missing_filepair_change (); } -@@ -766,14 +1132,39 @@ debug_print_missing (const char *binary, const char *debug) +@@ -763,14 +1129,39 @@ debug_print_missing (const char *binary, const char *debug) *slot = missing_filepair; @@ -690,7 +690,7 @@ diff --git a/gdb/config.in b/gdb/config.in /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS -@@ -270,6 +273,9 @@ +@@ -258,6 +261,9 @@ /* Define if Python 2.7 is being used. */ #undef HAVE_LIBPYTHON2_7 @@ -722,8 +722,8 @@ diff --git a/gdb/configure b/gdb/configure +with_rpm enable_targets enable_64_bit_bfd - enable_gdbcli -@@ -912,6 +918,11 @@ CCC + enable_gdbmi +@@ -910,6 +916,11 @@ CCC CPP MAKEINFO MAKEINFOFLAGS @@ -735,7 +735,7 @@ diff --git a/gdb/configure b/gdb/configure YACC YFLAGS XMKMF' -@@ -1583,6 +1594,8 @@ Optional Packages: +@@ -1578,6 +1589,8 @@ Optional Packages: [--with-auto-load-dir] --without-auto-load-safe-path do not restrict auto-loaded files locations @@ -744,7 +744,7 @@ diff --git a/gdb/configure b/gdb/configure --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets --with-curses use the curses library instead of the termcap library -@@ -1640,6 +1653,13 @@ Some influential environment variables: +@@ -1635,6 +1648,13 @@ Some influential environment variables: MAKEINFO Parent configure detects if it is of sufficient version. MAKEINFOFLAGS Parameters for MAKEINFO. @@ -758,7 +758,7 @@ diff --git a/gdb/configure b/gdb/configure YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. -@@ -6575,6 +6595,494 @@ _ACEOF +@@ -6570,6 +6590,494 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 $as_echo "$with_auto_load_safe_path" >&6; } @@ -1503,7 +1503,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c diff --git a/gdb/symfile.h b/gdb/symfile.h --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -540,6 +540,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data, +@@ -534,6 +534,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data, /* build-id support. */ extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); extern void debug_print_missing (const char *binary, const char *debug); diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch index 2b96166..6da53a7 100644 --- a/gdb-6.6-buildid-locate-solib-missing-ids.patch +++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch @@ -14,7 +14,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1339862 diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c -@@ -1358,14 +1358,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1343,14 +1343,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, } { @@ -44,7 +44,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c if (build_id != NULL) { char *name, *build_id_filename; -@@ -1380,23 +1393,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1365,23 +1378,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, xfree (name); } else diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 618f41a..b37a396 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -436,7 +436,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c if (found == NULL) warning (_("File \"%s\" has no build-id, file skipped"), -@@ -65,11 +463,50 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) +@@ -65,11 +463,47 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) return retval; } @@ -481,14 +481,11 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c +build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id, + char **link_return, int add_debug_suffix) { -+ char *debugdir; + std::string link, link_all; -+ struct cleanup *back_to; -+ int ix; gdb_bfd_ref_ptr abfd; /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will -@@ -82,63 +519,296 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) +@@ -82,63 +516,296 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) { const gdb_byte *data = build_id; size_t size = build_id_len; @@ -807,7 +804,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c /* Prevent looping on a stripped .debug file. */ if (abfd != NULL && filename_cmp (bfd_get_filename (abfd.get ()), -@@ -151,3 +821,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) +@@ -151,3 +818,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) return std::string (); } @@ -832,9 +829,9 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c diff --git a/gdb/build-id.h b/gdb/build-id.h --- a/gdb/build-id.h +++ b/gdb/build-id.h -@@ -22,9 +22,10 @@ - +@@ -23,9 +23,10 @@ #include "gdb_bfd.h" + #include "common/rsp-low.h" -/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */ +/* Separate debuginfo files have corrupted PHDR but SHDR is correct there. @@ -845,7 +842,7 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value. Otherwise, issue a warning and return false. */ -@@ -38,13 +39,18 @@ extern int build_id_verify (bfd *abfd, +@@ -39,14 +40,19 @@ extern int build_id_verify (bfd *abfd, the caller. */ extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len, @@ -866,11 +863,12 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h +extern std::string find_separate_debug_file_by_buildid (struct objfile *objfile, + gdb::unique_xmalloc_ptr *build_id_filename_return); - #endif /* BUILD_ID_H */ + /* Return an hex-string representation of BUILD_ID. */ + diff --git a/gdb/coffread.c b/gdb/coffread.c --- a/gdb/coffread.c +++ b/gdb/coffread.c -@@ -733,7 +733,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) +@@ -734,7 +734,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) /* Try to add separate debug file if no symbols table found. */ if (!objfile_has_partial_symbols (objfile)) { @@ -905,7 +903,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c +{ + CORE_ADDR at_entry; + struct bfd_build_id *build_id; -+ char *execfilename, *debug_filename; ++ char *execfilename; + char *build_id_filename; + struct cleanup *back_to; + @@ -949,7 +947,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c /* Issue a message saying we have no core to debug, if FROM_TTY. */ static void -@@ -464,6 +516,14 @@ core_target_open (const char *arg, int from_tty) +@@ -463,6 +515,14 @@ core_target_open (const char *arg, int from_tty) switch_to_thread (thread); } @@ -964,7 +962,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c post_create_inferior (target, from_tty); /* Now go through the target stack looking for threads since there -@@ -1066,4 +1126,11 @@ void +@@ -1071,4 +1131,11 @@ void _initialize_corelow (void) { add_target (core_target_info, core_target_open, filename_completer); @@ -979,7 +977,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -19570,6 +19570,27 @@ information files. +@@ -19772,6 +19772,27 @@ information files. @end table @@ -1007,10 +1005,22 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo @cindex @code{.gnu_debuglink} sections @cindex debug link sections A debug link is a special section of the executable file named +diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c +--- a/gdb/dwarf-index-cache.c ++++ b/gdb/dwarf-index-cache.c +@@ -140,7 +140,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile) + if (!enabled ()) + return; + +- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd); ++ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd); + if (build_id == nullptr) + { + if (debug_index_cache) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -2683,7 +2683,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile) +@@ -2693,7 +2693,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile) } if (dwz_bfd == NULL) @@ -1019,10 +1029,28 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (dwz_bfd == NULL) error (_("could not find '.gnu_debugaltlink' file for %s"), +@@ -6198,7 +6198,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) + static gdb::array_view + get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) + { +- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd); ++ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd); + if (build_id == nullptr) + return {}; + +@@ -6211,7 +6211,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) + static gdb::array_view + get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz) + { +- const bfd_build_id *build_id = build_id_bfd_get (dwz->dwz_bfd.get ()); ++ const bfd_build_id *build_id = build_id_bfd_shdr_get (dwz->dwz_bfd.get ()); + if (build_id == nullptr) + return {}; + diff --git a/gdb/elfread.c b/gdb/elfread.c --- a/gdb/elfread.c +++ b/gdb/elfread.c -@@ -1290,7 +1290,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) +@@ -1289,7 +1289,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) && objfile->separate_debug_objfile == NULL && objfile->separate_debug_objfile_backlink == NULL) { @@ -1033,7 +1061,7 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c if (debugfile.empty ()) debugfile = find_separate_debug_file_by_debuglink (objfile); -@@ -1302,6 +1304,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) +@@ -1301,6 +1303,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) symbol_file_add_separate (abfd.get (), debugfile.c_str (), symfile_flags, objfile); } @@ -1061,7 +1089,7 @@ diff --git a/gdb/objfiles.h b/gdb/objfiles.h diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c --- a/gdb/python/py-objfile.c +++ b/gdb/python/py-objfile.c -@@ -137,7 +137,7 @@ objfpy_get_build_id (PyObject *self, void *closure) +@@ -132,7 +132,7 @@ objfpy_get_build_id (PyObject *self, void *closure) TRY { @@ -1070,7 +1098,7 @@ diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c } CATCH (except, RETURN_MASK_ALL) { -@@ -544,7 +544,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id) +@@ -549,7 +549,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id) /* Don't return separate debug files. */ if (objfile->separate_debug_objfile_backlink != NULL) continue; @@ -1090,7 +1118,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c static struct link_map_offsets *svr4_fetch_link_map_offsets (void); static int svr4_have_link_map_offsets (void); -@@ -1356,9 +1357,51 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1341,9 +1342,51 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, continue; } @@ -1148,7 +1176,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c diff --git a/gdb/symfile.h b/gdb/symfile.h --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -537,6 +537,10 @@ void expand_symtabs_matching +@@ -531,6 +531,10 @@ void expand_symtabs_matching void map_symbol_filenames (symbol_filename_ftype *fun, void *data, int need_fullname); diff --git a/gdb-6.8-quit-never-aborts.patch b/gdb-6.8-quit-never-aborts.patch index f3765de..29f1b66 100644 --- a/gdb-6.8-quit-never-aborts.patch +++ b/gdb-6.8-quit-never-aborts.patch @@ -45,7 +45,7 @@ diff --git a/gdb/extension.c b/gdb/extension.c diff --git a/gdb/top.c b/gdb/top.c --- a/gdb/top.c +++ b/gdb/top.c -@@ -1611,7 +1611,13 @@ quit_force (int *exit_arg, int from_tty) +@@ -1606,7 +1606,13 @@ quit_force (int *exit_arg, int from_tty) qt.from_tty = from_tty; @@ -62,7 +62,7 @@ diff --git a/gdb/top.c b/gdb/top.c diff --git a/gdb/utils.c b/gdb/utils.c --- a/gdb/utils.c +++ b/gdb/utils.c -@@ -108,6 +108,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time; +@@ -98,6 +98,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time; static int debug_timestamp = 0; diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch index 672734f..1833f98 100644 --- a/gdb-archer-pie-addons-keep-disabled.patch +++ b/gdb-archer-pie-addons-keep-disabled.patch @@ -8,7 +8,7 @@ Subject: gdb-archer-pie-addons-keep-disabled.patch diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -15516,6 +15516,50 @@ initialize_breakpoint_ops (void) +@@ -15506,6 +15506,50 @@ initialize_breakpoint_ops (void) static struct cmd_list_element *enablebreaklist = NULL; @@ -62,7 +62,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h -@@ -1679,6 +1679,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg); +@@ -1676,6 +1676,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg); UIOUT iff debugging multiple threads. */ extern void maybe_print_thread_hit_breakpoint (struct ui_out *uiout); @@ -75,7 +75,7 @@ diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h diff --git a/gdb/objfiles.c b/gdb/objfiles.c --- a/gdb/objfiles.c +++ b/gdb/objfiles.c -@@ -875,6 +875,11 @@ objfile_relocate1 (struct objfile *objfile, +@@ -880,6 +880,11 @@ objfile_relocate1 (struct objfile *objfile, obj_section_addr (s)); } diff --git a/gdb-archer-pie-addons.patch b/gdb-archer-pie-addons.patch index 9aef617..88da22a 100644 --- a/gdb-archer-pie-addons.patch +++ b/gdb-archer-pie-addons.patch @@ -8,7 +8,7 @@ Subject: gdb-archer-pie-addons.patch diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h -@@ -505,6 +505,7 @@ enum field_loc_kind +@@ -506,6 +506,7 @@ enum field_loc_kind { FIELD_LOC_KIND_BITPOS, /**< bitpos */ FIELD_LOC_KIND_ENUMVAL, /**< enumval */ @@ -16,7 +16,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h FIELD_LOC_KIND_PHYSADDR, /**< physaddr */ FIELD_LOC_KIND_PHYSNAME, /**< physname */ FIELD_LOC_KIND_DWARF_BLOCK /**< dwarf_block */ -@@ -556,6 +557,7 @@ union field_location +@@ -557,6 +558,7 @@ union field_location field. Otherwise, physname is the mangled label of the static field. */ @@ -24,7 +24,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h CORE_ADDR physaddr; const char *physname; -@@ -1438,6 +1440,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); +@@ -1439,6 +1441,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); #define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval) #define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0) #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) @@ -32,7 +32,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block) #define SET_FIELD_BITPOS(thisfld, bitpos) \ -@@ -1449,6 +1452,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); +@@ -1450,6 +1453,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); #define SET_FIELD_PHYSNAME(thisfld, name) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ FIELD_STATIC_PHYSNAME (thisfld) = (name)) @@ -40,7 +40,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h #define SET_FIELD_PHYSADDR(thisfld, addr) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \ FIELD_STATIC_PHYSADDR (thisfld) = (addr)) -@@ -1465,6 +1469,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); +@@ -1466,6 +1470,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) @@ -51,7 +51,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h diff --git a/gdb/value.c b/gdb/value.c --- a/gdb/value.c +++ b/gdb/value.c -@@ -2829,7 +2829,8 @@ value_static_field (struct type *type, int fieldno) +@@ -2828,7 +2828,8 @@ value_static_field (struct type *type, int fieldno) { case FIELD_LOC_KIND_PHYSADDR: retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno), diff --git a/gdb-archer.patch b/gdb-archer.patch index dcb989c..882b86e 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -17,7 +17,7 @@ tromey/python diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -2112,6 +2112,12 @@ stamp-h: $(srcdir)/config.in config.status +@@ -2092,6 +2092,12 @@ stamp-h: $(srcdir)/config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -73,7 +73,7 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi -@@ -88,8 +88,6 @@ containing @code{end}. For example: +@@ -90,8 +90,6 @@ containing @code{end}. For example: @smallexample (@value{GDBP}) python @@ -112,7 +112,7 @@ diff --git a/gdb/main.c b/gdb/main.c #include "source.h" #include "cli/cli-cmds.h" #include "objfiles.h" -@@ -479,7 +480,7 @@ exec_or_core_file_attach (const char *filename, int from_tty) +@@ -477,7 +478,7 @@ exec_or_core_file_attach (const char *filename, int from_tty) } static void @@ -121,7 +121,7 @@ diff --git a/gdb/main.c b/gdb/main.c { int argc = context->argc; char **argv = context->argv; -@@ -695,10 +696,14 @@ captured_main_1 (struct captured_main_args *context) +@@ -694,10 +695,14 @@ captured_main_1 (struct captured_main_args *context) {"args", no_argument, &set_args, 1}, {"l", required_argument, 0, 'l'}, {"return-child-result", no_argument, &return_child_result, 1}, @@ -137,7 +137,7 @@ diff --git a/gdb/main.c b/gdb/main.c { int option_index; -@@ -716,6 +721,9 @@ captured_main_1 (struct captured_main_args *context) +@@ -715,6 +720,9 @@ captured_main_1 (struct captured_main_args *context) case 0: /* Long option that just sets a flag. */ break; @@ -147,7 +147,7 @@ diff --git a/gdb/main.c b/gdb/main.c case OPT_SE: symarg = optarg; execarg = optarg; -@@ -890,7 +898,31 @@ captured_main_1 (struct captured_main_args *context) +@@ -889,7 +897,31 @@ captured_main_1 (struct captured_main_args *context) /* Now that gdb_init has created the initial inferior, we're in position to set args for that inferior. */ @@ -180,7 +180,7 @@ diff --git a/gdb/main.c b/gdb/main.c { /* The remaining options are the command-line options for the inferior. The first one is the sym/exec file, and the rest -@@ -1180,7 +1212,8 @@ captured_main_1 (struct captured_main_args *context) +@@ -1190,7 +1222,8 @@ captured_main_1 (struct captured_main_args *context) /* Read in the old history after all the command files have been read. */ @@ -190,7 +190,7 @@ diff --git a/gdb/main.c b/gdb/main.c if (batch_flag) { -@@ -1193,24 +1226,37 @@ static void +@@ -1206,24 +1239,37 @@ static void captured_main (void *data) { struct captured_main_args *context = (struct captured_main_args *) data; @@ -241,7 +241,7 @@ diff --git a/gdb/main.c b/gdb/main.c } /* No exit -- exit is through quit_command. */ } -@@ -1253,6 +1299,12 @@ print_gdb_help (struct ui_file *stream) +@@ -1266,6 +1312,12 @@ print_gdb_help (struct ui_file *stream) fputs_unfiltered (_("\ This is the GNU debugger. Usage:\n\n\ gdb [options] [executable-file [core-file or process-id]]\n\ @@ -254,7 +254,7 @@ diff --git a/gdb/main.c b/gdb/main.c gdb [options] --args executable-file [inferior-arguments ...]\n\n\ "), stream); fputs_unfiltered (_("\ -@@ -1298,6 +1350,13 @@ Output and user interface control:\n\n\ +@@ -1311,6 +1363,13 @@ Output and user interface control:\n\n\ #endif fputs_unfiltered (_("\ --dbx DBX compatibility mode.\n\ @@ -365,7 +365,7 @@ new file mode 100644 diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h -@@ -644,6 +644,9 @@ class gdbpy_enter_varobj : public gdbpy_enter +@@ -636,6 +636,9 @@ class gdbpy_enter_varobj : public gdbpy_enter }; @@ -378,7 +378,7 @@ diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h diff --git a/gdb/python/python.c b/gdb/python/python.c --- a/gdb/python/python.c +++ b/gdb/python/python.c -@@ -95,6 +95,8 @@ const struct extension_language_defn extension_language_python = +@@ -94,6 +94,8 @@ const struct extension_language_defn extension_language_python = #include "linespec.h" #include "source.h" #include "version.h" @@ -387,7 +387,7 @@ diff --git a/gdb/python/python.c b/gdb/python/python.c #include "target.h" #include "gdbthread.h" #include "interps.h" -@@ -237,6 +239,29 @@ gdbpy_enter::~gdbpy_enter () +@@ -236,6 +238,29 @@ gdbpy_enter::~gdbpy_enter () restore_active_ext_lang (m_previous_active); } @@ -417,10 +417,10 @@ diff --git a/gdb/python/python.c b/gdb/python/python.c /* Set the quit flag. */ static void -@@ -1367,6 +1392,92 @@ gdbpy_print_stack (void) +@@ -1312,6 +1337,92 @@ gdbpy_print_stack (void) + + - /* Return the current Progspace. - There always is one. */ +/* True if 'gdb -P' was used, false otherwise. */ +static int running_python_script; + @@ -507,10 +507,10 @@ diff --git a/gdb/python/python.c b/gdb/python/python.c + + + + /* Return a sequence holding all the Progspaces. */ static PyObject * - gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2) -@@ -2057,6 +2168,8 @@ PyMethodDef python_GdbMethods[] = +@@ -1963,6 +2074,8 @@ PyMethodDef python_GdbMethods[] = Evaluate command, a string, as a gdb CLI command. Optionally returns\n\ a Python String containing the output of the command if to_string is\n\ set to True." }, diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch index c8b1267..659aec6 100644 --- a/gdb-attach-fail-reasons-5of5.patch +++ b/gdb-attach-fail-reasons-5of5.patch @@ -45,7 +45,7 @@ gdb/gdbserver/ diff --git a/gdb/config.in b/gdb/config.in --- a/gdb/config.in +++ b/gdb/config.in -@@ -276,6 +276,9 @@ +@@ -264,6 +264,9 @@ /* Define if librpm library is being used. */ #undef HAVE_LIBRPM @@ -55,7 +55,7 @@ diff --git a/gdb/config.in b/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -@@ -399,6 +402,9 @@ +@@ -387,6 +390,9 @@ /* Define to 1 if you have the `scm_new_smob' function. */ #undef HAVE_SCM_NEW_SMOB @@ -68,7 +68,7 @@ diff --git a/gdb/config.in b/gdb/config.in diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -15854,6 +15854,64 @@ cat >>confdefs.h <<_ACEOF +@@ -15793,6 +15793,64 @@ cat >>confdefs.h <<_ACEOF _ACEOF @@ -136,7 +136,7 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -2054,6 +2054,10 @@ case $host_os in +@@ -2031,6 +2031,10 @@ case $host_os in esac AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.]) @@ -173,7 +173,7 @@ diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure -@@ -8535,6 +8535,64 @@ if $want_ipa ; then +@@ -8568,6 +8568,64 @@ if $want_ipa ; then fi fi @@ -276,7 +276,7 @@ diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c -@@ -1089,7 +1089,17 @@ linux_nat_target::create_inferior (const char *exec_file, +@@ -1092,7 +1092,17 @@ linux_nat_target::create_inferior (const char *exec_file, /* Make sure we report all signals during startup. */ pass_signals (0, NULL); diff --git a/gdb-btrobust.patch b/gdb-btrobust.patch index 40d406c..b1a65c6 100644 --- a/gdb-btrobust.patch +++ b/gdb-btrobust.patch @@ -14,7 +14,7 @@ printed, but a default backtrace will occur in this case. diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c --- a/gdb/python/py-framefilter.c +++ b/gdb/python/py-framefilter.c -@@ -1151,6 +1151,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, +@@ -1154,6 +1154,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, htab_eq_pointer, NULL)); @@ -22,7 +22,7 @@ diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c while (true) { gdbpy_ref<> item (PyIter_Next (iterable.get ())); -@@ -1159,8 +1160,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, +@@ -1162,8 +1163,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, { if (PyErr_Occurred ()) { @@ -33,7 +33,7 @@ diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c } break; } -@@ -1193,7 +1194,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, +@@ -1196,7 +1197,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, /* Do not exit on error printing a single frame. Print the error and continue with other frames. */ if (success == EXT_LANG_BT_ERROR) diff --git a/gdb-bz1219747-attach-kills.patch b/gdb-bz1219747-attach-kills.patch index 6ae10a2..44f339e 100644 --- a/gdb-bz1219747-attach-kills.patch +++ b/gdb-bz1219747-attach-kills.patch @@ -80,18 +80,18 @@ gdb/testsuite/ChangeLog diff --git a/gdb/main.c b/gdb/main.c --- a/gdb/main.c +++ b/gdb/main.c -@@ -1115,7 +1115,10 @@ captured_main_1 (struct captured_main_args *context) - if (isdigit (pid_or_core_arg[0])) +@@ -1120,7 +1120,10 @@ captured_main_1 (struct captured_main_args *context) { - if (catch_command_errors (attach_command, pid_or_core_arg, -- !batch_flag) == 0) -+ !batch_flag) == 0 + ret = catch_command_errors (attach_command, pid_or_core_arg, + !batch_flag); +- if (ret == 0) ++ if (ret == 0 + /* attach_command could succeed partially and core_file_command + would try to kill it. */ + && !have_inferiors ()) - catch_command_errors (core_file_command, pid_or_core_arg, - !batch_flag); - } + ret = catch_command_errors (core_file_command, + pid_or_core_arg, + !batch_flag); diff --git a/gdb/testsuite/gdb.base/attach-kills.c b/gdb/testsuite/gdb.base/attach-kills.c new file mode 100644 --- /dev/null diff --git a/gdb-bz533176-fortran-omp-step.patch b/gdb-bz533176-fortran-omp-step.patch index c42c458..e2f9794 100644 --- a/gdb-bz533176-fortran-omp-step.patch +++ b/gdb-bz533176-fortran-omp-step.patch @@ -30,7 +30,7 @@ debugging problem of GOMP outside of the scope of this Bug. diff --git a/gdb/infrun.c b/gdb/infrun.c --- a/gdb/infrun.c +++ b/gdb/infrun.c -@@ -6694,6 +6694,16 @@ process_event_stop_test (struct execution_control_state *ecs) +@@ -6691,6 +6691,16 @@ process_event_stop_test (struct execution_control_state *ecs) if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL) { @@ -47,7 +47,7 @@ diff --git a/gdb/infrun.c b/gdb/infrun.c /* We're doing a "next". Normal (forward) execution: set a breakpoint at the -@@ -6727,6 +6737,7 @@ process_event_stop_test (struct execution_control_state *ecs) +@@ -6724,6 +6734,7 @@ process_event_stop_test (struct execution_control_state *ecs) keep_going (ecs); return; diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch index 912af65..a297bbe 100644 --- a/gdb-bz541866-rwatch-before-run.patch +++ b/gdb-bz541866-rwatch-before-run.patch @@ -10,7 +10,7 @@ Subject: gdb-bz541866-rwatch-before-run.patch diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -8801,7 +8801,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, +@@ -8789,7 +8789,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, int enabled, int internal, unsigned flags, int display_canonical) { @@ -19,7 +19,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c if (type == bp_hardware_breakpoint) { -@@ -14350,7 +14350,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition, +@@ -14340,7 +14340,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition, if (bpt->type == bp_hardware_breakpoint) { @@ -105,7 +105,7 @@ diff --git a/gdb/configure.nat b/gdb/configure.nat NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \ i386-linux-nat.o x86-linux-nat.o linux-btrace.o \ x86-linux.o x86-linux-dregs.o" -@@ -290,6 +291,7 @@ case ${gdb_host} in +@@ -294,6 +295,7 @@ case ${gdb_host} in case ${gdb_host_cpu} in i386) # Host: GNU/Linux x86-64 @@ -116,7 +116,7 @@ diff --git a/gdb/configure.nat b/gdb/configure.nat diff --git a/gdb/target.h b/gdb/target.h --- a/gdb/target.h +++ b/gdb/target.h -@@ -1953,9 +1953,11 @@ extern struct thread_info *target_thread_handle_to_thread_info +@@ -1983,9 +1983,11 @@ extern struct thread_info *target_thread_handle_to_thread_info one. OTHERTYPE is the number of watchpoints of other types than this one used so far. */ diff --git a/gdb-bz568248-oom-is-error.patch b/gdb-bz568248-oom-is-error.patch index f3f61da..491e7f5 100644 --- a/gdb-bz568248-oom-is-error.patch +++ b/gdb-bz568248-oom-is-error.patch @@ -53,7 +53,7 @@ gdb/ diff --git a/gdb/utils.c b/gdb/utils.c --- a/gdb/utils.c +++ b/gdb/utils.c -@@ -746,13 +746,11 @@ malloc_failure (long size) +@@ -719,13 +719,11 @@ malloc_failure (long size) { if (size > 0) { diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch index 2defc8d..b8e576d 100644 --- a/gdb-container-rh-pkg.patch +++ b/gdb-container-rh-pkg.patch @@ -9,7 +9,7 @@ Subject: gdb-container-rh-pkg.patch diff --git a/gdb/remote.c b/gdb/remote.c --- a/gdb/remote.c +++ b/gdb/remote.c -@@ -13909,7 +13909,17 @@ remote_target::pid_to_exec_file (int pid) +@@ -14010,7 +14010,17 @@ remote_target::pid_to_exec_file (int pid) char *annex = NULL; if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch index 5037e29..6b01919 100644 --- a/gdb-fedora-libncursesw.patch +++ b/gdb-fedora-libncursesw.patch @@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1270534 diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -9393,6 +9393,7 @@ if test x"$prefer_curses" = xyes; then +@@ -9362,6 +9362,7 @@ if test x"$prefer_curses" = xyes; then # search /usr/local/include, if ncurses is installed in /usr/local. A # default installation of ncurses on alpha*-dec-osf* will lead to such # a situation. @@ -20,7 +20,7 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 $as_echo_n "checking for library containing waddstr... " >&6; } if ${ac_cv_search_waddstr+:} false; then : -@@ -9417,7 +9418,7 @@ return waddstr (); +@@ -9386,7 +9387,7 @@ return waddstr (); return 0; } _ACEOF @@ -29,7 +29,7 @@ diff --git a/gdb/configure b/gdb/configure if test -z "$ac_lib"; then ac_res="none required" else -@@ -9491,6 +9492,7 @@ case $host_os in +@@ -9460,6 +9461,7 @@ case $host_os in esac # These are the libraries checked by Readline. @@ -37,7 +37,7 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 $as_echo_n "checking for library containing tgetent... " >&6; } if ${ac_cv_search_tgetent+:} false; then : -@@ -9515,7 +9517,7 @@ return tgetent (); +@@ -9484,7 +9486,7 @@ return tgetent (); return 0; } _ACEOF @@ -49,7 +49,7 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -766,7 +766,8 @@ if test x"$prefer_curses" = xyes; then +@@ -743,7 +743,8 @@ if test x"$prefer_curses" = xyes; then # search /usr/local/include, if ncurses is installed in /usr/local. A # default installation of ncurses on alpha*-dec-osf* will lead to such # a situation. @@ -59,7 +59,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac if test "$ac_cv_search_waddstr" != no; then curses_found=yes -@@ -808,7 +809,8 @@ case $host_os in +@@ -785,7 +786,8 @@ case $host_os in esac # These are the libraries checked by Readline. diff --git a/gdb-follow-child-stale-parent.patch b/gdb-follow-child-stale-parent.patch index ab3a765..9b7b0f5 100644 --- a/gdb-follow-child-stale-parent.patch +++ b/gdb-follow-child-stale-parent.patch @@ -24,7 +24,7 @@ unwinders try to access it, breaking: diff --git a/gdb/infrun.c b/gdb/infrun.c --- a/gdb/infrun.c +++ b/gdb/infrun.c -@@ -752,6 +752,9 @@ follow_fork (void) +@@ -754,6 +754,9 @@ follow_fork (void) } else { diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch index 2fec7cf..63bc7e3 100644 --- a/gdb-glibc-strstr-workaround.patch +++ b/gdb-glibc-strstr-workaround.patch @@ -9,7 +9,7 @@ Subject: gdb-glibc-strstr-workaround.patch diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -21270,6 +21270,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, +@@ -21443,6 +21443,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* Cache this symbol's name and the name's demangled form (if any). */ SYMBOL_SET_LANGUAGE (sym, cu->language, &objfile->objfile_obstack); linkagename = dwarf2_physname (name, die, cu); diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch index a20da46..c227f8a 100644 --- a/gdb-gnat-dwarf-crash-3of3.patch +++ b/gdb-gnat-dwarf-crash-3of3.patch @@ -42,7 +42,7 @@ gdb/ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -10499,6 +10499,13 @@ private: +@@ -10586,6 +10586,13 @@ private: static void process_die (struct die_info *die, struct dwarf2_cu *cu) { @@ -59,7 +59,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c diff --git a/gdb/infrun.c b/gdb/infrun.c --- a/gdb/infrun.c +++ b/gdb/infrun.c -@@ -607,6 +607,13 @@ holding the child stopped. Try \"set detach-on-fork\" or \ +@@ -609,6 +609,13 @@ holding the child stopped. Try \"set detach-on-fork\" or \ target_pid_to_str (process_ptid)); } @@ -86,10 +86,10 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c + +#endif + - /* The saved to_close method, inherited from inf-ptrace.c. - Called by our to_close. */ - static void (*super_close) (struct target_ops *); -@@ -1027,6 +1033,9 @@ linux_nat_post_attach_wait (ptid_t ptid, int *signalled) + static unsigned int debug_linux_nat; + static void + show_debug_linux_nat (struct ui_file *file, int from_tty, +@@ -1030,6 +1036,9 @@ linux_nat_post_attach_wait (ptid_t ptid, int *signalled) if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "LNPAW: Attaching to a stopped process\n"); @@ -99,7 +99,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c /* The process is definitely stopped. It is in a job control stop, unless the kernel predates the TASK_STOPPED / -@@ -1359,6 +1368,25 @@ get_detach_signal (struct lwp_info *lp) +@@ -1362,6 +1371,25 @@ get_detach_signal (struct lwp_info *lp) return gdb_signal_to_host (signo); } @@ -125,7 +125,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c return 0; } -@@ -1507,6 +1535,10 @@ linux_nat_target::detach (inferior *inf, int from_tty) +@@ -1510,6 +1538,10 @@ linux_nat_target::detach (inferior *inf, int from_tty) detach_one_lwp (main_lwp, &signo); detach_success (inf); @@ -136,7 +136,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c } } -@@ -1765,6 +1797,16 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo) +@@ -1768,6 +1800,16 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo) return; } diff --git a/gdb-jit-reader-multilib.patch b/gdb-jit-reader-multilib.patch index 2aa41c2..e676c9e 100644 --- a/gdb-jit-reader-multilib.patch +++ b/gdb-jit-reader-multilib.patch @@ -9,7 +9,7 @@ Subject: gdb-jit-reader-multilib.patch diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -9680,10 +9680,12 @@ _ACEOF +@@ -9649,10 +9649,12 @@ _ACEOF @@ -28,7 +28,7 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -843,10 +843,12 @@ AC_CHECK_SIZEOF(unsigned long long) +@@ -820,10 +820,12 @@ AC_CHECK_SIZEOF(unsigned long long) AC_CHECK_SIZEOF(unsigned long) AC_CHECK_SIZEOF(unsigned __int128) diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch index c7533f7..95e755f 100644 --- a/gdb-linux_perf-bundle.patch +++ b/gdb-linux_perf-bundle.patch @@ -9,7 +9,7 @@ Subject: gdb-linux_perf-bundle.patch diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -12059,7 +12059,7 @@ else +@@ -12028,7 +12028,7 @@ else #include #ifndef PERF_ATTR_SIZE_VER5 @@ -21,7 +21,7 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -1477,7 +1477,7 @@ else +@@ -1454,7 +1454,7 @@ else AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ #include #ifndef PERF_ATTR_SIZE_VER5 diff --git a/gdb-moribund-utrace-workaround.patch b/gdb-moribund-utrace-workaround.patch index e02e83c..1b26f7f 100644 --- a/gdb-moribund-utrace-workaround.patch +++ b/gdb-moribund-utrace-workaround.patch @@ -14,7 +14,7 @@ Bug in FSF GDB exploited by the ptrace-on-utrace interaction. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -12010,6 +12010,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode) +@@ -11998,6 +11998,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode) traps we can no longer explain. */ old_loc->events_till_retirement = 3 * (thread_count () + 1); @@ -22,4 +22,4 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c + old_loc->events_till_retirement *= 10; old_loc->owner = NULL; - VEC_safe_push (bp_location_p, moribund_locations, old_loc); + moribund_locations.push_back (old_loc); diff --git a/gdb-python-gil.patch b/gdb-python-gil.patch index 9ff2e45..b852854 100644 --- a/gdb-python-gil.patch +++ b/gdb-python-gil.patch @@ -9,7 +9,7 @@ Subject: gdb-python-gil.patch diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi -@@ -232,6 +232,14 @@ returned as a string. The default is @code{False}, in which case the +@@ -234,6 +234,14 @@ returned as a string. The default is @code{False}, in which case the return value is @code{None}. If @var{to_string} is @code{True}, the @value{GDBN} virtual terminal will be temporarily set to unlimited width and height, and its pagination will be disabled; @pxref{Screen Size}. @@ -27,7 +27,7 @@ diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h -@@ -148,6 +148,8 @@ typedef int Py_ssize_t; +@@ -144,6 +144,8 @@ typedef int Py_ssize_t; #define PyGILState_Release(ARG) ((void)(ARG)) #define PyEval_InitThreads() #define PyThreadState_Swap(ARG) ((void)(ARG)) @@ -39,7 +39,7 @@ diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h diff --git a/gdb/python/python.c b/gdb/python/python.c --- a/gdb/python/python.c +++ b/gdb/python/python.c -@@ -556,12 +556,16 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) +@@ -555,12 +555,16 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) { const char *arg; PyObject *from_tty_obj = NULL, *to_string_obj = NULL; @@ -60,7 +60,7 @@ diff --git a/gdb/python/python.c b/gdb/python/python.c return NULL; from_tty = 0; -@@ -582,6 +586,15 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) +@@ -581,6 +585,15 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) to_string = cmp; } @@ -76,7 +76,7 @@ diff --git a/gdb/python/python.c b/gdb/python/python.c std::string to_string_res; TRY -@@ -602,6 +615,13 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) +@@ -601,6 +614,13 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) counted_command_line lines = read_command_lines_1 (reader, 1, nullptr); @@ -87,17 +87,19 @@ diff --git a/gdb/python/python.c b/gdb/python/python.c + if (release_gil) + state = PyEval_SaveThread(); + - scoped_restore save_async = make_scoped_restore (¤t_ui->async, 0); + { + scoped_restore save_async = make_scoped_restore (¤t_ui->async, + 0); +@@ -620,12 +640,24 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) + execute_control_commands (lines.get (), from_tty); + } - scoped_restore save_uiout = make_scoped_restore (¤t_uiout); -@@ -617,10 +637,22 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) - from_tty); - else - execute_control_commands (lines.get (), from_tty); -+ + /* Reacquire the GIL if it was released earlier. */ + if (release_gil) + PyEval_RestoreThread (state); ++ + /* Do any commands attached to breakpoint we stopped at. */ + bpstat_do_actions (); } CATCH (except, RETURN_MASK_ALL) { diff --git a/gdb-rhbz1187581-power8-regs-1of7.patch b/gdb-rhbz1187581-power8-regs-1of7.patch deleted file mode 100644 index 29bd798..0000000 --- a/gdb-rhbz1187581-power8-regs-1of7.patch +++ /dev/null @@ -1,65 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Thu, 9 Aug 2018 17:09:48 +0200 -Subject: gdb-rhbz1187581-power8-regs-1of7.patch - -;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). - -commit 05abfc39c719e740530000059bb963ad33462479 -Author: Pedro Franco de Carvalho -Date: Mon Aug 6 16:24:55 2018 -0300 - - Fix indentation in remote_target::download_tracepoint - - gdb/ChangeLog: - 2018-08-06 Pedro Franco de Carvalho - - * remote.c (remote_target::download_tracepoint): Fix indentation - in for block. - -diff --git a/gdb/remote.c b/gdb/remote.c ---- a/gdb/remote.c -+++ b/gdb/remote.c -@@ -12912,24 +12912,24 @@ remote_target::download_tracepoint (struct bp_location *loc) - error (_("Error on target while setting tracepoints.")); - } - -- for (auto action_it = stepping_actions.begin (); -- action_it != stepping_actions.end (); action_it++) -- { -- QUIT; /* Allow user to bail out with ^C. */ -- -- bool is_first = action_it == stepping_actions.begin (); -- bool has_more = action_it != stepping_actions.end (); -- -- xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s", -- b->number, addrbuf, /* address */ -- is_first ? "S" : "", -- action_it->c_str (), -- has_more ? "-" : ""); -- putpkt (buf); -- remote_get_noisy_reply (); -- if (strcmp (rs->buf, "OK")) -- error (_("Error on target while setting tracepoints.")); -- } -+ for (auto action_it = stepping_actions.begin (); -+ action_it != stepping_actions.end (); action_it++) -+ { -+ QUIT; /* Allow user to bail out with ^C. */ -+ -+ bool is_first = action_it == stepping_actions.begin (); -+ bool has_more = action_it != stepping_actions.end (); -+ -+ xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s", -+ b->number, addrbuf, /* address */ -+ is_first ? "S" : "", -+ action_it->c_str (), -+ has_more ? "-" : ""); -+ putpkt (buf); -+ remote_get_noisy_reply (); -+ if (strcmp (rs->buf, "OK")) -+ error (_("Error on target while setting tracepoints.")); -+ } - - if (packet_support (PACKET_TracepointSource) == PACKET_ENABLE) - { diff --git a/gdb-rhbz1187581-power8-regs-2of7.patch b/gdb-rhbz1187581-power8-regs-2of7.patch deleted file mode 100644 index b0d42cd..0000000 --- a/gdb-rhbz1187581-power8-regs-2of7.patch +++ /dev/null @@ -1,45 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Thu, 9 Aug 2018 17:10:46 +0200 -Subject: gdb-rhbz1187581-power8-regs-2of7.patch - -;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). - -commit aa6f3694ce867884e43d1c0406c64df08ea24bd3 -Author: Pedro Franco de Carvalho -Date: Mon Aug 6 16:24:55 2018 -0300 - - Remove trailing '-' from the last QTDP action packet - - The has_more predicate in remote_target::download_tracepoint always - evaluates to true, so the last action packet will be sent with a - trailing '-'. This patch changes the predicate to remove the last - trailing '-'. - - gdb/ChangeLog: - 2018-08-06 Pedro Franco de Carvalho - - * remote.c (remote_target::download_tracepoint): Fix the has_more - predicate in the QTDP action list iteration. - -diff --git a/gdb/remote.c b/gdb/remote.c ---- a/gdb/remote.c -+++ b/gdb/remote.c -@@ -12899,7 +12899,7 @@ remote_target::download_tracepoint (struct bp_location *loc) - { - QUIT; /* Allow user to bail out with ^C. */ - -- bool has_more = (action_it != tdp_actions.end () -+ bool has_more = ((action_it + 1) != tdp_actions.end () - || !stepping_actions.empty ()); - - xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%c", -@@ -12918,7 +12918,7 @@ remote_target::download_tracepoint (struct bp_location *loc) - QUIT; /* Allow user to bail out with ^C. */ - - bool is_first = action_it == stepping_actions.begin (); -- bool has_more = action_it != stepping_actions.end (); -+ bool has_more = (action_it + 1) != stepping_actions.end (); - - xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s", - b->number, addrbuf, /* address */ diff --git a/gdb-rhbz1187581-power8-regs-3of7.patch b/gdb-rhbz1187581-power8-regs-3of7.patch deleted file mode 100644 index 5546f2b..0000000 --- a/gdb-rhbz1187581-power8-regs-3of7.patch +++ /dev/null @@ -1,258 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Thu, 9 Aug 2018 17:11:09 +0200 -Subject: gdb-rhbz1187581-power8-regs-3of7.patch - -;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). - -commit 3df3a985a475db004706d64f83d9085f99053611 -Author: Pedro Franco de Carvalho -Date: Mon Aug 6 16:24:55 2018 -0300 - - Use get_remote_packet_size in download_tracepoint - - This patch changes the remote target to use the remote packet size to - build QTDP packets, and to check if there is enough room for the - packet. - - I changed the function to raise an error if the packet is too small, - instead of aborting gdb (through xsnprintf). It isn't clear if gdb - will be in a consistent state with respect to the stub after this, - since it's possible that some packets will be sent but not others, and - there could be an incomplete tracepoint on the stub. - - The char array used to build the packets is changed to a - gdb::char_vector and sized with the result from - get_remote_packet_size. - - When checking if the buffer is large enough to hold the tracepoint - condition agent expression, the length of the expression is multiplied - by two, since it is encoded with two hex digits per expression - byte. For simplicity, I assume that the result won't overflow, which - can happen for very long condition expressions. - - gdb/ChangeLog: - 2018-08-06 Pedro Franco de Carvalho - - * remote.c (remote_target::download_tracepoint): Remove BUF_SIZE. - Replace array buf with gdb::char_vector buf, of size - get_remote_packet_size (). Replace references to buf and - BUF_SIZE to buf.data () and buf.size (). Replace strcpy, strcat - and xsnprintf with snprintf. Raise errors if the buffer is too - small. - -diff --git a/gdb/remote.c b/gdb/remote.c ---- a/gdb/remote.c -+++ b/gdb/remote.c -@@ -12799,26 +12799,35 @@ remote_target::remote_download_command_source (int num, ULONGEST addr, - void - remote_target::download_tracepoint (struct bp_location *loc) - { --#define BUF_SIZE 2048 -- - CORE_ADDR tpaddr; - char addrbuf[40]; -- char buf[BUF_SIZE]; - std::vector tdp_actions; - std::vector stepping_actions; - char *pkt; - struct breakpoint *b = loc->owner; - struct tracepoint *t = (struct tracepoint *) b; - struct remote_state *rs = get_remote_state (); -+ int ret; -+ char *err_msg = _("Tracepoint packet too large for target."); -+ size_t size_left; -+ -+ /* We use a buffer other than rs->buf because we'll build strings -+ across multiple statements, and other statements in between could -+ modify rs->buf. */ -+ gdb::char_vector buf (get_remote_packet_size ()); - - encode_actions_rsp (loc, &tdp_actions, &stepping_actions); - - tpaddr = loc->address; - sprintf_vma (addrbuf, tpaddr); -- xsnprintf (buf, BUF_SIZE, "QTDP:%x:%s:%c:%lx:%x", b->number, -- addrbuf, /* address */ -- (b->enable_state == bp_enabled ? 'E' : 'D'), -- t->step_count, t->pass_count); -+ ret = snprintf (buf.data (), buf.size (), "QTDP:%x:%s:%c:%lx:%x", -+ b->number, addrbuf, /* address */ -+ (b->enable_state == bp_enabled ? 'E' : 'D'), -+ t->step_count, t->pass_count); -+ -+ if (ret < 0 || ret >= buf.size ()) -+ error (err_msg); -+ - /* Fast tracepoints are mostly handled by the target, but we can - tell the target how big of an instruction block should be moved - around. */ -@@ -12830,8 +12839,15 @@ remote_target::download_tracepoint (struct bp_location *loc) - { - if (gdbarch_fast_tracepoint_valid_at (loc->gdbarch, tpaddr, - NULL)) -- xsnprintf (buf + strlen (buf), BUF_SIZE - strlen (buf), ":F%x", -- gdb_insn_length (loc->gdbarch, tpaddr)); -+ { -+ size_left = buf.size () - strlen (buf.data ()); -+ ret = snprintf (buf.data () + strlen (buf.data ()), -+ size_left, ":F%x", -+ gdb_insn_length (loc->gdbarch, tpaddr)); -+ -+ if (ret < 0 || ret >= size_left) -+ error (err_msg); -+ } - else - /* If it passed validation at definition but fails now, - something is very wrong. */ -@@ -12855,7 +12871,14 @@ remote_target::download_tracepoint (struct bp_location *loc) - struct static_tracepoint_marker marker; - - if (target_static_tracepoint_marker_at (tpaddr, &marker)) -- strcat (buf, ":S"); -+ { -+ size_left = buf.size () - strlen (buf.data ()); -+ ret = snprintf (buf.data () + strlen (buf.data ()), -+ size_left, ":S"); -+ -+ if (ret < 0 || ret >= size_left) -+ error (err_msg); -+ } - else - error (_("Static tracepoint not valid during download")); - } -@@ -12873,10 +12896,26 @@ remote_target::download_tracepoint (struct bp_location *loc) - capabilities at definition time. */ - if (remote_supports_cond_tracepoints ()) - { -- agent_expr_up aexpr = gen_eval_for_expr (tpaddr, loc->cond.get ()); -- xsnprintf (buf + strlen (buf), BUF_SIZE - strlen (buf), ":X%x,", -- aexpr->len); -- pkt = buf + strlen (buf); -+ agent_expr_up aexpr = gen_eval_for_expr (tpaddr, -+ loc->cond.get ()); -+ -+ size_left = buf.size () - strlen (buf.data ()); -+ -+ ret = snprintf (buf.data () + strlen (buf.data ()), -+ size_left, ":X%x,", aexpr->len); -+ -+ if (ret < 0 || ret >= size_left) -+ error (err_msg); -+ -+ size_left = buf.size () - strlen (buf.data ()); -+ -+ /* Two bytes to encode each aexpr byte, plus the terminating -+ null byte. */ -+ if (aexpr->len * 2 + 1 > size_left) -+ error (err_msg); -+ -+ pkt = buf.data () + strlen (buf.data ()); -+ - for (int ndx = 0; ndx < aexpr->len; ++ndx) - pkt = pack_hex_byte (pkt, aexpr->buf[ndx]); - *pkt = '\0'; -@@ -12887,8 +12926,17 @@ remote_target::download_tracepoint (struct bp_location *loc) - } - - if (b->commands || *default_collect) -- strcat (buf, "-"); -- putpkt (buf); -+ { -+ size_left = buf.size () - strlen (buf.data ()); -+ -+ ret = snprintf (buf.data () + strlen (buf.data ()), -+ size_left, "-"); -+ -+ if (ret < 0 || ret >= size_left) -+ error (err_msg); -+ } -+ -+ putpkt (buf.data ()); - remote_get_noisy_reply (); - if (strcmp (rs->buf, "OK")) - error (_("Target does not support tracepoints.")); -@@ -12902,11 +12950,15 @@ remote_target::download_tracepoint (struct bp_location *loc) - bool has_more = ((action_it + 1) != tdp_actions.end () - || !stepping_actions.empty ()); - -- xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%c", -- b->number, addrbuf, /* address */ -- action_it->c_str (), -- has_more ? '-' : 0); -- putpkt (buf); -+ ret = snprintf (buf.data (), buf.size (), "QTDP:-%x:%s:%s%c", -+ b->number, addrbuf, /* address */ -+ action_it->c_str (), -+ has_more ? '-' : 0); -+ -+ if (ret < 0 || ret >= buf.size ()) -+ error (err_msg); -+ -+ putpkt (buf.data ()); - remote_get_noisy_reply (); - if (strcmp (rs->buf, "OK")) - error (_("Error on target while setting tracepoints.")); -@@ -12920,12 +12972,16 @@ remote_target::download_tracepoint (struct bp_location *loc) - bool is_first = action_it == stepping_actions.begin (); - bool has_more = (action_it + 1) != stepping_actions.end (); - -- xsnprintf (buf, BUF_SIZE, "QTDP:-%x:%s:%s%s%s", -- b->number, addrbuf, /* address */ -- is_first ? "S" : "", -- action_it->c_str (), -- has_more ? "-" : ""); -- putpkt (buf); -+ ret = snprintf (buf.data (), buf.size (), "QTDP:-%x:%s:%s%s%s", -+ b->number, addrbuf, /* address */ -+ is_first ? "S" : "", -+ action_it->c_str (), -+ has_more ? "-" : ""); -+ -+ if (ret < 0 || ret >= buf.size ()) -+ error (err_msg); -+ -+ putpkt (buf.data ()); - remote_get_noisy_reply (); - if (strcmp (rs->buf, "OK")) - error (_("Error on target while setting tracepoints.")); -@@ -12935,22 +12991,32 @@ remote_target::download_tracepoint (struct bp_location *loc) - { - if (b->location != NULL) - { -- strcpy (buf, "QTDPsrc:"); -+ ret = snprintf (buf.data (), buf.size (), "QTDPsrc:"); -+ -+ if (ret < 0 || ret >= buf.size ()) -+ error (err_msg); -+ - encode_source_string (b->number, loc->address, "at", - event_location_to_string (b->location.get ()), -- buf + strlen (buf), 2048 - strlen (buf)); -- putpkt (buf); -+ buf.data () + strlen (buf.data ()), -+ buf.size () - strlen (buf.data ())); -+ putpkt (buf.data ()); - remote_get_noisy_reply (); - if (strcmp (rs->buf, "OK")) - warning (_("Target does not support source download.")); - } - if (b->cond_string) - { -- strcpy (buf, "QTDPsrc:"); -+ ret = snprintf (buf.data (), buf.size (), "QTDPsrc:"); -+ -+ if (ret < 0 || ret >= buf.size ()) -+ error (err_msg); -+ - encode_source_string (b->number, loc->address, -- "cond", b->cond_string, buf + strlen (buf), -- 2048 - strlen (buf)); -- putpkt (buf); -+ "cond", b->cond_string, -+ buf.data () + strlen (buf.data ()), -+ buf.size () - strlen (buf.data ())); -+ putpkt (buf.data ()); - remote_get_noisy_reply (); - if (strcmp (rs->buf, "OK")) - warning (_("Target does not support source download.")); diff --git a/gdb-rhbz1187581-power8-regs-4of7.patch b/gdb-rhbz1187581-power8-regs-4of7.patch deleted file mode 100644 index 8c553a8..0000000 --- a/gdb-rhbz1187581-power8-regs-4of7.patch +++ /dev/null @@ -1,449 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Thu, 9 Aug 2018 17:17:16 +0200 -Subject: gdb-rhbz1187581-power8-regs-4of7.patch - -;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). - -commit 4277c4b87addb5354cc47b98d7a73e44cfaf22c2 -Author: Pedro Franco de Carvalho -Date: Mon Aug 6 16:24:55 2018 -0300 - - Use remote register numbers in tracepoint mask - - Currently, tracepoint register masks in the QTDP packets include both - internal and remote register numbers, as well as pseudo-register - numbers. - - This patch changes this so that the mask only includes remote register - numbers. - - Register numbers from agent expressions are already set in the mask - using remote numbers. Other tracepoint actions used internal numbers, - e.g. "collect $regs" or "collect $". To handle pseudoreg - numbers, an empty agent expression is created and ax_reg_mask is - called for this expression and the pseudoreg. This will cause the ax - to set its mask with the corresponding remote raw register - numbers (using ax_regs_mask, which calls - gdbarch_ax_pseudo_register_collect). - - If ax_regs_mask and gdbarch_ax_pseudo_register_collect also generate - more ax bytecode, the ax is also appended to the collection list. It - isn't clear that this was the original intent for - gdbarch_ax_pseudo_register_collect, and none of the arches seem to do - this, but if this changes in the future, it should work. - - The patch also refactors the code used by validate_action line to - validate axs into a function that is now called from every place that - generates axs. Previously, some parts of tracepoint.c that generated - axs didn't check if the ax length was greater than MAX_AGENT_EXPR_LEN. - - gdb/ChangeLog: - 2018-08-06 Pedro Franco de Carvalho - - * tracepoint.h (class collection_list) : Remove. - : - Declare. - : Add scope parameter. - * tracepoint.c (encode_actions_1): Likewise. - (collection_list::add_register): Rename to ... - (collection_list::add_remote_register): ... this. Update - comment. - (collection_list::add_ax_registers, add_local_register): New - methods. - (collection_list::add_memrange): Add scope parameter. Call - add_local_register instead of add_register. - (finalize_tracepoint_aexpr): New function. - (collection_list::collect_symbol): Update calls to add_memrange. - Call add_local_register instead of add_register. Call - add_ax_registers. Call finalize_tracepoint_aexpr. - (encode_actions_1): Get remote regnos for $reg action. Call - add_remote_register, add_ax_registers, and add_local_register. - Update call to add_memrange. Call finalize_tracepoint_aexpr. - (validate_actionline): Call finalize_tracepoint_aexpr. - -+2018-08-06 Pedro Franco de Carvalho -+ -+ * tracepoint.h (class collection_list) : Remove. -+ : -+ Declare. -+ : Add scope parameter. -+ * tracepoint.c (encode_actions_1): Likewise. -+ (collection_list::add_register): Rename to ... -+ (collection_list::add_remote_register): ... this. Update -+ comment. -+ (collection_list::add_ax_registers, add_local_register): New -+ methods. -+ (collection_list::add_memrange): Add scope parameter. Call -+ add_local_register instead of add_register. -+ (finalize_tracepoint_aexpr): New function. -+ (collection_list::collect_symbol): Update calls to add_memrange. -+ Call add_local_register instead of add_register. Call -+ add_ax_registers. Call finalize_tracepoint_aexpr. -+ (encode_actions_1): Get remote regnos for $reg action. Call -+ add_remote_register, add_ax_registers, and add_local_register. -+ Update call to add_memrange. Call finalize_tracepoint_aexpr. -+ (validate_actionline): Call finalize_tracepoint_aexpr. -+ - 2018-08-06 Pedro Franco de Carvalho - - * remote.c (remote_target::download_tracepoint): Remove BUF_SIZE. - -diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c ---- a/gdb/tracepoint.c -+++ b/gdb/tracepoint.c -@@ -615,6 +615,19 @@ report_agent_reqs_errors (struct agent_expr *aexpr) - error (_("Expression is too complicated.")); - } - -+/* Call ax_reqs on AEXPR and raise an error if something is wrong. */ -+ -+static void -+finalize_tracepoint_aexpr (struct agent_expr *aexpr) -+{ -+ ax_reqs (aexpr); -+ -+ if (aexpr->len > MAX_AGENT_EXPR_LEN) -+ error (_("Expression is too complicated.")); -+ -+ report_agent_reqs_errors (aexpr); -+} -+ - /* worker function */ - void - validate_actionline (const char *line, struct breakpoint *b) -@@ -699,12 +712,7 @@ validate_actionline (const char *line, struct breakpoint *b) - exp.get (), - trace_string); - -- if (aexpr->len > MAX_AGENT_EXPR_LEN) -- error (_("Expression is too complicated.")); -- -- ax_reqs (aexpr.get ()); -- -- report_agent_reqs_errors (aexpr.get ()); -+ finalize_tracepoint_aexpr (aexpr.get ()); - } - } - while (p && *p++ == ','); -@@ -731,11 +739,7 @@ validate_actionline (const char *line, struct breakpoint *b) - long. */ - agent_expr_up aexpr = gen_eval_for_expr (loc->address, exp.get ()); - -- if (aexpr->len > MAX_AGENT_EXPR_LEN) -- error (_("Expression is too complicated.")); -- -- ax_reqs (aexpr.get ()); -- report_agent_reqs_errors (aexpr.get ()); -+ finalize_tracepoint_aexpr (aexpr.get ()); - } - } - while (p && *p++ == ','); -@@ -811,10 +815,10 @@ memrange_sortmerge (std::vector &memranges) - } - } - --/* Add a register to a collection list. */ -+/* Add remote register number REGNO to the collection list mask. */ - - void --collection_list::add_register (unsigned int regno) -+collection_list::add_remote_register (unsigned int regno) - { - if (info_verbose) - printf_filtered ("collect register %d\n", regno); -@@ -824,12 +828,74 @@ collection_list::add_register (unsigned int regno) - m_regs_mask[regno / 8] |= 1 << (regno % 8); - } - -+/* Add all the registers from the mask in AEXPR to the mask in the -+ collection list. Registers in the AEXPR mask are already remote -+ register numbers. */ -+ -+void -+collection_list::add_ax_registers (struct agent_expr *aexpr) -+{ -+ if (aexpr->reg_mask_len > 0) -+ { -+ for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++) -+ { -+ QUIT; /* Allow user to bail out with ^C. */ -+ if (aexpr->reg_mask[ndx1] != 0) -+ { -+ /* Assume chars have 8 bits. */ -+ for (int ndx2 = 0; ndx2 < 8; ndx2++) -+ if (aexpr->reg_mask[ndx1] & (1 << ndx2)) -+ /* It's used -- record it. */ -+ add_remote_register (ndx1 * 8 + ndx2); -+ } -+ } -+ } -+} -+ -+/* If REGNO is raw, add its corresponding remote register number to -+ the mask. If REGNO is a pseudo-register, figure out the necessary -+ registers using a temporary agent expression, and add it to the -+ list if it needs more than just a mask. */ -+ -+void -+collection_list::add_local_register (struct gdbarch *gdbarch, -+ unsigned int regno, -+ CORE_ADDR scope) -+{ -+ if (regno < gdbarch_num_regs (gdbarch)) -+ { -+ int remote_regno = gdbarch_remote_register_number (gdbarch, regno); -+ -+ if (remote_regno < 0) -+ error (_("Can't collect register %d"), regno); -+ -+ add_remote_register (remote_regno); -+ } -+ else -+ { -+ agent_expr_up aexpr (new agent_expr (gdbarch, scope)); -+ -+ ax_reg_mask (aexpr.get (), regno); -+ -+ finalize_tracepoint_aexpr (aexpr.get ()); -+ -+ add_ax_registers (aexpr.get ()); -+ -+ /* Usually ax_reg_mask for a pseudo-regiser only sets the -+ corresponding raw registers in the ax mask, but if this isn't -+ the case add the expression that is generated to the -+ collection list. */ -+ if (aexpr->len > 0) -+ add_aexpr (std::move (aexpr)); -+ } -+} -+ - /* Add a memrange to a collection list. */ - - void - collection_list::add_memrange (struct gdbarch *gdbarch, - int type, bfd_signed_vma base, -- ULONGEST len) -+ ULONGEST len, CORE_ADDR scope) - { - if (info_verbose) - printf_filtered ("(%d,%s,%s)\n", type, paddress (gdbarch, base), pulongest (len)); -@@ -840,7 +906,7 @@ collection_list::add_memrange (struct gdbarch *gdbarch, - m_memranges.emplace_back (type, base, base + len); - - if (type != memrange_absolute) /* Better collect the base register! */ -- add_register (type); -+ add_local_register (gdbarch, type, scope); - } - - /* Add a symbol to a collection list. */ -@@ -882,19 +948,19 @@ collection_list::collect_symbol (struct symbol *sym, - if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT) - treat_as_expr = 1; - else -- add_memrange (gdbarch, memrange_absolute, offset, len); -+ add_memrange (gdbarch, memrange_absolute, offset, len, scope); - break; - case LOC_REGISTER: - reg = SYMBOL_REGISTER_OPS (sym)->register_number (sym, gdbarch); - if (info_verbose) - printf_filtered ("LOC_REG[parm] %s: ", - SYMBOL_PRINT_NAME (sym)); -- add_register (reg); -+ add_local_register (gdbarch, reg, scope); - /* Check for doubles stored in two registers. */ - /* FIXME: how about larger types stored in 3 or more regs? */ - if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FLT && - len > register_size (gdbarch, reg)) -- add_register (reg + 1); -+ add_local_register (gdbarch, reg + 1, scope); - break; - case LOC_REF_ARG: - printf_filtered ("Sorry, don't know how to do LOC_REF_ARG yet.\n"); -@@ -911,7 +977,7 @@ collection_list::collect_symbol (struct symbol *sym, - SYMBOL_PRINT_NAME (sym), pulongest (len), - paddress (gdbarch, offset), reg); - } -- add_memrange (gdbarch, reg, offset, len); -+ add_memrange (gdbarch, reg, offset, len, scope); - break; - case LOC_REGPARM_ADDR: - reg = SYMBOL_VALUE (sym); -@@ -923,7 +989,7 @@ collection_list::collect_symbol (struct symbol *sym, - SYMBOL_PRINT_NAME (sym), pulongest (len), - paddress (gdbarch, offset), reg); - } -- add_memrange (gdbarch, reg, offset, len); -+ add_memrange (gdbarch, reg, offset, len, scope); - break; - case LOC_LOCAL: - reg = frame_regno; -@@ -935,7 +1001,7 @@ collection_list::collect_symbol (struct symbol *sym, - SYMBOL_PRINT_NAME (sym), pulongest (len), - paddress (gdbarch, offset), reg); - } -- add_memrange (gdbarch, reg, offset, len); -+ add_memrange (gdbarch, reg, offset, len, scope); - break; - - case LOC_UNRESOLVED: -@@ -968,26 +1034,10 @@ collection_list::collect_symbol (struct symbol *sym, - return; - } - -- ax_reqs (aexpr.get ()); -- -- report_agent_reqs_errors (aexpr.get ()); -+ finalize_tracepoint_aexpr (aexpr.get ()); - - /* Take care of the registers. */ -- if (aexpr->reg_mask_len > 0) -- { -- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++) -- { -- QUIT; /* Allow user to bail out with ^C. */ -- if (aexpr->reg_mask[ndx1] != 0) -- { -- /* Assume chars have 8 bits. */ -- for (int ndx2 = 0; ndx2 < 8; ndx2++) -- if (aexpr->reg_mask[ndx1] & (1 << ndx2)) -- /* It's used -- record it. */ -- add_register (ndx1 * 8 + ndx2); -- } -- } -- } -+ add_ax_registers (aexpr.get ()); - - add_aexpr (std::move (aexpr)); - } -@@ -1257,8 +1307,18 @@ encode_actions_1 (struct command_line *action, - - if (0 == strncasecmp ("$reg", action_exp, 4)) - { -- for (i = 0; i < gdbarch_num_regs (target_gdbarch ()); i++) -- collect->add_register (i); -+ for (i = 0; i < gdbarch_num_regs (target_gdbarch ()); -+ i++) -+ { -+ int remote_regno = (gdbarch_remote_register_number -+ (target_gdbarch (), i)); -+ -+ /* Ignore arch regnos without a corresponding -+ remote regno. This can happen for regnos not -+ in the tdesc. */ -+ if (remote_regno >= 0) -+ collect->add_remote_register (remote_regno); -+ } - action_exp = strchr (action_exp, ','); /* more? */ - } - else if (0 == strncasecmp ("$arg", action_exp, 4)) -@@ -1288,27 +1348,10 @@ encode_actions_1 (struct command_line *action, - target_gdbarch (), - trace_string); - -- ax_reqs (aexpr.get ()); -- report_agent_reqs_errors (aexpr.get ()); -+ finalize_tracepoint_aexpr (aexpr.get ()); - - /* take care of the registers */ -- if (aexpr->reg_mask_len > 0) -- { -- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++) -- { -- QUIT; /* allow user to bail out with ^C */ -- if (aexpr->reg_mask[ndx1] != 0) -- { -- /* assume chars have 8 bits */ -- for (int ndx2 = 0; ndx2 < 8; ndx2++) -- if (aexpr->reg_mask[ndx1] & (1 << ndx2)) -- { -- /* It's used -- record it. */ -- collect->add_register (ndx1 * 8 + ndx2); -- } -- } -- } -- } -+ collect->add_ax_registers (aexpr.get ()); - - collect->add_aexpr (std::move (aexpr)); - action_exp = strchr (action_exp, ','); /* more? */ -@@ -1340,7 +1383,8 @@ encode_actions_1 (struct command_line *action, - name); - if (info_verbose) - printf_filtered ("OP_REGISTER: "); -- collect->add_register (i); -+ collect->add_local_register (target_gdbarch (), -+ i, tloc->address); - break; - } - -@@ -1352,7 +1396,8 @@ encode_actions_1 (struct command_line *action, - check_typedef (exp->elts[1].type); - collect->add_memrange (target_gdbarch (), - memrange_absolute, addr, -- TYPE_LENGTH (exp->elts[1].type)); -+ TYPE_LENGTH (exp->elts[1].type), -+ tloc->address); - collect->append_exp (exp.get ()); - break; - -@@ -1376,28 +1421,10 @@ encode_actions_1 (struct command_line *action, - exp.get (), - trace_string); - -- ax_reqs (aexpr.get ()); -- -- report_agent_reqs_errors (aexpr.get ()); -+ finalize_tracepoint_aexpr (aexpr.get ()); - - /* Take care of the registers. */ -- if (aexpr->reg_mask_len > 0) -- { -- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++) -- { -- QUIT; /* Allow user to bail out with ^C. */ -- if (aexpr->reg_mask[ndx1] != 0) -- { -- /* Assume chars have 8 bits. */ -- for (int ndx2 = 0; ndx2 < 8; ndx2++) -- if (aexpr->reg_mask[ndx1] & (1 << ndx2)) -- { -- /* It's used -- record it. */ -- collect->add_register (ndx1 * 8 + ndx2); -- } -- } -- } -- } -+ collect->add_ax_registers (aexpr.get ()); - - collect->add_aexpr (std::move (aexpr)); - collect->append_exp (exp.get ()); -@@ -1422,8 +1449,7 @@ encode_actions_1 (struct command_line *action, - agent_expr_up aexpr = gen_eval_for_expr (tloc->address, - exp.get ()); - -- ax_reqs (aexpr.get ()); -- report_agent_reqs_errors (aexpr.get ()); -+ finalize_tracepoint_aexpr (aexpr.get ()); - - /* Even though we're not officially collecting, add - to the collect list anyway. */ -diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h ---- a/gdb/tracepoint.h -+++ b/gdb/tracepoint.h -@@ -263,9 +263,14 @@ public: - void add_aexpr (agent_expr_up aexpr); - - void add_register (unsigned int regno); -+ void add_remote_register (unsigned int regno); -+ void add_ax_registers (struct agent_expr *aexpr); -+ void add_local_register (struct gdbarch *gdbarch, -+ unsigned int regno, -+ CORE_ADDR scope); - void add_memrange (struct gdbarch *gdbarch, - int type, bfd_signed_vma base, -- ULONGEST len); -+ ULONGEST len, CORE_ADDR scope); - void collect_symbol (struct symbol *sym, - struct gdbarch *gdbarch, - long frame_regno, long frame_offset, diff --git a/gdb-rhbz1187581-power8-regs-5of7.patch b/gdb-rhbz1187581-power8-regs-5of7.patch deleted file mode 100644 index eaca52f..0000000 --- a/gdb-rhbz1187581-power8-regs-5of7.patch +++ /dev/null @@ -1,215 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Thu, 9 Aug 2018 17:17:46 +0200 -Subject: gdb-rhbz1187581-power8-regs-5of7.patch - -;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). - -commit a04b9d62a234923826e431a209d396a628661548 -Author: Pedro Franco de Carvalho -Date: Mon Aug 6 16:24:55 2018 -0300 - - Variable size for regs mask in collection list - - This patch changes collection_list to allow larger register masks. - - The mask is changed from an array to a vector and is initialized to - hold the maximum possible remote register number. The stringify - method is updated to resize temp_buf if needed. - - gdb/ChangeLog: - 2018-08-06 Pedro Franco de Carvalho - - * tracepoint.h (collection_list) : Change type to - std::vector. - * tracepoint.c (collection_list::collection_list): Remove - m_regs_mask initializer from initializer list. Resize - m_regs_mask using the largest remote register number. - (collection_list::add_remote_register): Remove size check on - m_regs_mask. Use at to access element. - (collection_list::stringify): Change type of temp_buf to - gdb::char_vector. Update uses of temp_buf. Resize if needed to - stringify the register mask. Use pack_hex_byte for the register - mask. - -+2018-08-06 Pedro Franco de Carvalho -+ -+ * tracepoint.h (collection_list) : Change type to -+ std::vector. -+ * tracepoint.c (collection_list::collection_list): Remove -+ m_regs_mask initializer from initializer list. Resize -+ m_regs_mask using the largest remote register number. -+ (collection_list::add_remote_register): Remove size check on -+ m_regs_mask. Use at to access element. -+ (collection_list::stringify): Change type of temp_buf to -+ gdb::char_vector. Update uses of temp_buf. Resize if needed to -+ stringify the register mask. Use pack_hex_byte for the register -+ mask. -+ - 2018-08-06 Pedro Franco de Carvalho - - * tracepoint.h (class collection_list) : Remove. - -diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c ---- a/gdb/tracepoint.c -+++ b/gdb/tracepoint.c -@@ -822,10 +822,8 @@ collection_list::add_remote_register (unsigned int regno) - { - if (info_verbose) - printf_filtered ("collect register %d\n", regno); -- if (regno >= (8 * sizeof (m_regs_mask))) -- error (_("Internal: register number %d too large for tracepoint"), -- regno); -- m_regs_mask[regno / 8] |= 1 << (regno % 8); -+ -+ m_regs_mask.at (regno / 8) |= 1 << (regno % 8); - } - - /* Add all the registers from the mask in AEXPR to the mask in the -@@ -1136,9 +1134,20 @@ collection_list::add_static_trace_data () - } - - collection_list::collection_list () -- : m_regs_mask (), -- m_strace_data (false) -+ : m_strace_data (false) - { -+ int max_remote_regno = 0; -+ for (int i = 0; i < gdbarch_num_regs (target_gdbarch ()); i++) -+ { -+ int remote_regno = (gdbarch_remote_register_number -+ (target_gdbarch (), i)); -+ -+ if (remote_regno >= 0 && remote_regno > max_remote_regno) -+ max_remote_regno = remote_regno; -+ } -+ -+ m_regs_mask.resize ((max_remote_regno / 8) + 1); -+ - m_memranges.reserve (128); - m_aexprs.reserve (128); - } -@@ -1148,7 +1157,8 @@ collection_list::collection_list () - std::vector - collection_list::stringify () - { -- char temp_buf[2048]; -+ gdb::char_vector temp_buf (2048); -+ - int count; - char *end; - long i; -@@ -1158,35 +1168,45 @@ collection_list::stringify () - { - if (info_verbose) - printf_filtered ("\nCollecting static trace data\n"); -- end = temp_buf; -+ end = temp_buf.data (); - *end++ = 'L'; -- str_list.emplace_back (temp_buf, end - temp_buf); -+ str_list.emplace_back (temp_buf.data (), end - temp_buf.data ()); - } - -- for (i = sizeof (m_regs_mask) - 1; i > 0; i--) -+ for (i = m_regs_mask.size () - 1; i > 0; i--) - if (m_regs_mask[i] != 0) /* Skip leading zeroes in regs_mask. */ - break; - if (m_regs_mask[i] != 0) /* Prepare to send regs_mask to the stub. */ - { - if (info_verbose) - printf_filtered ("\nCollecting registers (mask): 0x"); -- end = temp_buf; -+ -+ /* One char for 'R', one for the null terminator and two per -+ mask byte. */ -+ std::size_t new_size = (i + 1) * 2 + 2; -+ if (new_size > temp_buf.size ()) -+ temp_buf.resize (new_size); -+ -+ end = temp_buf.data (); - *end++ = 'R'; - for (; i >= 0; i--) - { - QUIT; /* Allow user to bail out with ^C. */ - if (info_verbose) - printf_filtered ("%02X", m_regs_mask[i]); -- sprintf (end, "%02X", m_regs_mask[i]); -- end += 2; -+ -+ end = pack_hex_byte (end, m_regs_mask[i]); - } -- str_list.emplace_back (temp_buf); -+ *end = '\0'; -+ -+ str_list.emplace_back (temp_buf.data ()); - } - if (info_verbose) - printf_filtered ("\n"); - if (!m_memranges.empty () && info_verbose) - printf_filtered ("Collecting memranges: \n"); -- for (i = 0, count = 0, end = temp_buf; i < m_memranges.size (); i++) -+ for (i = 0, count = 0, end = temp_buf.data (); -+ i < m_memranges.size (); i++) - { - QUIT; /* Allow user to bail out with ^C. */ - if (info_verbose) -@@ -1200,9 +1220,9 @@ collection_list::stringify () - } - if (count + 27 > MAX_AGENT_EXPR_LEN) - { -- str_list.emplace_back (temp_buf, count); -+ str_list.emplace_back (temp_buf.data (), count); - count = 0; -- end = temp_buf; -+ end = temp_buf.data (); - } - - { -@@ -1222,7 +1242,7 @@ collection_list::stringify () - } - - count += strlen (end); -- end = temp_buf + count; -+ end = temp_buf.data () + count; - } - - for (i = 0; i < m_aexprs.size (); i++) -@@ -1230,9 +1250,9 @@ collection_list::stringify () - QUIT; /* Allow user to bail out with ^C. */ - if ((count + 10 + 2 * m_aexprs[i]->len) > MAX_AGENT_EXPR_LEN) - { -- str_list.emplace_back (temp_buf, count); -+ str_list.emplace_back (temp_buf.data (), count); - count = 0; -- end = temp_buf; -+ end = temp_buf.data (); - } - sprintf (end, "X%08X,", m_aexprs[i]->len); - end += 10; /* 'X' + 8 hex digits + ',' */ -@@ -1244,9 +1264,9 @@ collection_list::stringify () - - if (count != 0) - { -- str_list.emplace_back (temp_buf, count); -+ str_list.emplace_back (temp_buf.data (), count); - count = 0; -- end = temp_buf; -+ end = temp_buf.data (); - } - - return str_list; -diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h ---- a/gdb/tracepoint.h -+++ b/gdb/tracepoint.h -@@ -293,8 +293,9 @@ public: - { return m_computed; } - - private: -- /* room for up to 256 regs */ -- unsigned char m_regs_mask[32]; -+ /* We need the allocator zero-initialize the mask, so we don't use -+ gdb::byte_vector. */ -+ std::vector m_regs_mask; - - std::vector m_memranges; - diff --git a/gdb-rhbz1187581-power8-regs-6of7.patch b/gdb-rhbz1187581-power8-regs-6of7.patch deleted file mode 100644 index b0a5e1f..0000000 --- a/gdb-rhbz1187581-power8-regs-6of7.patch +++ /dev/null @@ -1,187 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Thu, 9 Aug 2018 17:18:15 +0200 -Subject: gdb-rhbz1187581-power8-regs-6of7.patch - -;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). - -commit 296956befef3711ed458c7cba8041fde0dab9c50 -Author: Pedro Franco de Carvalho -Date: Mon Aug 6 16:24:55 2018 -0300 - - Allow larger regblock sizes when saving tracefiles - - The tracefile.c:trace_save function assumes trace_regblock_size won't - be larger than the MAX_TRACE_UPLOAD constant, used to size the buffer - which holds trace data. This can cause buffer overruns when this is - not the case. This patch changes this function so that the larger - size is used to size the buffer. - - gdb/ChangeLog: - 2018-08-06 Pedro Franco de Carvalho - - * tracefile.c: Include common/byte-vector.h. - (trace_save): Change type of buf to gdb::byte_vector. Initialize - with trace_regblock_size if needed. Update uses of buf. - -+2018-08-06 Pedro Franco de Carvalho -+ -+ * tracefile.c: Include common/byte-vector.h. -+ (trace_save): Change type of buf to gdb::byte_vector. Initialize -+ with trace_regblock_size if needed. Update uses of buf. -+ - 2018-08-06 Pedro Franco de Carvalho - - * tracepoint.h (collection_list) : Change type to - -diff --git a/gdb/tracefile.c b/gdb/tracefile.c ---- a/gdb/tracefile.c -+++ b/gdb/tracefile.c -@@ -22,6 +22,7 @@ - #include "ctf.h" - #include "exec.h" - #include "regcache.h" -+#include "common/byte-vector.h" - - /* Helper macros. */ - -@@ -67,7 +68,7 @@ trace_save (const char *filename, struct trace_file_writer *writer, - - ULONGEST offset = 0; - #define MAX_TRACE_UPLOAD 2000 -- gdb_byte buf[MAX_TRACE_UPLOAD]; -+ gdb::byte_vector buf (std::max (MAX_TRACE_UPLOAD, trace_regblock_size)); - enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ()); - - /* If the target is to save the data to a file on its own, then just -@@ -144,7 +145,7 @@ trace_save (const char *filename, struct trace_file_writer *writer, - /* We ask for big blocks, in the hopes of efficiency, but - will take less if the target has packet size limitations - or some such. */ -- gotten = target_get_raw_trace_data (buf, offset, -+ gotten = target_get_raw_trace_data (buf.data (), offset, - MAX_TRACE_UPLOAD); - if (gotten < 0) - error (_("Failure to get requested trace buffer data")); -@@ -152,7 +153,7 @@ trace_save (const char *filename, struct trace_file_writer *writer, - if (gotten == 0) - break; - -- writer->ops->write_trace_buffer (writer, buf, gotten); -+ writer->ops->write_trace_buffer (writer, buf.data (), gotten); - - offset += gotten; - } -@@ -163,7 +164,7 @@ trace_save (const char *filename, struct trace_file_writer *writer, - /* Parse the trace buffers according to how data are stored - in trace buffer in GDBserver. */ - -- gotten = target_get_raw_trace_data (buf, offset, 6); -+ gotten = target_get_raw_trace_data (buf.data (), offset, 6); - - if (gotten == 0) - break; -@@ -171,10 +172,10 @@ trace_save (const char *filename, struct trace_file_writer *writer, - /* Read the first six bytes in, which is the tracepoint - number and trace frame size. */ - tp_num = (uint16_t) -- extract_unsigned_integer (&buf[0], 2, byte_order); -+ extract_unsigned_integer (&((buf.data ())[0]), 2, byte_order); - - tf_size = (uint32_t) -- extract_unsigned_integer (&buf[2], 4, byte_order); -+ extract_unsigned_integer (&((buf.data ())[2]), 4, byte_order); - - writer->ops->frame_ops->start (writer, tp_num); - gotten = 6; -@@ -192,7 +193,8 @@ trace_save (const char *filename, struct trace_file_writer *writer, - /* We'll fetch one block each time, in order to - handle the extremely large 'M' block. We first - fetch one byte to get the type of the block. */ -- gotten = target_get_raw_trace_data (buf, offset, 1); -+ gotten = target_get_raw_trace_data (buf.data (), -+ offset, 1); - if (gotten < 1) - error (_("Failure to get requested trace buffer data")); - -@@ -205,13 +207,13 @@ trace_save (const char *filename, struct trace_file_writer *writer, - { - case 'R': - gotten -- = target_get_raw_trace_data (buf, offset, -+ = target_get_raw_trace_data (buf.data (), offset, - trace_regblock_size); - if (gotten < trace_regblock_size) - error (_("Failure to get requested trace" - " buffer data")); - -- TRACE_WRITE_R_BLOCK (writer, buf, -+ TRACE_WRITE_R_BLOCK (writer, buf.data (), - trace_regblock_size); - break; - case 'M': -@@ -221,7 +223,8 @@ trace_save (const char *filename, struct trace_file_writer *writer, - LONGEST t; - int j; - -- t = target_get_raw_trace_data (buf,offset, 10); -+ t = target_get_raw_trace_data (buf.data (), -+ offset, 10); - if (t < 10) - error (_("Failure to get requested trace" - " buffer data")); -@@ -231,10 +234,10 @@ trace_save (const char *filename, struct trace_file_writer *writer, - - gotten = 0; - addr = (ULONGEST) -- extract_unsigned_integer (buf, 8, -+ extract_unsigned_integer (buf.data (), 8, - byte_order); - mlen = (unsigned short) -- extract_unsigned_integer (&buf[8], 2, -+ extract_unsigned_integer (&((buf.data ())[8]), 2, - byte_order); - - TRACE_WRITE_M_BLOCK_HEADER (writer, addr, -@@ -252,14 +255,15 @@ trace_save (const char *filename, struct trace_file_writer *writer, - else - read_length = mlen - j; - -- t = target_get_raw_trace_data (buf, -+ t = target_get_raw_trace_data (buf.data (), - offset + j, - read_length); - if (t < read_length) - error (_("Failure to get requested" - " trace buffer data")); - -- TRACE_WRITE_M_BLOCK_MEMORY (writer, buf, -+ TRACE_WRITE_M_BLOCK_MEMORY (writer, -+ buf.data (), - read_length); - - j += read_length; -@@ -274,18 +278,18 @@ trace_save (const char *filename, struct trace_file_writer *writer, - LONGEST val; - - gotten -- = target_get_raw_trace_data (buf, offset, -- 12); -+ = target_get_raw_trace_data (buf.data (), -+ offset, 12); - if (gotten < 12) - error (_("Failure to get requested" - " trace buffer data")); - -- vnum = (int) extract_signed_integer (buf, -+ vnum = (int) extract_signed_integer (buf.data (), - 4, - byte_order); - val -- = extract_signed_integer (&buf[4], 8, -- byte_order); -+ = extract_signed_integer (&((buf.data ())[4]), -+ 8, byte_order); - - TRACE_WRITE_V_BLOCK (writer, vnum, val); - } diff --git a/gdb-rhbz1187581-power8-regs-7of7.patch b/gdb-rhbz1187581-power8-regs-7of7.patch deleted file mode 100644 index ee82673..0000000 --- a/gdb-rhbz1187581-power8-regs-7of7.patch +++ /dev/null @@ -1,129 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Thu, 9 Aug 2018 17:18:49 +0200 -Subject: gdb-rhbz1187581-power8-regs-7of7.patch - -;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581). - -commit a7f25a84f4cc1df5248c46346337f19a2a66af5a -Author: Simon Marchi -Date: Mon Aug 6 16:54:47 2018 -0400 - - Fix compilation failure in remote.c - - A recent patch introduced a few of these: - - /home/emaisin/src/binutils-gdb/gdb/remote.c:12862:19: error: format not a string literal and no format arguments [-Werror=format-security] - error (err_msg); - ^ - - Fix them by replacing the call to error with - - error ("%s", err_msg); - - gdb/ChangeLog: - - * remote.c (remote_target::download_tracepoint): Fix format - string errors. - -+2018-08-06 Simon Marchi -+ -+ * remote.c (remote_target::download_tracepoint): Fix format -+ string errors. -+ - 2018-08-06 Pedro Franco de Carvalho - - * tracefile.c: Include common/byte-vector.h. - -diff --git a/gdb/remote.c b/gdb/remote.c ---- a/gdb/remote.c -+++ b/gdb/remote.c -@@ -12826,7 +12826,7 @@ remote_target::download_tracepoint (struct bp_location *loc) - t->step_count, t->pass_count); - - if (ret < 0 || ret >= buf.size ()) -- error (err_msg); -+ error ("%s", err_msg); - - /* Fast tracepoints are mostly handled by the target, but we can - tell the target how big of an instruction block should be moved -@@ -12846,7 +12846,7 @@ remote_target::download_tracepoint (struct bp_location *loc) - gdb_insn_length (loc->gdbarch, tpaddr)); - - if (ret < 0 || ret >= size_left) -- error (err_msg); -+ error ("%s", err_msg); - } - else - /* If it passed validation at definition but fails now, -@@ -12877,7 +12877,7 @@ remote_target::download_tracepoint (struct bp_location *loc) - size_left, ":S"); - - if (ret < 0 || ret >= size_left) -- error (err_msg); -+ error ("%s", err_msg); - } - else - error (_("Static tracepoint not valid during download")); -@@ -12905,14 +12905,14 @@ remote_target::download_tracepoint (struct bp_location *loc) - size_left, ":X%x,", aexpr->len); - - if (ret < 0 || ret >= size_left) -- error (err_msg); -+ error ("%s", err_msg); - - size_left = buf.size () - strlen (buf.data ()); - - /* Two bytes to encode each aexpr byte, plus the terminating - null byte. */ - if (aexpr->len * 2 + 1 > size_left) -- error (err_msg); -+ error ("%s", err_msg); - - pkt = buf.data () + strlen (buf.data ()); - -@@ -12933,7 +12933,7 @@ remote_target::download_tracepoint (struct bp_location *loc) - size_left, "-"); - - if (ret < 0 || ret >= size_left) -- error (err_msg); -+ error ("%s", err_msg); - } - - putpkt (buf.data ()); -@@ -12956,7 +12956,7 @@ remote_target::download_tracepoint (struct bp_location *loc) - has_more ? '-' : 0); - - if (ret < 0 || ret >= buf.size ()) -- error (err_msg); -+ error ("%s", err_msg); - - putpkt (buf.data ()); - remote_get_noisy_reply (); -@@ -12979,7 +12979,7 @@ remote_target::download_tracepoint (struct bp_location *loc) - has_more ? "-" : ""); - - if (ret < 0 || ret >= buf.size ()) -- error (err_msg); -+ error ("%s", err_msg); - - putpkt (buf.data ()); - remote_get_noisy_reply (); -@@ -12994,7 +12994,7 @@ remote_target::download_tracepoint (struct bp_location *loc) - ret = snprintf (buf.data (), buf.size (), "QTDPsrc:"); - - if (ret < 0 || ret >= buf.size ()) -- error (err_msg); -+ error ("%s", err_msg); - - encode_source_string (b->number, loc->address, "at", - event_location_to_string (b->location.get ()), -@@ -13010,7 +13010,7 @@ remote_target::download_tracepoint (struct bp_location *loc) - ret = snprintf (buf.data (), buf.size (), "QTDPsrc:"); - - if (ret < 0 || ret >= buf.size ()) -- error (err_msg); -+ error ("%s", err_msg); - - encode_source_string (b->number, loc->address, - "cond", b->cond_string, diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index e2c2f48..ad2daf4 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -557,7 +557,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *); static struct value *assign_aggregate (struct value *, struct value *, -@@ -697,7 +698,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) +@@ -692,7 +693,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) } static const gdb_byte * @@ -566,7 +566,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c { if (valaddr == NULL) return NULL; -@@ -706,7 +707,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) +@@ -701,7 +702,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) } static CORE_ADDR @@ -684,7 +684,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c val = value_cast (value_type (component), val); -@@ -4462,7 +4464,7 @@ ensure_lval (struct value *val) +@@ -4502,7 +4504,7 @@ ensure_lval (struct value *val) if (VALUE_LVAL (val) == not_lval || VALUE_LVAL (val) == lval_internalvar) { @@ -693,7 +693,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c const CORE_ADDR addr = value_as_long (value_allocate_space_in_inferior (len)); -@@ -4546,7 +4548,7 @@ static CORE_ADDR +@@ -4586,7 +4588,7 @@ static CORE_ADDR value_pointer (struct value *value, struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); @@ -702,7 +702,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c gdb_byte *buf = (gdb_byte *) alloca (len); CORE_ADDR addr; -@@ -6657,7 +6659,7 @@ value_tag_from_contents_and_address (struct type *type, +@@ -6694,7 +6696,7 @@ value_tag_from_contents_and_address (struct type *type, const gdb_byte *valaddr, CORE_ADDR address) { @@ -711,7 +711,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *tag_type; if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, -@@ -7150,7 +7152,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) +@@ -7187,7 +7189,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) only in that it can handle packed values of arbitrary type. */ static struct value * @@ -720,7 +720,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *arg_type) { struct type *type; -@@ -7162,7 +7164,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, +@@ -7199,7 +7201,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) { @@ -729,7 +729,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); return ada_value_primitive_packed_val (arg1, value_contents (arg1), -@@ -7239,9 +7241,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, +@@ -7276,9 +7278,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, Returns 1 if found, 0 otherwise. */ static int @@ -741,7 +741,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c int *index_p) { int i; -@@ -7260,8 +7262,8 @@ find_struct_field (const char *name, struct type *type, int offset, +@@ -7297,8 +7299,8 @@ find_struct_field (const char *name, struct type *type, int offset, for (i = 0; i < TYPE_NFIELDS (type); i += 1) { @@ -752,7 +752,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c const char *t_field_name = TYPE_FIELD_NAME (type, i); if (t_field_name == NULL) -@@ -7363,7 +7365,7 @@ num_visible_fields (struct type *type) +@@ -7400,7 +7402,7 @@ num_visible_fields (struct type *type) long explanation in find_struct_field's function documentation. */ static struct value * @@ -761,7 +761,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *type) { int i; -@@ -7411,7 +7413,7 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, +@@ -7448,7 +7450,7 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, int j; struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -770,7 +770,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) { -@@ -7443,8 +7445,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, +@@ -7480,8 +7482,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, return NULL; } @@ -781,7 +781,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c /* Return field #INDEX in ARG, where the index is that returned by -@@ -7453,7 +7455,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, +@@ -7490,7 +7492,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, * If found, return value, else return NULL. */ static struct value * @@ -790,7 +790,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *type) { return ada_index_struct_field_1 (&index, arg, offset, type); -@@ -7465,7 +7467,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, +@@ -7502,7 +7504,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, * *INDEX_P. */ static struct value * @@ -799,7 +799,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *type) { int i; -@@ -7555,7 +7557,8 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err) +@@ -7593,7 +7595,8 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err) v = ada_search_struct_field (name, arg, 0, t); else { @@ -809,7 +809,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *field_type; CORE_ADDR address; -@@ -7899,8 +7902,8 @@ ada_coerce_ref (struct value *val0) +@@ -7942,8 +7945,8 @@ ada_coerce_ref (struct value *val0) /* Return OFF rounded upward if necessary to a multiple of ALIGNMENT (a power of 2). */ @@ -820,7 +820,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c { return (off + alignment - 1) & ~(alignment - 1); } -@@ -8290,10 +8293,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, +@@ -8333,10 +8336,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, struct value *mark = value_mark (); struct value *dval; struct type *rtype; @@ -833,7 +833,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c int f; /* Compute the number of fields in this record type that are going -@@ -8370,7 +8372,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, +@@ -8413,7 +8415,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, that follow this one. */ if (ada_is_aligner_type (field_type)) { @@ -842,7 +842,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c field_valaddr = cond_offset_host (field_valaddr, field_offset); field_address = cond_offset_target (field_address, field_offset); -@@ -8506,11 +8508,11 @@ ada_template_to_fixed_record_type_1 (struct type *type, +@@ -8549,11 +8551,11 @@ ada_template_to_fixed_record_type_1 (struct type *type, if (TYPE_LENGTH (type) <= 0) { if (TYPE_NAME (rtype)) @@ -858,7 +858,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c } else { -@@ -8974,7 +8976,8 @@ to_fixed_array_type (struct type *type0, struct value *dval, +@@ -9017,7 +9019,8 @@ to_fixed_array_type (struct type *type0, struct value *dval, type was a regular (non-packed) array type. As a result, the bitsize of the array elements needs to be set again, and the array length needs to be recomputed based on that bitsize. */ @@ -889,7 +889,7 @@ diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h const struct value_print_options *); struct value *ada_convert_actual (struct value *actual, -@@ -261,7 +261,7 @@ extern int ada_is_constrained_packed_array_type (struct type *); +@@ -263,7 +263,7 @@ extern int ada_is_constrained_packed_array_type (struct type *); extern struct value *ada_value_primitive_packed_val (struct value *, const gdb_byte *, @@ -901,7 +901,7 @@ diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c -@@ -896,8 +896,8 @@ ada_print_type (struct type *type0, const char *varstring, +@@ -891,8 +891,8 @@ ada_print_type (struct type *type0, const char *varstring, const char *name = ada_type_name (type); if (!ada_is_range_type_name (name)) @@ -912,7 +912,7 @@ diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c else { fprintf_filtered (stream, "range "); -@@ -918,7 +918,8 @@ ada_print_type (struct type *type0, const char *varstring, +@@ -913,7 +913,8 @@ ada_print_type (struct type *type0, const char *varstring, } break; case TYPE_CODE_FLT: @@ -1140,7 +1140,7 @@ diff --git a/gdb/annotate.h b/gdb/annotate.h diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c -@@ -228,7 +228,7 @@ legacy_virtual_frame_pointer (struct gdbarch *gdbarch, +@@ -227,7 +227,7 @@ legacy_virtual_frame_pointer (struct gdbarch *gdbarch, const struct floatformat ** default_floatformat_for_type (struct gdbarch *gdbarch, @@ -1164,7 +1164,7 @@ diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c -@@ -1098,7 +1098,7 @@ arm_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch, +@@ -1096,7 +1096,7 @@ arm_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch, /* Are we able to use a hardware watchpoint for the LEN bytes starting at ADDR? */ int @@ -1299,7 +1299,7 @@ diff --git a/gdb/ax.h b/gdb/ax.h diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -2053,9 +2053,9 @@ should_be_inserted (struct bp_location *bl) +@@ -2057,9 +2057,9 @@ should_be_inserted (struct bp_location *bl) { fprintf_unfiltered (gdb_stdlog, "infrun: stepping past non-steppable watchpoint. " @@ -1311,7 +1311,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c } return 0; } -@@ -6816,7 +6816,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1, +@@ -6805,7 +6805,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1, static int breakpoint_address_match_range (const address_space *aspace1, CORE_ADDR addr1, @@ -1320,7 +1320,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c CORE_ADDR addr2) { return ((gdbarch_has_global_breakpoints (target_gdbarch ()) -@@ -10899,7 +10899,7 @@ can_use_hardware_watchpoint (const std::vector &vals) +@@ -10887,7 +10887,7 @@ can_use_hardware_watchpoint (const std::vector &vals) && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR vaddr = value_address (v); @@ -1445,7 +1445,7 @@ diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c --- a/gdb/compile/compile-c-support.c +++ b/gdb/compile/compile-c-support.c -@@ -307,11 +307,11 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch, +@@ -270,11 +270,11 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch, default: fprintf_unfiltered (stream, @@ -1571,7 +1571,7 @@ diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c -@@ -1817,7 +1817,7 @@ rw_pieced_value (struct value *v, struct value *from) +@@ -1855,7 +1855,7 @@ rw_pieced_value (struct value *v, struct value *from) for (; i < c->pieces.size () && offset < max_offset; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; @@ -1580,7 +1580,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c this_size_bits = p->size - bits_to_skip; if (this_size_bits > max_offset - offset) -@@ -2064,7 +2064,7 @@ write_pieced_value (struct value *to, struct value *from) +@@ -2102,7 +2102,7 @@ write_pieced_value (struct value *to, struct value *from) static int check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, @@ -1589,7 +1589,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c { struct piece_closure *c = (struct piece_closure *) value_computed_closure (value); -@@ -2077,7 +2077,7 @@ check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, +@@ -2115,7 +2115,7 @@ check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, for (i = 0; i < c->pieces.size () && bit_length > 0; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; @@ -1598,7 +1598,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c if (bit_offset > 0) { -@@ -2179,8 +2179,8 @@ indirect_pieced_value (struct value *value) +@@ -2219,8 +2219,8 @@ indirect_pieced_value (struct value *value) = (struct piece_closure *) value_computed_closure (value); struct type *type; struct frame_info *frame; @@ -1609,7 +1609,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c struct dwarf_expr_piece *piece = NULL; LONGEST byte_offset; enum bfd_endian byte_order; -@@ -2197,7 +2197,7 @@ indirect_pieced_value (struct value *value) +@@ -2237,7 +2237,7 @@ indirect_pieced_value (struct value *value) for (i = 0; i < c->pieces.size () && bit_length > 0; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; @@ -1618,7 +1618,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c if (bit_offset > 0) { -@@ -2486,9 +2486,9 @@ if (frame != NULL) select_frame (frame); +@@ -2526,9 +2526,9 @@ if (frame != NULL) select_frame (frame); case DWARF_VALUE_STACK: { struct value *value = ctx.fetch (0); @@ -1634,7 +1634,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -2021,11 +2021,11 @@ dwarf2_complex_location_expr_complaint (void) +@@ -2031,11 +2031,11 @@ dwarf2_complex_location_expr_complaint (void) } static void @@ -1650,7 +1650,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } static void -@@ -14949,8 +14949,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, +@@ -15077,8 +15077,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, object, and then subtract off the number of bits of the field itself. The result is the bit offset of the LSB of the field. */ @@ -1683,7 +1683,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c if (exp->elts[*pos].opcode == BINOP_COMMA) { -@@ -800,11 +801,11 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch, +@@ -799,11 +800,11 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch, /* FIXME: Also mixed integral/booleans, with result an integer. */ { const struct builtin_type *builtin = builtin_type (gdbarch); @@ -1698,7 +1698,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c int unsigned_operation; /* Determine type length and signedness after promotion for -@@ -1546,7 +1547,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1549,7 +1550,7 @@ evaluate_subexp_standard (struct type *expect_type, struct value **argvec; int code; int ix; @@ -1707,7 +1707,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c struct type **arg_types; pc = (*pos)++; -@@ -1729,7 +1730,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1732,7 +1733,7 @@ evaluate_subexp_standard (struct type *expect_type, struct type *range_type = TYPE_INDEX_TYPE (type); struct type *element_type = TYPE_TARGET_TYPE (type); struct value *array = allocate_value (expect_type); @@ -1802,7 +1802,7 @@ diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c diff --git a/gdb/findvar.c b/gdb/findvar.c --- a/gdb/findvar.c +++ b/gdb/findvar.c -@@ -821,7 +821,7 @@ struct value * +@@ -823,7 +823,7 @@ struct value * default_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_id frame_id) { @@ -1811,7 +1811,7 @@ diff --git a/gdb/findvar.c b/gdb/findvar.c struct value *value = allocate_value (type); struct frame_info *frame; -@@ -865,7 +865,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) +@@ -867,7 +867,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) LONGEST offset = 0; LONGEST reg_offset = value_offset (value); int regnum = VALUE_REGNUM (value); @@ -1820,7 +1820,7 @@ diff --git a/gdb/findvar.c b/gdb/findvar.c gdb_assert (VALUE_LVAL (value) == lval_register); -@@ -880,7 +880,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) +@@ -882,7 +882,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) while (len > 0) { struct value *regval = get_frame_register_value (frame, regnum); @@ -1832,7 +1832,7 @@ diff --git a/gdb/findvar.c b/gdb/findvar.c diff --git a/gdb/frame.c b/gdb/frame.c --- a/gdb/frame.c +++ b/gdb/frame.c -@@ -1396,7 +1396,7 @@ deprecated_frame_register_read (struct frame_info *frame, int regnum, +@@ -1398,7 +1398,7 @@ deprecated_frame_register_read (struct frame_info *frame, int regnum, int get_frame_register_bytes (struct frame_info *frame, int regnum, @@ -1841,7 +1841,7 @@ diff --git a/gdb/frame.c b/gdb/frame.c int *optimizedp, int *unavailablep) { struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -1425,7 +1425,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum, +@@ -1427,7 +1427,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum, } if (len > maxsize) error (_("Bad debug information detected: " @@ -1877,7 +1877,7 @@ diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h -@@ -193,8 +193,8 @@ extern void set_gdbarch_wchar_signed (struct gdbarch *gdbarch, int wchar_signed) +@@ -195,8 +195,8 @@ extern void set_gdbarch_wchar_signed (struct gdbarch *gdbarch, int wchar_signed) NAME, if non-NULL, is the type name, which may be used to distinguish different target formats of the same length. */ @@ -1903,7 +1903,7 @@ diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c -@@ -2906,7 +2906,7 @@ floatformat_from_type (const struct type *type) +@@ -2915,7 +2915,7 @@ floatformat_from_type (const struct type *type) least as long as OBJFILE. */ struct type * @@ -1912,7 +1912,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c const char *name) { struct type *type; -@@ -3360,8 +3360,8 @@ is_public_ancestor (struct type *base, struct type *dclass) +@@ -3369,8 +3369,8 @@ is_public_ancestor (struct type *base, struct type *dclass) static int is_unique_ancestor_worker (struct type *base, struct type *dclass, @@ -1923,7 +1923,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c CORE_ADDR address, struct value *val) { int i, count = 0; -@@ -3372,7 +3372,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, +@@ -3381,7 +3381,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i) { struct type *iter; @@ -1932,7 +1932,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c iter = check_typedef (TYPE_BASECLASS (dclass, i)); -@@ -3413,7 +3413,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, +@@ -3422,7 +3422,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, int is_unique_ancestor (struct type *base, struct value *val) { @@ -1941,7 +1941,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c return is_unique_ancestor_worker (base, value_type (val), &offset, value_contents_for_printing (val), -@@ -4642,7 +4642,7 @@ recursive_dump_type (struct type *type, int spaces) +@@ -4651,7 +4651,7 @@ recursive_dump_type (struct type *type, int spaces) break; } puts_filtered ("\n"); @@ -1950,7 +1950,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c if (TYPE_OBJFILE_OWNED (type)) { printfi_filtered (spaces, "objfile "); -@@ -5085,7 +5085,7 @@ copy_type (const struct type *type) +@@ -5096,7 +5096,7 @@ copy_type (const struct type *type) struct type * arch_type (struct gdbarch *gdbarch, @@ -1962,7 +1962,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h -@@ -862,7 +862,7 @@ struct type +@@ -863,7 +863,7 @@ struct type type_length_units function should be used in order to get the length expressed in target addressable memory units. */ @@ -1971,7 +1971,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h /* * Core type, shared by a group of qualified types. */ -@@ -1783,7 +1783,7 @@ extern unsigned int type_length_units (struct type *type); +@@ -1790,7 +1790,7 @@ extern unsigned int type_length_units (struct type *type); /* * Helper function to construct objfile-owned types. */ @@ -1980,7 +1980,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h const char *); extern struct type *init_integer_type (struct objfile *, int, int, const char *); -@@ -1800,7 +1800,7 @@ extern struct type *init_pointer_type (struct objfile *, int, const char *, +@@ -1807,7 +1807,7 @@ extern struct type *init_pointer_type (struct objfile *, int, const char *, struct type *); /* Helper functions to construct architecture-owned types. */ @@ -2122,7 +2122,7 @@ diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c -@@ -8153,7 +8153,7 @@ i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, +@@ -8155,7 +8155,7 @@ i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, const struct floatformat ** i386_floatformat_for_type (struct gdbarch *gdbarch, @@ -2360,7 +2360,7 @@ diff --git a/gdb/memrange.h b/gdb/memrange.h diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c --- a/gdb/mips-linux-nat.c +++ b/gdb/mips-linux-nat.c -@@ -614,7 +614,7 @@ mips_linux_nat_target::stopped_data_address (CORE_ADDR *paddr) +@@ -610,7 +610,7 @@ mips_linux_nat_target::stopped_data_address (CORE_ADDR *paddr) the specified region can be covered by the watch registers. */ int @@ -2577,7 +2577,7 @@ diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c -@@ -1308,7 +1308,7 @@ ppc_linux_nat_target::can_use_hw_breakpoint (enum bptype type, int cnt, int ot) +@@ -1300,7 +1300,7 @@ ppc_linux_nat_target::can_use_hw_breakpoint (enum bptype type, int cnt, int ot) } int @@ -2622,7 +2622,7 @@ diff --git a/gdb/printcmd.c b/gdb/printcmd.c diff --git a/gdb/procfs.c b/gdb/procfs.c --- a/gdb/procfs.c +++ b/gdb/procfs.c -@@ -3358,7 +3358,7 @@ procfs_target::remove_watchpoint (CORE_ADDR addr, int len, +@@ -3361,7 +3361,7 @@ procfs_target::remove_watchpoint (CORE_ADDR addr, int len, } int @@ -2691,7 +2691,7 @@ diff --git a/gdb/regcache.c b/gdb/regcache.c diff --git a/gdb/regcache.h b/gdb/regcache.h --- a/gdb/regcache.h +++ b/gdb/regcache.h -@@ -244,8 +244,8 @@ public: +@@ -256,8 +256,8 @@ public: enum register_status raw_read (int regnum, T *val); /* Partial transfer of raw registers. Return the status of the register. */ @@ -2702,7 +2702,7 @@ diff --git a/gdb/regcache.h b/gdb/regcache.h /* Make certain that the register REGNUM is up-to-date. */ virtual void raw_update (int regnum) = 0; -@@ -257,8 +257,8 @@ public: +@@ -269,8 +269,8 @@ public: enum register_status cooked_read (int regnum, T *val); /* Partial transfer of a cooked register. */ @@ -2713,7 +2713,7 @@ diff --git a/gdb/regcache.h b/gdb/regcache.h /* Read register REGNUM from the regcache and return a new value. This will call mark_value_bytes_unavailable as appropriate. */ -@@ -268,7 +268,7 @@ protected: +@@ -280,7 +280,7 @@ protected: /* Perform a partial register transfer using a read, modify, write operation. Will fail if register is currently invalid. */ @@ -2722,7 +2722,7 @@ diff --git a/gdb/regcache.h b/gdb/regcache.h gdb_byte *out, bool is_raw); }; -@@ -326,11 +326,12 @@ public: +@@ -338,11 +338,12 @@ public: /* Partial transfer of raw registers. Perform read, modify, write style operations. */ @@ -2737,7 +2737,7 @@ diff --git a/gdb/regcache.h b/gdb/regcache.h const gdb_byte *buf); void supply_regset (const struct regset *regset, -@@ -381,7 +382,7 @@ private: +@@ -393,7 +394,7 @@ private: /* Perform a partial register transfer using a read, modify, write operation. */ @@ -2758,7 +2758,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, struct expression *) override; -@@ -10413,7 +10413,7 @@ int remote_hw_watchpoint_length_limit = -1; +@@ -10446,7 +10446,7 @@ int remote_hw_watchpoint_length_limit = -1; int remote_hw_breakpoint_limit = -1; int @@ -2770,7 +2770,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c -@@ -288,7 +288,7 @@ rust_printchar (int c, struct type *type, struct ui_file *stream) +@@ -301,7 +301,7 @@ rust_printchar (int c, struct type *type, struct ui_file *stream) static void rust_printstr (struct ui_file *stream, struct type *type, @@ -2779,7 +2779,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c const char *user_encoding, int force_ellipses, const struct value_print_options *options) { -@@ -497,7 +497,7 @@ static const struct generic_val_print_decorations rust_decorations = +@@ -517,7 +517,7 @@ static const struct generic_val_print_decorations rust_decorations = /* la_val_print implementation for Rust. */ static void @@ -2791,7 +2791,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c --- a/gdb/s390-linux-nat.c +++ b/gdb/s390-linux-nat.c -@@ -952,7 +952,8 @@ s390_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch, +@@ -951,7 +951,8 @@ s390_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch, } int @@ -2884,8 +2884,8 @@ diff --git a/gdb/symmisc.c b/gdb/symmisc.c diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c -@@ -39,7 +39,7 @@ struct dummy_target : public target_ops - bool have_continuable_watchpoint () override; +@@ -38,7 +38,7 @@ struct dummy_target : public target_ops + int have_steppable_watchpoint () override; bool stopped_data_address (CORE_ADDR *arg0) override; bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override; - int region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) override; @@ -2893,8 +2893,8 @@ diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c bool can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) override; int masked_watch_num_registers (CORE_ADDR arg0, CORE_ADDR arg1) override; int can_do_single_step () override; -@@ -207,7 +207,7 @@ struct debug_target : public target_ops - bool have_continuable_watchpoint () override; +@@ -205,7 +205,7 @@ struct debug_target : public target_ops + int have_steppable_watchpoint () override; bool stopped_data_address (CORE_ADDR *arg0) override; bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override; - int region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) override; @@ -2902,7 +2902,7 @@ diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c bool can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) override; int masked_watch_num_registers (CORE_ADDR arg0, CORE_ADDR arg1) override; int can_do_single_step () override; -@@ -1098,19 +1098,19 @@ debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int +@@ -1071,19 +1071,19 @@ debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int } int @@ -2925,7 +2925,7 @@ diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c { int result; fprintf_unfiltered (gdb_stdlog, "-> %s->region_ok_for_hw_watchpoint (...)\n", this->beneath ()->shortname ()); -@@ -1118,7 +1118,7 @@ debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) +@@ -1091,7 +1091,7 @@ debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) fprintf_unfiltered (gdb_stdlog, "<- %s->region_ok_for_hw_watchpoint (", this->beneath ()->shortname ()); target_debug_print_CORE_ADDR (arg0); fputs_unfiltered (", ", gdb_stdlog); @@ -2946,7 +2946,7 @@ diff --git a/gdb/target.c b/gdb/target.c static void default_rcmd (struct target_ops *, const char *, struct ui_file *); -@@ -3181,7 +3181,7 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename) +@@ -3184,7 +3184,7 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename) static int default_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -2958,7 +2958,7 @@ diff --git a/gdb/target.c b/gdb/target.c diff --git a/gdb/target.h b/gdb/target.h --- a/gdb/target.h +++ b/gdb/target.h -@@ -562,7 +562,7 @@ struct target_ops +@@ -563,7 +563,7 @@ struct target_ops /* Documentation of this routine is provided with the corresponding target_* macro. */ @@ -2970,12 +2970,12 @@ diff --git a/gdb/target.h b/gdb/target.h diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c -@@ -829,10 +829,10 @@ collection_list::add_register (unsigned int regno) +@@ -893,10 +893,10 @@ collection_list::add_local_register (struct gdbarch *gdbarch, void collection_list::add_memrange (struct gdbarch *gdbarch, int type, bfd_signed_vma base, -- unsigned long len) -+ ULONGEST len) +- unsigned long len, CORE_ADDR scope) ++ ULONGEST len, CORE_ADDR scope) { if (info_verbose) - printf_filtered ("(%d,%s,%ld)\n", type, paddress (gdbarch, base), len); @@ -2983,7 +2983,7 @@ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c /* type: memrange_absolute == memory, other n == basereg */ /* base: addr if memory, offset if reg relative. */ -@@ -852,7 +852,7 @@ collection_list::collect_symbol (struct symbol *sym, +@@ -916,7 +916,7 @@ collection_list::collect_symbol (struct symbol *sym, CORE_ADDR scope, int trace_string) { @@ -2992,7 +2992,7 @@ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c unsigned int reg; bfd_signed_vma offset; int treat_as_expr = 0; -@@ -873,8 +873,8 @@ collection_list::collect_symbol (struct symbol *sym, +@@ -937,8 +937,8 @@ collection_list::collect_symbol (struct symbol *sym, offset = SYMBOL_VALUE_ADDRESS (sym); if (info_verbose) { @@ -3003,7 +3003,7 @@ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c paddress (gdbarch, offset)); } /* A struct may be a C++ class with static fields, go to general -@@ -906,9 +906,9 @@ collection_list::collect_symbol (struct symbol *sym, +@@ -970,9 +970,9 @@ collection_list::collect_symbol (struct symbol *sym, offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { @@ -3014,8 +3014,8 @@ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c + SYMBOL_PRINT_NAME (sym), pulongest (len), paddress (gdbarch, offset), reg); } - add_memrange (gdbarch, reg, offset, len); -@@ -918,9 +918,9 @@ collection_list::collect_symbol (struct symbol *sym, + add_memrange (gdbarch, reg, offset, len, scope); +@@ -982,9 +982,9 @@ collection_list::collect_symbol (struct symbol *sym, offset = 0; if (info_verbose) { @@ -3026,8 +3026,8 @@ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c + SYMBOL_PRINT_NAME (sym), pulongest (len), paddress (gdbarch, offset), reg); } - add_memrange (gdbarch, reg, offset, len); -@@ -930,9 +930,9 @@ collection_list::collect_symbol (struct symbol *sym, + add_memrange (gdbarch, reg, offset, len, scope); +@@ -994,9 +994,9 @@ collection_list::collect_symbol (struct symbol *sym, offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { @@ -3038,8 +3038,8 @@ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c + SYMBOL_PRINT_NAME (sym), pulongest (len), paddress (gdbarch, offset), reg); } - add_memrange (gdbarch, reg, offset, len); -@@ -2447,7 +2447,8 @@ info_scope_command (const char *args_in, int from_tty) + add_memrange (gdbarch, reg, offset, len, scope); +@@ -2492,7 +2492,8 @@ info_scope_command (const char *args_in, int from_tty) const char *symname; const char *save_args = args_in; struct block_iterator iter; @@ -3049,7 +3049,7 @@ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c struct gdbarch *gdbarch; int regno; const char *args = args_in; -@@ -2591,8 +2592,11 @@ info_scope_command (const char *args_in, int from_tty) +@@ -2636,8 +2637,11 @@ info_scope_command (const char *args_in, int from_tty) } } if (SYMBOL_TYPE (sym)) @@ -3066,12 +3066,12 @@ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h --- a/gdb/tracepoint.h +++ b/gdb/tracepoint.h -@@ -265,7 +265,7 @@ public: - void add_register (unsigned int regno); +@@ -269,7 +269,7 @@ public: + CORE_ADDR scope); void add_memrange (struct gdbarch *gdbarch, int type, bfd_signed_vma base, -- unsigned long len); -+ ULONGEST len); +- unsigned long len, CORE_ADDR scope); ++ ULONGEST len, CORE_ADDR scope); void collect_symbol (struct symbol *sym, struct gdbarch *gdbarch, long frame_regno, long frame_offset, @@ -3111,7 +3111,7 @@ diff --git a/gdb/valarith.c b/gdb/valarith.c { struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); -@@ -659,7 +659,7 @@ value_concat (struct value *arg1, struct value *arg2) +@@ -657,7 +657,7 @@ value_concat (struct value *arg1, struct value *arg2) struct value *inval1; struct value *inval2; struct value *outval = NULL; @@ -3120,7 +3120,7 @@ diff --git a/gdb/valarith.c b/gdb/valarith.c int count, idx; char inchar; struct type *type1 = check_typedef (value_type (arg1)); -@@ -1419,7 +1419,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) +@@ -1417,7 +1417,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) int value_logical_not (struct value *arg1) { @@ -3129,7 +3129,7 @@ diff --git a/gdb/valarith.c b/gdb/valarith.c const gdb_byte *p; struct type *type1; -@@ -1447,11 +1447,11 @@ value_logical_not (struct value *arg1) +@@ -1445,11 +1445,11 @@ value_logical_not (struct value *arg1) static int value_strcmp (struct value *arg1, struct value *arg2) { @@ -3189,7 +3189,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c gdb_byte buffer[sizeof (LONGEST)]; if (value_bitsize (toval)) -@@ -3357,7 +3357,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) +@@ -3356,7 +3356,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) the form "DOMAIN::NAME". */ static struct value * @@ -3198,7 +3198,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c struct type *curtype, const char *name, struct type *intype, int want_address, -@@ -3391,7 +3391,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, +@@ -3390,7 +3390,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, if (want_address) return value_from_longest (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), @@ -3207,7 +3207,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c else if (noside != EVAL_NORMAL) return allocate_value (TYPE_FIELD_TYPE (t, i)); else -@@ -3564,7 +3564,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, +@@ -3563,7 +3563,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) { struct value *v; @@ -3216,7 +3216,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (t, i)) base_offset = 0; -@@ -3713,7 +3713,7 @@ value_rtti_indirect_type (struct value *v, int *full, +@@ -3712,7 +3712,7 @@ value_rtti_indirect_type (struct value *v, int *full, struct value * value_full_object (struct value *argp, struct type *rtype, @@ -3278,7 +3278,7 @@ diff --git a/gdb/valprint.c b/gdb/valprint.c annotate_elt_rep_end (); i = rep1 - 1; -@@ -2669,7 +2669,7 @@ print_converted_chars_to_obstack (struct obstack *obstack, +@@ -2668,7 +2668,7 @@ print_converted_chars_to_obstack (struct obstack *obstack, void generic_printstr (struct ui_file *stream, struct type *type, @@ -3443,7 +3443,7 @@ diff --git a/gdb/x86-nat.h b/gdb/x86-nat.h extern int x86_stopped_by_watchpoint (); extern int x86_stopped_data_address (CORE_ADDR *addr_p); extern int x86_insert_watchpoint (CORE_ADDR addr, int len, -@@ -82,7 +82,7 @@ struct x86_nat_target : public BaseTarget +@@ -75,7 +75,7 @@ struct x86_nat_target : public BaseTarget int can_use_hw_breakpoint (enum bptype type, int cnt, int othertype) override { return x86_can_use_hw_breakpoint (type, cnt, othertype); } diff --git a/gdb-rhbz795424-bitpos-21of25.patch b/gdb-rhbz795424-bitpos-21of25.patch index 5617a50..a70254f 100644 --- a/gdb-rhbz795424-bitpos-21of25.patch +++ b/gdb-rhbz795424-bitpos-21of25.patch @@ -111,7 +111,7 @@ diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c diff --git a/gdb/utils.c b/gdb/utils.c --- a/gdb/utils.c +++ b/gdb/utils.c -@@ -2834,6 +2834,17 @@ string_to_core_addr (const char *my_string) +@@ -2807,6 +2807,17 @@ string_to_core_addr (const char *my_string) return addr; } @@ -132,7 +132,7 @@ diff --git a/gdb/utils.c b/gdb/utils.c diff --git a/gdb/valops.c b/gdb/valops.c --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -2088,6 +2088,7 @@ search_struct_method (const char *name, struct value **arg1p, +@@ -2087,6 +2087,7 @@ search_struct_method (const char *name, struct value **arg1p, { CORE_ADDR address; @@ -160,7 +160,7 @@ diff --git a/gdb/value.c b/gdb/value.c if (!val->contents) { check_type_length_before_alloc (val->enclosing_type); -@@ -2876,6 +2879,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type) +@@ -2875,6 +2878,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type) if (TYPE_LENGTH (new_encl_type) > TYPE_LENGTH (value_enclosing_type (val))) { check_type_length_before_alloc (new_encl_type); diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch index 8072f77..9e6882c 100644 --- a/gdb-rhbz795424-bitpos-22of25.patch +++ b/gdb-rhbz795424-bitpos-22of25.patch @@ -154,7 +154,7 @@ diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c const struct target_desc *read_description () override; -@@ -1207,7 +1207,7 @@ arm_linux_nat_target::stopped_by_watchpoint () +@@ -1203,7 +1203,7 @@ arm_linux_nat_target::stopped_by_watchpoint () bool arm_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr, CORE_ADDR start, @@ -299,7 +299,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c override; int masked_watch_num_registers (CORE_ADDR, CORE_ADDR) override; -@@ -1659,11 +1659,11 @@ can_use_watchpoint_cond_accel (void) +@@ -1649,11 +1649,11 @@ can_use_watchpoint_cond_accel (void) CONDITION_VALUE will hold the value which should be put in the DVC register. */ static void @@ -314,7 +314,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c CORE_ADDR addr_end_data, addr_end_dvc; /* The DVC register compares bytes within fixed-length windows which -@@ -1751,7 +1751,7 @@ num_memory_accesses (const std::vector &chain) +@@ -1741,7 +1741,7 @@ num_memory_accesses (const std::vector &chain) of the constant. */ static int check_condition (CORE_ADDR watch_addr, struct expression *cond, @@ -323,7 +323,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c { int pc = 1, num_accesses_left, num_accesses_right; struct value *left_val, *right_val; -@@ -1802,7 +1802,8 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond, +@@ -1792,7 +1792,8 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond, the condition expression, thus only triggering the watchpoint when it is true. */ bool @@ -333,7 +333,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c int rw, struct expression *cond) { -@@ -1820,7 +1821,7 @@ ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr, int len, +@@ -1810,7 +1811,7 @@ ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr, int len, static void create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr, @@ -342,7 +342,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c struct expression *cond, int insert) { if (len == 1 -@@ -2086,7 +2087,7 @@ ppc_linux_nat_target::stopped_by_watchpoint () +@@ -2076,7 +2077,7 @@ ppc_linux_nat_target::stopped_by_watchpoint () bool ppc_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr, CORE_ADDR start, @@ -354,7 +354,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c diff --git a/gdb/procfs.c b/gdb/procfs.c --- a/gdb/procfs.c +++ b/gdb/procfs.c -@@ -1561,7 +1561,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr) +@@ -1565,7 +1565,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr) } static int @@ -363,7 +363,7 @@ diff --git a/gdb/procfs.c b/gdb/procfs.c { struct { procfs_ctl_t cmd; -@@ -3214,7 +3214,7 @@ procfs_target::pid_to_str (ptid_t ptid) +@@ -3217,7 +3217,7 @@ procfs_target::pid_to_str (ptid_t ptid) /* Insert a watchpoint. */ static int @@ -384,7 +384,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c int can_use_hw_breakpoint (enum bptype, int, int) override; -@@ -10342,7 +10342,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, +@@ -10375,7 +10375,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); @@ -393,7 +393,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); -@@ -10362,7 +10362,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, +@@ -10395,7 +10395,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, bool remote_target::watchpoint_addr_within_range (CORE_ADDR addr, @@ -402,7 +402,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c { CORE_ADDR diff = remote_address_masked (addr - start); -@@ -10391,7 +10391,7 @@ remote_target::remove_watchpoint (CORE_ADDR addr, int len, +@@ -10424,7 +10424,7 @@ remote_target::remove_watchpoint (CORE_ADDR addr, int len, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); @@ -420,15 +420,15 @@ diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c override; - int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; + int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override; - bool have_continuable_watchpoint () override { return true; } bool stopped_by_watchpoint () override; int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, + struct expression *) override; diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c -@@ -38,9 +38,9 @@ struct dummy_target : public target_ops +@@ -37,9 +37,9 @@ struct dummy_target : public target_ops + bool stopped_by_watchpoint () override; int have_steppable_watchpoint () override; - bool have_continuable_watchpoint () override; bool stopped_data_address (CORE_ADDR *arg0) override; - bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override; + bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2) override; @@ -438,9 +438,9 @@ diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c int masked_watch_num_registers (CORE_ADDR arg0, CORE_ADDR arg1) override; int can_do_single_step () override; bool supports_terminal_ours () override; -@@ -206,9 +206,9 @@ struct debug_target : public target_ops +@@ -204,9 +204,9 @@ struct debug_target : public target_ops + bool stopped_by_watchpoint () override; int have_steppable_watchpoint () override; - bool have_continuable_watchpoint () override; bool stopped_data_address (CORE_ADDR *arg0) override; - bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override; + bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2) override; @@ -450,7 +450,7 @@ diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c int masked_watch_num_registers (CORE_ADDR arg0, CORE_ADDR arg1) override; int can_do_single_step () override; bool supports_terminal_ours () override; -@@ -1068,19 +1068,19 @@ debug_target::stopped_data_address (CORE_ADDR *arg0) +@@ -1041,19 +1041,19 @@ debug_target::stopped_data_address (CORE_ADDR *arg0) } bool @@ -473,7 +473,7 @@ diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c { bool result; fprintf_unfiltered (gdb_stdlog, "-> %s->watchpoint_addr_within_range (...)\n", this->beneath ()->shortname ()); -@@ -1090,7 +1090,7 @@ debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int +@@ -1063,7 +1063,7 @@ debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int fputs_unfiltered (", ", gdb_stdlog); target_debug_print_CORE_ADDR (arg1); fputs_unfiltered (", ", gdb_stdlog); @@ -482,7 +482,7 @@ diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c fputs_unfiltered (") = ", gdb_stdlog); target_debug_print_bool (result); fputs_unfiltered ("\n", gdb_stdlog); -@@ -1126,19 +1126,19 @@ debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) +@@ -1099,19 +1099,19 @@ debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) } bool @@ -505,7 +505,7 @@ diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c { bool result; fprintf_unfiltered (gdb_stdlog, "-> %s->can_accel_watchpoint_condition (...)\n", this->beneath ()->shortname ()); -@@ -1146,7 +1146,7 @@ debug_target::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2 +@@ -1119,7 +1119,7 @@ debug_target::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2 fprintf_unfiltered (gdb_stdlog, "<- %s->can_accel_watchpoint_condition (", this->beneath ()->shortname ()); target_debug_print_CORE_ADDR (arg0); fputs_unfiltered (", ", gdb_stdlog); @@ -526,7 +526,7 @@ diff --git a/gdb/target.c b/gdb/target.c static int default_region_ok_for_hw_watchpoint (struct target_ops *, CORE_ADDR, LONGEST); -@@ -3189,7 +3189,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self, +@@ -3192,7 +3192,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self, static int default_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -538,7 +538,7 @@ diff --git a/gdb/target.c b/gdb/target.c diff --git a/gdb/target.h b/gdb/target.h --- a/gdb/target.h +++ b/gdb/target.h -@@ -557,7 +557,7 @@ struct target_ops +@@ -558,7 +558,7 @@ struct target_ops TARGET_DEFAULT_RETURN (false); virtual bool stopped_data_address (CORE_ADDR *) TARGET_DEFAULT_RETURN (false); @@ -547,7 +547,7 @@ diff --git a/gdb/target.h b/gdb/target.h TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range); /* Documentation of this routine is provided with the corresponding -@@ -565,7 +565,7 @@ struct target_ops +@@ -566,7 +566,7 @@ struct target_ops virtual int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint); diff --git a/gdb-rhbz795424-bitpos-23of25.patch b/gdb-rhbz795424-bitpos-23of25.patch index ebbe696..d87895c 100644 --- a/gdb-rhbz795424-bitpos-23of25.patch +++ b/gdb-rhbz795424-bitpos-23of25.patch @@ -357,8 +357,8 @@ diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c { struct type *value_type = value_enclosing_type (args[i]); struct type *arg_type = check_typedef (value_type); -- int container_len = (TYPE_LENGTH (value_type) + 3) & ~3; -+ ssize_t container_len = (TYPE_LENGTH (value_type) + 3) & ~3; +- int container_len = (TYPE_LENGTH (arg_type) + 3) & ~3; ++ ssize_t container_len = (TYPE_LENGTH (arg_type) + 3) & ~3; sp -= container_len; write_memory (sp, value_contents (args[i]), container_len); @@ -620,7 +620,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c if (mips_debug && out != NULL) { int i; -@@ -4543,13 +4543,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -4561,13 +4561,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte ref_valbuf[MAX_MIPS_ABI_REGSIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -637,7 +637,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c /* The EABI passes structures that do not fit in a register by reference. */ -@@ -4819,7 +4819,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -4837,7 +4837,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct value *function, static int mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, @@ -646,7 +646,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c { int i; -@@ -4834,7 +4834,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, +@@ -4852,7 +4852,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, for (i = 0; i < TYPE_NFIELDS (arg_type); i++) { @@ -655,7 +655,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c struct type *field_type; /* We're only looking at normal fields. */ -@@ -4876,7 +4876,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -4894,7 +4894,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; @@ -664,7 +664,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5227,11 +5227,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -5245,11 +5245,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, : MIPS_V0_REGNUM); field < TYPE_NFIELDS (type); field++, regnum += 2) { @@ -680,7 +680,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) { /* A 16-byte long double field goes in two consecutive -@@ -5273,8 +5273,8 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -5291,8 +5291,8 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, if (offset + xfer > TYPE_LENGTH (type)) xfer = TYPE_LENGTH (type) - offset; if (mips_debug) @@ -691,7 +691,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c mips_xfer_register (gdbarch, regcache, gdbarch_num_regs (gdbarch) + regnum, xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf, -@@ -5332,7 +5332,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -5350,7 +5350,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; @@ -700,7 +700,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5396,13 +5396,13 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -5414,13 +5414,13 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -717,7 +717,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c val = value_contents (arg); -@@ -5856,8 +5856,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -5874,8 +5874,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; @@ -728,7 +728,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5917,13 +5917,13 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -5935,13 +5935,13 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -944,7 +944,7 @@ diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c -@@ -1205,7 +1205,7 @@ sparc64_16_byte_align_p (struct type *type) +@@ -1206,7 +1206,7 @@ sparc64_16_byte_align_p (struct type *type) static void sparc64_store_floating_fields (struct regcache *regcache, struct type *type, @@ -953,7 +953,7 @@ diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c { struct gdbarch *gdbarch = regcache->arch (); int len = TYPE_LENGTH (type); -@@ -1265,7 +1265,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, +@@ -1266,7 +1266,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -962,7 +962,7 @@ diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c sparc64_store_floating_fields (regcache, subtype, valbuf, element, subpos); -@@ -1297,7 +1297,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, +@@ -1298,7 +1298,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, static void sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, @@ -971,7 +971,7 @@ diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c { struct gdbarch *gdbarch = regcache->arch (); -@@ -1353,7 +1353,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, +@@ -1354,7 +1354,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -980,7 +980,7 @@ diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos); } -@@ -1386,7 +1386,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, +@@ -1387,7 +1387,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); @@ -989,7 +989,7 @@ diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c if (sparc64_structure_or_union_p (type) || (sparc64_complex_floating_p (type) && len == 32)) -@@ -1486,7 +1486,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, +@@ -1487,7 +1487,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, { const gdb_byte *valbuf = value_contents (args[i]); struct type *type = value_type (args[i]); @@ -1028,10 +1028,10 @@ diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c int stack_offset = 4; - int references_offset = 4; + LONGEST references_offset = 4; - CORE_ADDR func_addr = find_function_addr (function, NULL); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); struct type *func_type = value_type (function); -@@ -915,7 +915,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, + /* The first arg passed on stack. Mostly the first 10 args are passed by +@@ -914,7 +914,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Now make space on the stack for the args. */ for (argnum = 0; argnum < nargs; argnum++) { @@ -1040,7 +1040,7 @@ diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c if (argnum >= 10 - argreg) references_offset += len; stack_offset += len; -@@ -934,7 +934,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -933,7 +933,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -1049,7 +1049,7 @@ diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c enum type_code typecode = TYPE_CODE (arg_type); val = value_contents (arg); -@@ -1090,7 +1090,8 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -1089,7 +1089,8 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else internal_error (__FILE__, __LINE__, @@ -1131,7 +1131,7 @@ diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c -@@ -1626,8 +1626,7 @@ xtensa_store_return_value (struct type *type, +@@ -1625,8 +1625,7 @@ xtensa_store_return_value (struct type *type, if (len > (callsize > 8 ? 8 : 16)) internal_error (__FILE__, __LINE__, @@ -1141,7 +1141,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c areg = arreg_number (gdbarch, gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb); -@@ -1701,18 +1700,18 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1700,18 +1699,18 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int i; @@ -1163,7 +1163,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c int regno; /* regno if in register. */ } u; }; -@@ -1736,9 +1735,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1735,9 +1734,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); @@ -1177,7 +1177,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c switch (TYPE_CODE (arg_type)) { case TYPE_CODE_INT: -@@ -1808,8 +1808,8 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1807,8 +1807,8 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long); break; } @@ -1187,7 +1187,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c /* Align size and onstack_size. */ size = (size + info->align - 1) & ~(info->align - 1); -@@ -1854,7 +1854,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1853,7 +1853,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, if (info->onstack) { @@ -1196,7 +1196,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c CORE_ADDR offset = sp + info->u.offset; /* Odd-sized structs are aligned to the lower side of a memory -@@ -1870,7 +1870,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1869,7 +1869,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, } else { diff --git a/gdb-rhbz795424-bitpos-arrayview.patch b/gdb-rhbz795424-bitpos-arrayview.patch new file mode 100644 index 0000000..603a475 --- /dev/null +++ b/gdb-rhbz795424-bitpos-arrayview.patch @@ -0,0 +1,60 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Sergio Durigan Junior +Date: Wed, 12 Sep 2018 00:02:17 -0400 +Subject: gdb-rhbz795424-bitpos-arrayview.patch + +;; This patch is needed to compile GDB after -Werror=narrowing has +;; been enabled by default. +;; Author: Sergio Durigan Junior. + +diff --git a/gdb/common/array-view.h b/gdb/common/array-view.h +--- a/gdb/common/array-view.h ++++ b/gdb/common/array-view.h +@@ -85,7 +85,7 @@ public: + using value_type = T; + using reference = T &; + using const_reference = const T &; +- using size_type = size_t; ++ using size_type = ULONGEST; + + /* Default construction creates an empty view. */ + constexpr array_view () noexcept +@@ -114,7 +114,7 @@ public: + count. */ + template>> +- constexpr array_view (U *array, size_t size) noexcept ++ constexpr array_view (U *array, ULONGEST size) noexcept + : m_array (array), m_size (size) + {} + +@@ -128,7 +128,7 @@ public: + {} + + /* Create an array view from an array. */ +- template>> + constexpr array_view (U (&array)[Size]) noexcept + : m_array (array), m_size (Size) +@@ -161,9 +161,9 @@ public: + /*constexpr14*/ T *end () noexcept { return m_array + m_size; } + constexpr const T *end () const noexcept { return m_array + m_size; } + +- /*constexpr14*/ reference operator[] (size_t index) noexcept ++ /*constexpr14*/ reference operator[] (ULONGEST index) noexcept + { return m_array[index]; } +- constexpr const_reference operator[] (size_t index) const noexcept ++ constexpr const_reference operator[] (ULONGEST index) const noexcept + { return m_array[index]; } + + constexpr size_type size () const noexcept { return m_size; } +@@ -185,7 +185,7 @@ operator== (const gdb::array_view &lhs, const gdb::array_view &rhs) + if (lhs.size () != rhs.size ()) + return false; + +- for (size_t i = 0; i < lhs.size (); i++) ++ for (ULONGEST i = 0; i < lhs.size (); i++) + if (!(lhs[i] == rhs[i])) + return false; + diff --git a/gdb-rhbz881849-ipv6-1of3.patch b/gdb-rhbz881849-ipv6-1of3.patch deleted file mode 100644 index 7c3a664..0000000 --- a/gdb-rhbz881849-ipv6-1of3.patch +++ /dev/null @@ -1,1934 +0,0 @@ -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 - -;; Implement IPv6 support for GDB/gdbserver (RH BZ 881849, Sergio Durigan Junior). - -Implement IPv6 support for GDB/gdbserver - -This patch implements IPv6 support for both GDB and gdbserver. Based -on my research, it is the fourth attempt to do that since 2006. Since -I used ideas from all of the previous patches, I also added their -authors's names on the ChangeLogs as a way to recognize their -efforts. For reference sake, you can find the previous attempts at: - - https://sourceware.org/ml/gdb-patches/2006-09/msg00192.html - - https://sourceware.org/ml/gdb-patches/2014-02/msg00248.html - - https://sourceware.org/ml/gdb-patches/2016-02/msg00226.html - -The basic idea behind the patch is to start using the new -'getaddrinfo'/'getnameinfo' calls, which are responsible for -translating names and addresses in a protocol-independent way. This -means that if we ever have a new version of the IP protocol, we won't -need to change the code again (or, at least, won't have to change the -majority of the code). - -The function 'getaddrinfo' returns a linked list of possible addresses -to connect to. Dealing with multiple addresses proved to be a hard -task with the current TCP auto-retry mechanism implemented on -ser-tcp:net_open. For example, when gdbserver listened only on an -IPv4 socket: - - $ ./gdbserver --once 127.0.0.1:1234 ./a.out - -and GDB was instructed to try to connect to both IPv6 and IPv4 -sockets: - - $ ./gdb -ex 'target extended-remote localhost:1234' ./a.out - -the user would notice a somewhat big delay before GDB was able to -connect to the IPv4 socket. This happened because GDB was trying to -connect to the IPv6 socket first, and had to wait until the connection -timed out before it tried to connect to the IPv4 socket. - -For that reason, I had to rewrite the main loop and implement a new -method for handling multiple connections. After some discussion, -Pedro and I agreed on the following algorithm: - - 1) For each entry returned by 'getaddrinfo', we try to open a socket - and connect to it. - - 2.a) If we have a successful 'connect', we just use that connection. - - 2.b) If we don't have a successfull 'connect', but if we've got a - ECONNREFUSED (meaning the the connection was refused), we keep track - of this fact by using a flag. - - 2.c) If we don't have a successfull 'connect', but if we've got a - EINPROGRESS (meaning that the connection is in progress), we perform - a 'select' call on the socket until we have a result (either a - successful connection, or an error on the socket). - - 3) If tcp_auto_retry is true, and we haven't gotten a successful - connection, and at least one of our attempts failed with - ECONNREFUSED, then we wait a little bit (i.e., call - 'wait_for_connect'), check to see if there was a - timeout/interruption (in which case we bail out), and then go back - to (1). - -After multiple tests, I was able to connect without delay on the -scenario described above, and was also able to connect in all other -types of scenarios. - -I also implemented some hostname parsing functions (along with their -corresponding unit tests) which are used to help GDB and gdbserver to -parse hostname strings provided by the user. These new functions are -living inside common/netstuff.[ch]. I've had to do that since IPv6 -introduces a new URL scheme, which defines that square brackets can be -used to enclose the host part and differentiate it from the -port (e.g., "[::1]:1234" means "host ::1, port 1234"). I spent some -time thinking about a reasonable way to interpret what the user wants, -and I came up with the following: - - - If the user has provided a prefix that doesn't specify the protocol - version (i.e., "tcp:" or "udp:"), or if the user has not provided - any prefix, don't make any assumptions (i.e., assume AF_UNSPEC when - dealing with 'getaddrinfo') *unless* the host starts with "[" (in - which case, assume it's an IPv6 host). - - - If the user has provided a prefix that does specify the protocol - version (i.e., "tcp4:", "tcp6:", "udp4:" or "udp6:"), then respect - that. - -This method doesn't follow strictly what RFC 2732 proposes (that -literal IPv6 addresses should be provided enclosed in "[" and "]") -because IPv6 addresses still can be provided without square brackets -in our case, but since we have prefixes to specify protocol versions I -think this is not an issue. - -Another thing worth mentioning is the new 'GDB_TEST_SOCKETHOST' -testcase parameter, which makes it possible to specify the -hostname (without the port) to be used when testing GDB and -gdbserver. For example, to run IPv6 tests: - - $ make check-gdb RUNTESTFLAGS='GDB_TEST_SOCKETHOST=tcp6:[::1]' - -Or, to run IPv4 tests: - - $ make check-gdb RUNTESTFLAGS='GDB_TEST_SOCKETHOST=tcp4:127.0.0.1' - -This required a few changes on the gdbserver-base.exp, and also a -minimal adjustment on gdb.server/run-without-local-binary.exp. - -Finally, I've implemented a new testcase, -gdb.server/server-connect.exp, which is supposed to run on the native -host and perform various "smoke tests" using different connection -methods. - -This patch has been regression-tested on BuildBot and locally, and -also built using a x86_64-w64-mingw32 GCC, and no problems were found. - -gdb/ChangeLog: -2018-07-11 Sergio Durigan Junior - Jan Kratochvil - Paul Fertser - Tsutomu Seki - Pedro Alves - - * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add - 'unittests/parse-connection-spec-selftests.c'. - (COMMON_SFILES): Add 'common/netstuff.c'. - (HFILES_NO_SRCDIR): Add 'common/netstuff.h'. - * NEWS (Changes since GDB 8.2): Mention IPv6 support. - * common/netstuff.c: New file. - * common/netstuff.h: New file. - * ser-tcp.c: Include 'netstuff.h' and 'wspiapi.h'. - (wait_for_connect): Update comment. New parameter - 'gdb::optional sock' instead of 'struct serial *scb'. - Use 'sock' directly instead of 'scb->fd'. - (try_connect): New function, with code from 'net_open'. - (net_open): Rewrite main loop to deal with multiple - sockets/addresses. Handle IPv6-style hostnames; implement - support for IPv6 connections. - * unittests/parse-connection-spec-selftests.c: New file. - -gdb/gdbserver/ChangeLog: -2018-07-11 Sergio Durigan Junior - Jan Kratochvil - Paul Fertser - Tsutomu Seki - - * Makefile.in (SFILES): Add '$(srcdir)/common/netstuff.c'. - (OBS): Add 'common/netstuff.o'. - (GDBREPLAY_OBS): Likewise. - * gdbreplay.c: Include 'wspiapi.h' and 'netstuff.h'. - (remote_open): Implement support for IPv6 - connections. - * remote-utils.c: Include 'netstuff.h', 'filestuff.h' - and 'wspiapi.h'. - (handle_accept_event): Accept connections from IPv6 sources. - (remote_prepare): Handle IPv6-style hostnames; implement - support for IPv6 connections. - (remote_open): Implement support for printing connections from - IPv6 sources. - -gdb/testsuite/ChangeLog: -2018-07-11 Sergio Durigan Junior - Jan Kratochvil - Paul Fertser - Tsutomu Seki - - * README (Testsuite Parameters): Mention new 'GDB_TEST_SOCKETHOST' - parameter. - * boards/native-extended-gdbserver.exp: Do not set 'sockethost' - by default. - * boards/native-gdbserver.exp: Likewise. - * gdb.server/run-without-local-binary.exp: Improve regexp used - for detecting when a remote debugging connection succeeds. - * gdb.server/server-connect.exp: New file. - * lib/gdbserver-support.exp (gdbserver_default_get_comm_port): - Do not prefix the port number with ":". - (gdbserver_start): New global GDB_TEST_SOCKETHOST. Implement - support for detecting and using it. Add '$debughost_gdbserver' - to the list of arguments used to start gdbserver. Handle case - when gdbserver cannot resolve a network name. - -gdb/doc/ChangeLog: -2018-07-11 Sergio Durigan Junior - Jan Kratochvil - Paul Fertser - Tsutomu Seki - - * gdb.texinfo (Remote Connection Commands): Add explanation - about new IPv6 support. Add new connection prefixes. - -diff --git a/gdb/Makefile.in b/gdb/Makefile.in ---- a/gdb/Makefile.in -+++ b/gdb/Makefile.in -@@ -430,6 +430,7 @@ SUBDIR_UNITTESTS_SRCS = \ - unittests/offset-type-selftests.c \ - unittests/observable-selftests.c \ - unittests/optional-selftests.c \ -+ unittests/parse-connection-spec-selftests.c \ - unittests/ptid-selftests.c \ - unittests/rsp-low-selftests.c \ - unittests/scoped_fd-selftests.c \ -@@ -967,6 +968,7 @@ COMMON_SFILES = \ - common/job-control.c \ - common/gdb_tilde_expand.c \ - common/gdb_vecs.c \ -+ common/netstuff.c \ - common/new-op.c \ - common/pathstuff.c \ - common/print-utils.c \ -@@ -1448,6 +1450,7 @@ HFILES_NO_SRCDIR = \ - common/gdb_vecs.h \ - common/gdb_wait.h \ - common/common-inferior.h \ -+ common/netstuff.h \ - common/host-defs.h \ - common/pathstuff.h \ - common/print-utils.h \ -diff --git a/gdb/NEWS b/gdb/NEWS ---- a/gdb/NEWS -+++ b/gdb/NEWS -@@ -1,6 +1,12 @@ - What has changed in GDB? - (Organized release by release) - -+*** Changes since GDB 8.2 -+ -+* GDB and GDBserver now support IPv6 connections. IPv6 addresses -+ can be passed using the '[ADDRESS]:PORT' notation, or the regular -+ 'ADDRESS:PORT' method. -+ - *** Changes in GDB 8.2 - - * The 'set disassembler-options' command now supports specifying options -diff --git a/gdb/common/netstuff.c b/gdb/common/netstuff.c -new file mode 100644 ---- /dev/null -+++ b/gdb/common/netstuff.c -@@ -0,0 +1,155 @@ -+/* Operations on network stuff. -+ Copyright (C) 2018 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ 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 3 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 . */ -+ -+#include "common-defs.h" -+#include "netstuff.h" -+#include -+ -+#ifdef USE_WIN32API -+#include -+#include -+#else -+#include -+#include -+#include -+#include -+#include -+#endif -+ -+/* See common/netstuff.h. */ -+ -+scoped_free_addrinfo::~scoped_free_addrinfo () -+{ -+ freeaddrinfo (m_res); -+} -+ -+/* See common/netstuff.h. */ -+ -+parsed_connection_spec -+parse_connection_spec_without_prefix (std::string spec, struct addrinfo *hint) -+{ -+ parsed_connection_spec ret; -+ size_t last_colon_pos = 0; -+ /* We're dealing with IPv6 if: -+ -+ - ai_family is AF_INET6, or -+ - ai_family is not AF_INET, and -+ - spec[0] is '[', or -+ - the number of ':' on spec is greater than 1. */ -+ bool is_ipv6 = (hint->ai_family == AF_INET6 -+ || (hint->ai_family != AF_INET -+ && (spec[0] == '[' -+ || std::count (spec.begin (), -+ spec.end (), ':') > 1))); -+ -+ if (is_ipv6) -+ { -+ if (spec[0] == '[') -+ { -+ /* IPv6 addresses can be written as '[ADDR]:PORT', and we -+ support this notation. */ -+ size_t close_bracket_pos = spec.find_first_of (']'); -+ -+ if (close_bracket_pos == std::string::npos) -+ error (_("Missing close bracket in hostname '%s'"), -+ spec.c_str ()); -+ -+ hint->ai_family = AF_INET6; -+ -+ const char c = spec[close_bracket_pos + 1]; -+ -+ if (c == '\0') -+ last_colon_pos = std::string::npos; -+ else if (c != ':') -+ error (_("Invalid cruft after close bracket in '%s'"), -+ spec.c_str ()); -+ -+ /* Erase both '[' and ']'. */ -+ spec.erase (0, 1); -+ spec.erase (close_bracket_pos - 1, 1); -+ } -+ else if (spec.find_first_of (']') != std::string::npos) -+ error (_("Missing open bracket in hostname '%s'"), -+ spec.c_str ()); -+ } -+ -+ if (last_colon_pos == 0) -+ last_colon_pos = spec.find_last_of (':'); -+ -+ /* The length of the hostname part. */ -+ size_t host_len; -+ -+ if (last_colon_pos != std::string::npos) -+ { -+ /* The user has provided a port. */ -+ host_len = last_colon_pos; -+ ret.port_str = spec.substr (last_colon_pos + 1); -+ } -+ else -+ host_len = spec.size (); -+ -+ ret.host_str = spec.substr (0, host_len); -+ -+ /* Default hostname is localhost. */ -+ if (ret.host_str.empty ()) -+ ret.host_str = "localhost"; -+ -+ return ret; -+} -+ -+/* See common/netstuff.h. */ -+ -+parsed_connection_spec -+parse_connection_spec (const char *spec, struct addrinfo *hint) -+{ -+ /* Struct to hold the association between valid prefixes, their -+ family and socktype. */ -+ struct host_prefix -+ { -+ /* The prefix. */ -+ const char *prefix; -+ -+ /* The 'ai_family'. */ -+ int family; -+ -+ /* The 'ai_socktype'. */ -+ int socktype; -+ }; -+ static const struct host_prefix prefixes[] = -+ { -+ { "udp:", AF_UNSPEC, SOCK_DGRAM }, -+ { "tcp:", AF_UNSPEC, SOCK_STREAM }, -+ { "udp4:", AF_INET, SOCK_DGRAM }, -+ { "tcp4:", AF_INET, SOCK_STREAM }, -+ { "udp6:", AF_INET6, SOCK_DGRAM }, -+ { "tcp6:", AF_INET6, SOCK_STREAM }, -+ }; -+ -+ for (const host_prefix prefix : prefixes) -+ if (startswith (spec, prefix.prefix)) -+ { -+ spec += strlen (prefix.prefix); -+ hint->ai_family = prefix.family; -+ hint->ai_socktype = prefix.socktype; -+ hint->ai_protocol -+ = hint->ai_socktype == SOCK_DGRAM ? IPPROTO_UDP : IPPROTO_TCP; -+ break; -+ } -+ -+ return parse_connection_spec_without_prefix (spec, hint); -+} -diff --git a/gdb/common/netstuff.h b/gdb/common/netstuff.h -new file mode 100644 ---- /dev/null -+++ b/gdb/common/netstuff.h -@@ -0,0 +1,76 @@ -+/* Operations on network stuff. -+ Copyright (C) 2018 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ 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 3 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 . */ -+ -+#ifndef NETSTUFF_H -+#define NETSTUFF_H -+ -+#include -+ -+/* Like NI_MAXHOST/NI_MAXSERV, but enough for numeric forms. */ -+#define GDB_NI_MAX_ADDR 64 -+#define GDB_NI_MAX_PORT 16 -+ -+/* Helper class to guarantee that we always call 'freeaddrinfo'. */ -+ -+class scoped_free_addrinfo -+{ -+public: -+ /* Default constructor. */ -+ explicit scoped_free_addrinfo (struct addrinfo *ainfo) -+ : m_res (ainfo) -+ { -+ } -+ -+ /* Destructor responsible for free'ing M_RES by calling -+ 'freeaddrinfo'. */ -+ ~scoped_free_addrinfo (); -+ -+ DISABLE_COPY_AND_ASSIGN (scoped_free_addrinfo); -+ -+private: -+ /* The addrinfo resource. */ -+ struct addrinfo *m_res; -+}; -+ -+/* The struct we return after parsing the connection spec. */ -+ -+struct parsed_connection_spec -+{ -+ /* The hostname. */ -+ std::string host_str; -+ -+ /* The port, if any. */ -+ std::string port_str; -+}; -+ -+ -+/* Parse SPEC (which is a string in the form of "ADDR:PORT") and -+ return a 'parsed_connection_spec' structure with the proper fields -+ filled in. Also adjust HINT accordingly. */ -+extern parsed_connection_spec -+ parse_connection_spec_without_prefix (std::string spec, -+ struct addrinfo *hint); -+ -+/* Parse SPEC (which is a string in the form of -+ "[tcp[6]:|udp[6]:]ADDR:PORT") and return a 'parsed_connection_spec' -+ structure with the proper fields filled in. Also adjust HINT -+ accordingly. */ -+extern parsed_connection_spec parse_connection_spec (const char *spec, -+ struct addrinfo *hint); -+ -+#endif /* ! NETSTUFF_H */ -diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog ---- a/gdb/doc/ChangeLog -+++ b/gdb/doc/ChangeLog -@@ -1,3 +1,11 @@ -+2018-07-11 Sergio Durigan Junior -+ Jan Kratochvil -+ Paul Fertser -+ Tsutomu Seki -+ -+ * gdb.texinfo (Remote Connection Commands): Add explanation -+ about new IPv6 support. Add new connection prefixes. -+ - 2018-07-02 Maciej W. Rozycki - - PR tdep/8282 -diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo ---- a/gdb/doc/gdb.texinfo -+++ b/gdb/doc/gdb.texinfo -@@ -20548,16 +20548,27 @@ If you're using a serial line, you may want to give @value{GDBN} the - @code{target} command. - - @item target remote @code{@var{host}:@var{port}} -+@itemx target remote @code{@var{[host]}:@var{port}} - @itemx target remote @code{tcp:@var{host}:@var{port}} -+@itemx target remote @code{tcp:@var{[host]}:@var{port}} -+@itemx target remote @code{tcp4:@var{host}:@var{port}} -+@itemx target remote @code{tcp6:@var{host}:@var{port}} -+@itemx target remote @code{tcp6:@var{[host]}:@var{port}} - @itemx target extended-remote @code{@var{host}:@var{port}} -+@itemx target extended-remote @code{@var{[host]}:@var{port}} - @itemx target extended-remote @code{tcp:@var{host}:@var{port}} -+@itemx target extended-remote @code{tcp:@var{[host]}:@var{port}} -+@itemx target extended-remote @code{tcp4:@var{host}:@var{port}} -+@itemx target extended-remote @code{tcp6:@var{host}:@var{port}} -+@itemx target extended-remote @code{tcp6:@var{[host]}:@var{port}} - @cindex @acronym{TCP} port, @code{target remote} - Debug using a @acronym{TCP} connection to @var{port} on @var{host}. --The @var{host} may be either a host name or a numeric @acronym{IP} --address; @var{port} must be a decimal number. The @var{host} could be --the target machine itself, if it is directly connected to the net, or --it might be a terminal server which in turn has a serial line to the --target. -+The @var{host} may be either a host name, a numeric @acronym{IPv4} -+address, or a numeric @acronym{IPv6} address (with or without the -+square brackets to separate the address from the port); @var{port} -+must be a decimal number. The @var{host} could be the target machine -+itself, if it is directly connected to the net, or it might be a -+terminal server which in turn has a serial line to the target. - - For example, to connect to port 2828 on a terminal server named - @code{manyfarms}: -@@ -20566,6 +20577,28 @@ For example, to connect to port 2828 on a terminal server named - target remote manyfarms:2828 - @end smallexample - -+To connect to port 2828 on a terminal server whose address is -+@code{2001:0db8:85a3:0000:0000:8a2e:0370:7334}, you can either use the -+square bracket syntax: -+ -+@smallexample -+target remote [2001:0db8:85a3:0000:0000:8a2e:0370:7334]:2828 -+@end smallexample -+ -+@noindent -+or explicitly specify the @acronym{IPv6} protocol: -+ -+@smallexample -+target remote tcp6:2001:0db8:85a3:0000:0000:8a2e:0370:7334:2828 -+@end smallexample -+ -+This last example may be confusing to the reader, because there is no -+visible separation between the hostname and the port number. -+Therefore, we recommend the user to provide @acronym{IPv6} addresses -+using square brackets for clarity. However, it is important to -+mention that for @value{GDBN} there is no ambiguity: the number after -+the last colon is considered to be the port number. -+ - If your remote target is actually running on the same machine as your - debugger session (e.g.@: a simulator for your target running on the - same host), you can omit the hostname. For example, to connect to -@@ -20579,7 +20612,15 @@ target remote :1234 - Note that the colon is still required here. - - @item target remote @code{udp:@var{host}:@var{port}} -+@itemx target remote @code{udp:@var{[host]}:@var{port}} -+@itemx target remote @code{udp4:@var{host}:@var{port}} -+@itemx target remote @code{udp6:@var{[host]}:@var{port}} -+@itemx target extended-remote @code{udp:@var{host}:@var{port}} - @itemx target extended-remote @code{udp:@var{host}:@var{port}} -+@itemx target extended-remote @code{udp:@var{[host]}:@var{port}} -+@itemx target extended-remote @code{udp4:@var{host}:@var{port}} -+@itemx target extended-remote @code{udp6:@var{host}:@var{port}} -+@itemx target extended-remote @code{udp6:@var{[host]}:@var{port}} - @cindex @acronym{UDP} port, @code{target remote} - Debug using @acronym{UDP} packets to @var{port} on @var{host}. For example, to - connect to @acronym{UDP} port 2828 on a terminal server named @code{manyfarms}: -diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog ---- a/gdb/gdbserver/ChangeLog -+++ b/gdb/gdbserver/ChangeLog -@@ -1,3 +1,22 @@ -+2018-07-11 Sergio Durigan Junior -+ Jan Kratochvil -+ Paul Fertser -+ Tsutomu Seki -+ -+ * Makefile.in (SFILES): Add '$(srcdir)/common/netstuff.c'. -+ (OBS): Add 'common/netstuff.o'. -+ (GDBREPLAY_OBS): Likewise. -+ * gdbreplay.c: Include 'wspiapi.h' and 'netstuff.h'. -+ (remote_open): Implement support for IPv6 -+ connections. -+ * remote-utils.c: Include 'netstuff.h', 'filestuff.h' -+ and 'wspiapi.h'. -+ (handle_accept_event): Accept connections from IPv6 sources. -+ (remote_prepare): Handle IPv6-style hostnames; implement -+ support for IPv6 connections. -+ (remote_open): Implement support for printing connections from -+ IPv6 sources. -+ - 2018-07-11 Pedro Alves - - PR gdb/23377 -diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in ---- a/gdb/gdbserver/Makefile.in -+++ b/gdb/gdbserver/Makefile.in -@@ -211,6 +211,7 @@ SFILES = \ - $(srcdir)/common/job-control.c \ - $(srcdir)/common/gdb_tilde_expand.c \ - $(srcdir)/common/gdb_vecs.c \ -+ $(srcdir)/common/netstuff.c \ - $(srcdir)/common/new-op.c \ - $(srcdir)/common/pathstuff.c \ - $(srcdir)/common/print-utils.c \ -@@ -254,6 +255,7 @@ OBS = \ - common/format.o \ - common/gdb_tilde_expand.o \ - common/gdb_vecs.o \ -+ common/netstuff.o \ - common/new-op.o \ - common/pathstuff.o \ - common/print-utils.o \ -@@ -290,6 +292,7 @@ GDBREPLAY_OBS = \ - common/common-exceptions.o \ - common/common-utils.o \ - common/errors.o \ -+ common/netstuff.o \ - common/print-utils.o \ - gdbreplay.o \ - utils.o \ -diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c ---- a/gdb/gdbserver/gdbreplay.c -+++ b/gdb/gdbserver/gdbreplay.c -@@ -46,8 +46,11 @@ - - #if USE_WIN32API - #include -+#include - #endif - -+#include "netstuff.h" -+ - #ifndef HAVE_SOCKLEN_T - typedef int socklen_t; - #endif -@@ -142,56 +145,108 @@ remote_close (void) - static void - remote_open (char *name) - { -- if (!strchr (name, ':')) -+ char *last_colon = strrchr (name, ':'); -+ -+ if (last_colon == NULL) - { - fprintf (stderr, "%s: Must specify tcp connection as host:addr\n", name); - fflush (stderr); - exit (1); - } -- else -- { -+ - #ifdef USE_WIN32API -- static int winsock_initialized; -+ static int winsock_initialized; - #endif -- char *port_str; -- int port; -- struct sockaddr_in sockaddr; -- socklen_t tmp; -- int tmp_desc; -+ char *port_str; -+ int tmp; -+ int tmp_desc; -+ struct addrinfo hint; -+ struct addrinfo *ainfo; - -- port_str = strchr (name, ':'); -+ memset (&hint, 0, sizeof (hint)); -+ /* Assume no prefix will be passed, therefore we should use -+ AF_UNSPEC. */ -+ hint.ai_family = AF_UNSPEC; -+ hint.ai_socktype = SOCK_STREAM; -+ hint.ai_protocol = IPPROTO_TCP; - -- port = atoi (port_str + 1); -+ parsed_connection_spec parsed = parse_connection_spec (name, &hint); -+ -+ if (parsed.port_str.empty ()) -+ error (_("Missing port on hostname '%s'"), name); - - #ifdef USE_WIN32API -- if (!winsock_initialized) -- { -- WSADATA wsad; -+ if (!winsock_initialized) -+ { -+ WSADATA wsad; - -- WSAStartup (MAKEWORD (1, 0), &wsad); -- winsock_initialized = 1; -- } -+ WSAStartup (MAKEWORD (1, 0), &wsad); -+ winsock_initialized = 1; -+ } - #endif - -- tmp_desc = socket (PF_INET, SOCK_STREAM, 0); -- if (tmp_desc == -1) -- perror_with_name ("Can't open socket"); -+ int r = getaddrinfo (parsed.host_str.c_str (), parsed.port_str.c_str (), -+ &hint, &ainfo); - -- /* Allow rapid reuse of this port. */ -- tmp = 1; -- setsockopt (tmp_desc, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp, -- sizeof (tmp)); -+ if (r != 0) -+ { -+ fprintf (stderr, "%s:%s: cannot resolve name: %s\n", -+ parsed.host_str.c_str (), parsed.port_str.c_str (), -+ gai_strerror (r)); -+ fflush (stderr); -+ exit (1); -+ } -+ -+ scoped_free_addrinfo free_ainfo (ainfo); -+ -+ struct addrinfo *p; -+ -+ for (p = ainfo; p != NULL; p = p->ai_next) -+ { -+ tmp_desc = socket (p->ai_family, p->ai_socktype, p->ai_protocol); - -- sockaddr.sin_family = PF_INET; -- sockaddr.sin_port = htons (port); -- sockaddr.sin_addr.s_addr = INADDR_ANY; -+ if (tmp_desc >= 0) -+ break; -+ } -+ -+ if (p == NULL) -+ perror_with_name ("Cannot open socket"); - -- if (bind (tmp_desc, (struct sockaddr *) &sockaddr, sizeof (sockaddr)) -- || listen (tmp_desc, 1)) -- perror_with_name ("Can't bind address"); -+ /* Allow rapid reuse of this port. */ -+ tmp = 1; -+ setsockopt (tmp_desc, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp, -+ sizeof (tmp)); -+ -+ switch (p->ai_family) -+ { -+ case AF_INET: -+ ((struct sockaddr_in *) p->ai_addr)->sin_addr.s_addr = INADDR_ANY; -+ break; -+ case AF_INET6: -+ ((struct sockaddr_in6 *) p->ai_addr)->sin6_addr = in6addr_any; -+ break; -+ default: -+ fprintf (stderr, "Invalid 'ai_family' %d\n", p->ai_family); -+ exit (1); -+ } -+ -+ if (bind (tmp_desc, p->ai_addr, p->ai_addrlen) != 0) -+ perror_with_name ("Can't bind address"); -+ -+ if (p->ai_socktype == SOCK_DGRAM) -+ remote_desc = tmp_desc; -+ else -+ { -+ struct sockaddr_storage sockaddr; -+ socklen_t sockaddrsize = sizeof (sockaddr); -+ char orig_host[GDB_NI_MAX_ADDR], orig_port[GDB_NI_MAX_PORT]; -+ -+ if (listen (tmp_desc, 1) != 0) -+ perror_with_name ("Can't listen on socket"); -+ -+ remote_desc = accept (tmp_desc, (struct sockaddr *) &sockaddr, -+ &sockaddrsize); - -- tmp = sizeof (sockaddr); -- remote_desc = accept (tmp_desc, (struct sockaddr *) &sockaddr, &tmp); - if (remote_desc == -1) - perror_with_name ("Accept failed"); - -@@ -206,6 +261,16 @@ remote_open (char *name) - setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY, - (char *) &tmp, sizeof (tmp)); - -+ if (getnameinfo ((struct sockaddr *) &sockaddr, sockaddrsize, -+ orig_host, sizeof (orig_host), -+ orig_port, sizeof (orig_port), -+ NI_NUMERICHOST | NI_NUMERICSERV) == 0) -+ { -+ fprintf (stderr, "Remote debugging from host %s, port %s\n", -+ orig_host, orig_port); -+ fflush (stderr); -+ } -+ - #ifndef USE_WIN32API - close (tmp_desc); /* No longer need this */ - -diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c ---- a/gdb/gdbserver/remote-utils.c -+++ b/gdb/gdbserver/remote-utils.c -@@ -26,6 +26,8 @@ - #include "dll.h" - #include "rsp-low.h" - #include "gdbthread.h" -+#include "netstuff.h" -+#include "filestuff.h" - #include - #if HAVE_SYS_IOCTL_H - #include -@@ -63,6 +65,7 @@ - - #if USE_WIN32API - #include -+#include - #endif - - #if __QNX__ -@@ -151,19 +154,18 @@ enable_async_notification (int fd) - static int - handle_accept_event (int err, gdb_client_data client_data) - { -- struct sockaddr_in sockaddr; -- socklen_t tmp; -+ struct sockaddr_storage sockaddr; -+ socklen_t len = sizeof (sockaddr); - - if (debug_threads) - debug_printf ("handling possible accept event\n"); - -- tmp = sizeof (sockaddr); -- remote_desc = accept (listen_desc, (struct sockaddr *) &sockaddr, &tmp); -+ remote_desc = accept (listen_desc, (struct sockaddr *) &sockaddr, &len); - if (remote_desc == -1) - perror_with_name ("Accept failed"); - - /* Enable TCP keep alive process. */ -- tmp = 1; -+ socklen_t tmp = 1; - setsockopt (remote_desc, SOL_SOCKET, SO_KEEPALIVE, - (char *) &tmp, sizeof (tmp)); - -@@ -192,8 +194,19 @@ handle_accept_event (int err, gdb_client_data client_data) - delete_file_handler (listen_desc); - - /* Convert IP address to string. */ -- fprintf (stderr, "Remote debugging from host %s\n", -- inet_ntoa (sockaddr.sin_addr)); -+ char orig_host[GDB_NI_MAX_ADDR], orig_port[GDB_NI_MAX_PORT]; -+ -+ int r = getnameinfo ((struct sockaddr *) &sockaddr, len, -+ orig_host, sizeof (orig_host), -+ orig_port, sizeof (orig_port), -+ NI_NUMERICHOST | NI_NUMERICSERV); -+ -+ if (r != 0) -+ fprintf (stderr, _("Could not obtain remote address: %s\n"), -+ gai_strerror (r)); -+ else -+ fprintf (stderr, _("Remote debugging from host %s, port %s\n"), -+ orig_host, orig_port); - - enable_async_notification (remote_desc); - -@@ -222,10 +235,7 @@ remote_prepare (const char *name) - #ifdef USE_WIN32API - static int winsock_initialized; - #endif -- int port; -- struct sockaddr_in sockaddr; - socklen_t tmp; -- char *port_end; - - remote_is_stdio = 0; - if (strcmp (name, STDIO_CONNECTION_NAME) == 0) -@@ -238,17 +248,25 @@ remote_prepare (const char *name) - return; - } - -- port_str = strchr (name, ':'); -- if (port_str == NULL) -+ struct addrinfo hint; -+ struct addrinfo *ainfo; -+ -+ memset (&hint, 0, sizeof (hint)); -+ /* Assume no prefix will be passed, therefore we should use -+ AF_UNSPEC. */ -+ hint.ai_family = AF_UNSPEC; -+ hint.ai_socktype = SOCK_STREAM; -+ hint.ai_protocol = IPPROTO_TCP; -+ -+ parsed_connection_spec parsed -+ = parse_connection_spec_without_prefix (name, &hint); -+ -+ if (parsed.port_str.empty ()) - { - cs.transport_is_reliable = 0; - return; - } - -- port = strtoul (port_str + 1, &port_end, 10); -- if (port_str[1] == '\0' || *port_end != '\0') -- error ("Bad port argument: %s", name); -- - #ifdef USE_WIN32API - if (!winsock_initialized) - { -@@ -259,8 +277,26 @@ remote_prepare (const char *name) - } - #endif - -- listen_desc = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); -- if (listen_desc == -1) -+ int r = getaddrinfo (parsed.host_str.c_str (), parsed.port_str.c_str (), -+ &hint, &ainfo); -+ -+ if (r != 0) -+ error (_("%s: cannot resolve name: %s"), name, gai_strerror (r)); -+ -+ scoped_free_addrinfo freeaddrinfo (ainfo); -+ -+ struct addrinfo *iter; -+ -+ for (iter = ainfo; iter != NULL; iter = iter->ai_next) -+ { -+ listen_desc = gdb_socket_cloexec (iter->ai_family, iter->ai_socktype, -+ iter->ai_protocol); -+ -+ if (listen_desc >= 0) -+ break; -+ } -+ -+ if (iter == NULL) - perror_with_name ("Can't open socket"); - - /* Allow rapid reuse of this port. */ -@@ -268,14 +304,25 @@ remote_prepare (const char *name) - setsockopt (listen_desc, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp, - sizeof (tmp)); - -- sockaddr.sin_family = PF_INET; -- sockaddr.sin_port = htons (port); -- sockaddr.sin_addr.s_addr = INADDR_ANY; -+ switch (iter->ai_family) -+ { -+ case AF_INET: -+ ((struct sockaddr_in *) iter->ai_addr)->sin_addr.s_addr = INADDR_ANY; -+ break; -+ case AF_INET6: -+ ((struct sockaddr_in6 *) iter->ai_addr)->sin6_addr = in6addr_any; -+ break; -+ default: -+ internal_error (__FILE__, __LINE__, -+ _("Invalid 'ai_family' %d\n"), iter->ai_family); -+ } - -- if (bind (listen_desc, (struct sockaddr *) &sockaddr, sizeof (sockaddr)) -- || listen (listen_desc, 1)) -+ if (bind (listen_desc, iter->ai_addr, iter->ai_addrlen) != 0) - perror_with_name ("Can't bind address"); - -+ if (listen (listen_desc, 1) != 0) -+ perror_with_name ("Can't listen on socket"); -+ - cs.transport_is_reliable = 1; - } - -@@ -350,18 +397,24 @@ remote_open (const char *name) - #endif /* USE_WIN32API */ - else - { -- int port; -- socklen_t len; -- struct sockaddr_in sockaddr; -- -- len = sizeof (sockaddr); -- if (getsockname (listen_desc, -- (struct sockaddr *) &sockaddr, &len) < 0 -- || len < sizeof (sockaddr)) -+ char listen_port[GDB_NI_MAX_PORT]; -+ struct sockaddr_storage sockaddr; -+ socklen_t len = sizeof (sockaddr); -+ -+ if (getsockname (listen_desc, (struct sockaddr *) &sockaddr, &len) < 0) - perror_with_name ("Can't determine port"); -- port = ntohs (sockaddr.sin_port); - -- fprintf (stderr, "Listening on port %d\n", port); -+ int r = getnameinfo ((struct sockaddr *) &sockaddr, len, -+ NULL, 0, -+ listen_port, sizeof (listen_port), -+ NI_NUMERICSERV); -+ -+ if (r != 0) -+ fprintf (stderr, _("Can't obtain port where we are listening: %s"), -+ gai_strerror (r)); -+ else -+ fprintf (stderr, _("Listening on port %s\n"), listen_port); -+ - fflush (stderr); - - /* Register the event loop handler. */ -diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c ---- a/gdb/ser-tcp.c -+++ b/gdb/ser-tcp.c -@@ -25,6 +25,7 @@ - #include "cli/cli-decode.h" - #include "cli/cli-setshow.h" - #include "filestuff.h" -+#include "netstuff.h" - - #include - -@@ -39,6 +40,7 @@ - - #ifdef USE_WIN32API - #include -+#include - #ifndef ETIMEDOUT - #define ETIMEDOUT WSAETIMEDOUT - #endif -@@ -81,12 +83,13 @@ static unsigned int tcp_retry_limit = 15; - - #define POLL_INTERVAL 5 - --/* Helper function to wait a while. If SCB is non-null, wait on its -- file descriptor. Otherwise just wait on a timeout, updating *POLLS. -- Returns -1 on timeout or interrupt, otherwise the value of select. */ -+/* Helper function to wait a while. If SOCK is not -1, wait on its -+ file descriptor. Otherwise just wait on a timeout, updating -+ *POLLS. Returns -1 on timeout or interrupt, otherwise the value of -+ select. */ - - static int --wait_for_connect (struct serial *scb, unsigned int *polls) -+wait_for_connect (int sock, unsigned int *polls) - { - struct timeval t; - int n; -@@ -120,24 +123,24 @@ wait_for_connect (struct serial *scb, unsigned int *polls) - t.tv_usec = 0; - } - -- if (scb) -+ if (sock >= 0) - { - fd_set rset, wset, eset; - - FD_ZERO (&rset); -- FD_SET (scb->fd, &rset); -+ FD_SET (sock, &rset); - wset = rset; - eset = rset; -- -+ - /* POSIX systems return connection success or failure by signalling - wset. Windows systems return success in wset and failure in - eset. -- -+ - We must call select here, rather than gdb_select, because - the serial structure has not yet been initialized - the - MinGW select wrapper will not know that this FD refers - to a socket. */ -- n = select (scb->fd + 1, &rset, &wset, &eset, &t); -+ n = select (sock + 1, &rset, &wset, &eset, &t); - } - else - /* Use gdb_select here, since we have no file descriptors, and on -@@ -153,80 +156,28 @@ wait_for_connect (struct serial *scb, unsigned int *polls) - return n; - } - --/* Open a tcp socket. */ -+/* Try to connect to the host represented by AINFO. If the connection -+ succeeds, return its socket. Otherwise, return -1 and set ERRNO -+ accordingly. POLLS is used when 'connect' returns EINPROGRESS, and -+ we need to invoke 'wait_for_connect' to obtain the status. */ - --int --net_open (struct serial *scb, const char *name) -+static int -+try_connect (const struct addrinfo *ainfo, unsigned int *polls) - { -- char hostname[100]; -- const char *port_str; -- int n, port, tmp; -- int use_udp; -- struct hostent *hostent; -- struct sockaddr_in sockaddr; --#ifdef USE_WIN32API -- u_long ioarg; --#else -- int ioarg; --#endif -- unsigned int polls = 0; -- -- use_udp = 0; -- if (startswith (name, "udp:")) -- { -- use_udp = 1; -- name = name + 4; -- } -- else if (startswith (name, "tcp:")) -- name = name + 4; -- -- port_str = strchr (name, ':'); -- -- if (!port_str) -- error (_("net_open: No colon in host name!")); /* Shouldn't ever -- happen. */ -- -- tmp = std::min (port_str - name, (ptrdiff_t) sizeof hostname - 1); -- strncpy (hostname, name, tmp); /* Don't want colon. */ -- hostname[tmp] = '\000'; /* Tie off host name. */ -- port = atoi (port_str + 1); -- -- /* Default hostname is localhost. */ -- if (!hostname[0]) -- strcpy (hostname, "localhost"); -- -- hostent = gethostbyname (hostname); -- if (!hostent) -- { -- fprintf_unfiltered (gdb_stderr, "%s: unknown host\n", hostname); -- errno = ENOENT; -- return -1; -- } -+ int sock = gdb_socket_cloexec (ainfo->ai_family, ainfo->ai_socktype, -+ ainfo->ai_protocol); - -- sockaddr.sin_family = PF_INET; -- sockaddr.sin_port = htons (port); -- memcpy (&sockaddr.sin_addr.s_addr, hostent->h_addr, -- sizeof (struct in_addr)); -- -- retry: -- -- if (use_udp) -- scb->fd = gdb_socket_cloexec (PF_INET, SOCK_DGRAM, 0); -- else -- scb->fd = gdb_socket_cloexec (PF_INET, SOCK_STREAM, 0); -- -- if (scb->fd == -1) -+ if (sock < 0) - return -1; -- -+ - /* Set socket nonblocking. */ -- ioarg = 1; -- ioctl (scb->fd, FIONBIO, &ioarg); -+ int ioarg = 1; -+ -+ ioctl (sock, FIONBIO, &ioarg); - - /* Use Non-blocking connect. connect() will return 0 if connected - already. */ -- n = connect (scb->fd, (struct sockaddr *) &sockaddr, sizeof (sockaddr)); -- -- if (n < 0) -+ if (connect (sock, ainfo->ai_addr, ainfo->ai_addrlen) < 0) - { - #ifdef USE_WIN32API - int err = WSAGetLastError(); -@@ -234,21 +185,26 @@ net_open (struct serial *scb, const char *name) - int err = errno; - #endif - -- /* Maybe we're waiting for the remote target to become ready to -- accept connections. */ -- if (tcp_auto_retry -+ /* If we've got a "connection refused" error, just return -+ -1. The caller will know what to do. */ -+ if ( - #ifdef USE_WIN32API -- && err == WSAECONNREFUSED -+ err == WSAECONNREFUSED - #else -- && err == ECONNREFUSED -+ err == ECONNREFUSED - #endif -- && wait_for_connect (NULL, &polls) >= 0) -+ ) - { -- close (scb->fd); -- goto retry; -+ close (sock); -+ errno = err; -+ return -1; - } - - if ( -+ /* Any other error (except EINPROGRESS) will be "swallowed" -+ here. We return without specifying a return value, and -+ set errno if the caller wants to inspect what -+ happened. */ - #ifdef USE_WIN32API - /* Under Windows, calling "connect" with a non-blocking socket - results in WSAEWOULDBLOCK, not WSAEINPROGRESS. */ -@@ -258,66 +214,166 @@ net_open (struct serial *scb, const char *name) - #endif - ) - { -+ close (sock); - errno = err; -- net_close (scb); - return -1; - } - - /* Looks like we need to wait for the connect. */ -- do -- { -- n = wait_for_connect (scb, &polls); -- } -+ int n; -+ -+ do -+ n = wait_for_connect (sock, polls); - while (n == 0); -+ - if (n < 0) - { -- net_close (scb); -+ int saved_errno = errno; -+ -+ /* A negative value here means that we either timed out or -+ got interrupted by the user. Just return. */ -+ close (sock); -+ errno = saved_errno; - return -1; - } - } - - /* Got something. Is it an error? */ -- { -- int res, err; -- socklen_t len; -- -- len = sizeof (err); -- /* On Windows, the fourth parameter to getsockopt is a "char *"; -- on UNIX systems it is generally "void *". The cast to "char *" -- is OK everywhere, since in C++ any data pointer type can be -- implicitly converted to "void *". */ -- res = getsockopt (scb->fd, SOL_SOCKET, SO_ERROR, (char *) &err, &len); -- if (res < 0 || err) -- { -- /* Maybe the target still isn't ready to accept the connection. */ -- if (tcp_auto_retry -+ int err; -+ socklen_t len = sizeof (err); -+ -+ /* On Windows, the fourth parameter to getsockopt is a "char *"; -+ on UNIX systems it is generally "void *". The cast to "char *" -+ is OK everywhere, since in C++ any data pointer type can be -+ implicitly converted to "void *". */ -+ int ret = getsockopt (sock, SOL_SOCKET, SO_ERROR, (char *) &err, &len); -+ -+ if (ret < 0) -+ { -+ int saved_errno = errno; -+ -+ close (sock); -+ errno = saved_errno; -+ return -1; -+ } -+ else if (ret == 0 && err != 0) -+ { -+ close (sock); -+ errno = err; -+ return -1; -+ } -+ -+ /* The connection succeeded. Return the socket. */ -+ return sock; -+} -+ -+/* Open a tcp socket. */ -+ -+int -+net_open (struct serial *scb, const char *name) -+{ -+ struct addrinfo hint; -+ struct addrinfo *ainfo; -+ -+ memset (&hint, 0, sizeof (hint)); -+ /* Assume no prefix will be passed, therefore we should use -+ AF_UNSPEC. */ -+ hint.ai_family = AF_UNSPEC; -+ hint.ai_socktype = SOCK_STREAM; -+ hint.ai_protocol = IPPROTO_TCP; -+ -+ parsed_connection_spec parsed = parse_connection_spec (name, &hint); -+ -+ if (parsed.port_str.empty ()) -+ error (_("Missing port on hostname '%s'"), name); -+ -+ int r = getaddrinfo (parsed.host_str.c_str (), -+ parsed.port_str.c_str (), -+ &hint, &ainfo); -+ -+ if (r != 0) -+ { -+ fprintf_unfiltered (gdb_stderr, _("%s: cannot resolve name: %s\n"), -+ name, gai_strerror (r)); -+ errno = ENOENT; -+ return -1; -+ } -+ -+ scoped_free_addrinfo free_ainfo (ainfo); -+ -+ /* Flag to indicate whether we've got a connection refused. It will -+ be true if any of the connections tried was refused. */ -+ bool got_connrefused; -+ /* If a connection succeeeds, SUCCESS_AINFO will point to the -+ 'struct addrinfo' that succeed. */ -+ struct addrinfo *success_ainfo = NULL; -+ unsigned int polls = 0; -+ -+ /* Assume the worst. */ -+ scb->fd = -1; -+ -+ do -+ { -+ got_connrefused = false; -+ -+ for (struct addrinfo *iter = ainfo; iter != NULL; iter = iter->ai_next) -+ { -+ /* Iterate over the list of possible addresses to connect -+ to. For each, we'll try to connect and see if it -+ succeeds. */ -+ int sock = try_connect (iter, &polls); -+ -+ if (sock >= 0) -+ { -+ /* We've gotten a successful connection. Save its -+ 'struct addrinfo', the socket, and break. */ -+ success_ainfo = iter; -+ scb->fd = sock; -+ break; -+ } -+ else if ( - #ifdef USE_WIN32API -- && err == WSAECONNREFUSED -+ errno == WSAECONNREFUSED - #else -- && err == ECONNREFUSED -+ errno == ECONNREFUSED - #endif -- && wait_for_connect (NULL, &polls) >= 0) -- { -- close (scb->fd); -- goto retry; -- } -- if (err) -- errno = err; -- net_close (scb); -- return -1; -- } -- } -+ ) -+ got_connrefused = true; -+ } -+ } -+ /* Just retry if: -+ -+ - tcp_auto_retry is true, and -+ - We haven't gotten a connection yet, and -+ - Any of our connection attempts returned with ECONNREFUSED, and -+ - wait_for_connect signals that we can keep going. */ -+ while (tcp_auto_retry -+ && success_ainfo == NULL -+ && got_connrefused -+ && wait_for_connect (-1, &polls) >= 0); -+ -+ if (success_ainfo == NULL) -+ { -+ net_close (scb); -+ return -1; -+ } - - /* Turn off nonblocking. */ -- ioarg = 0; -+#ifdef USE_WIN32API -+ u_long ioarg = 0; -+#else -+ int ioarg = 0; -+#endif -+ - ioctl (scb->fd, FIONBIO, &ioarg); - -- if (use_udp == 0) -+ if (success_ainfo->ai_socktype == IPPROTO_TCP) - { - /* Disable Nagle algorithm. Needed in some cases. */ -- tmp = 1; -+ int tmp = 1; -+ - setsockopt (scb->fd, IPPROTO_TCP, TCP_NODELAY, -- (char *)&tmp, sizeof (tmp)); -+ (char *) &tmp, sizeof (tmp)); - } - - #ifdef SIGPIPE -diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog ---- a/gdb/testsuite/ChangeLog -+++ b/gdb/testsuite/ChangeLog -@@ -1,3 +1,23 @@ -+2018-07-11 Sergio Durigan Junior -+ Jan Kratochvil -+ Paul Fertser -+ Tsutomu Seki -+ -+ * README (Testsuite Parameters): Mention new 'GDB_TEST_SOCKETHOST' -+ parameter. -+ * boards/native-extended-gdbserver.exp: Do not set 'sockethost' -+ by default. -+ * boards/native-gdbserver.exp: Likewise. -+ * gdb.server/run-without-local-binary.exp: Improve regexp used -+ for detecting when a remote debugging connection succeeds. -+ * gdb.server/server-connect.exp: New file. -+ * lib/gdbserver-support.exp (gdbserver_default_get_comm_port): -+ Do not prefix the port number with ":". -+ (gdbserver_start): New global GDB_TEST_SOCKETHOST. Implement -+ support for detecting and using it. Add '$debughost_gdbserver' -+ to the list of arguments used to start gdbserver. Handle case -+ when gdbserver cannot resolve a network name. -+ - 2018-07-11 Sergio Durigan Junior - - PR c++/23373 -diff --git a/gdb/testsuite/README b/gdb/testsuite/README ---- a/gdb/testsuite/README -+++ b/gdb/testsuite/README -@@ -259,6 +259,20 @@ This make (not runtest) variable is used to specify whether the - testsuite preloads the read1.so library into expect. Any non-empty - value means true. See "Race detection" below. - -+GDB_TEST_SOCKETHOST -+ -+This variable can provide the hostname/address that should be used -+when performing GDBserver-related tests. This is useful in some -+situations, e.g., when you want to test the IPv6 connectivity of GDB -+and GDBserver, or when using a different hostname/address is needed. -+For example, to make GDB and GDBserver use IPv6-only connections, you -+can do: -+ -+ make check TESTS="gdb.server/*.exp" RUNTESTFLAGS='GDB_TEST_SOCKETHOST=tcp6:[::1]' -+ -+Note that only a hostname/address can be provided, without a port -+number. -+ - Race detection - ************** - -diff --git a/gdb/testsuite/boards/native-extended-gdbserver.exp b/gdb/testsuite/boards/native-extended-gdbserver.exp ---- a/gdb/testsuite/boards/native-extended-gdbserver.exp -+++ b/gdb/testsuite/boards/native-extended-gdbserver.exp -@@ -24,8 +24,6 @@ load_generic_config "extended-gdbserver" - load_board_description "gdbserver-base" - load_board_description "local-board" - --set_board_info sockethost "localhost:" -- - # We will be using the extended GDB remote protocol. - set_board_info gdb_protocol "extended-remote" - -diff --git a/gdb/testsuite/boards/native-gdbserver.exp b/gdb/testsuite/boards/native-gdbserver.exp ---- a/gdb/testsuite/boards/native-gdbserver.exp -+++ b/gdb/testsuite/boards/native-gdbserver.exp -@@ -30,7 +30,6 @@ set_board_info gdb,do_reload_on_run 1 - # There's no support for argument-passing (yet). - set_board_info noargs 1 - --set_board_info sockethost "localhost:" - set_board_info use_gdb_stub 1 - set_board_info exit_is_reliable 1 - -diff --git a/gdb/testsuite/gdb.server/run-without-local-binary.exp b/gdb/testsuite/gdb.server/run-without-local-binary.exp ---- a/gdb/testsuite/gdb.server/run-without-local-binary.exp -+++ b/gdb/testsuite/gdb.server/run-without-local-binary.exp -@@ -53,7 +53,7 @@ save_vars { GDBFLAGS } { - set use_gdb_stub 0 - - gdb_test "target ${gdbserver_protocol} ${gdbserver_gdbport}" \ -- "Remote debugging using $gdbserver_gdbport" \ -+ "Remote debugging using [string_to_regexp $gdbserver_gdbport]" \ - "connect to gdbserver" - - gdb_test "run" \ -diff --git a/gdb/testsuite/gdb.server/server-connect.exp b/gdb/testsuite/gdb.server/server-connect.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.server/server-connect.exp -@@ -0,0 +1,111 @@ -+# This testcase is part of GDB, the GNU debugger. -+# -+# Copyright 2018 Free Software Foundation, Inc. -+# -+# 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 3 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 . -+ -+# Test multiple types of connection (IPv4, IPv6, TCP, UDP) and make -+# sure both gdbserver and GDB work. -+ -+load_lib gdbserver-support.exp -+ -+standard_testfile normal.c -+ -+if {[skip_gdbserver_tests]} { -+ return 0 -+} -+ -+# We want to have control over where we start gdbserver. -+if { [is_remote target] } { -+ return 0 -+} -+ -+if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } { -+ return -1 -+} -+ -+# Make sure we're disconnected, in case we're testing with an -+# extended-remote board, therefore already connected. -+gdb_test "disconnect" ".*" -+ -+set target_exec [gdbserver_download_current_prog] -+ -+# An array containing the test instructions for each scenario. The -+# description of each field is as follows: -+# -+# - The connection specification to be used when starting -+# gdbserver/GDB. This string will be used to set the -+# GDB_TEST_SOCKETHOST when calling gdbserver_start. -+# -+# - A flag indicating whether gdbserver should fail when we attempt to -+# start it. Useful when testing erroneous connection specs such as -+# "tcp8:". -+# -+# - The prefix that should be prepended to the test messages. -+set test_params \ -+ { \ -+ { "tcp4:127.0.0.1" 0 "tcp4" } \ -+ { "tcp6:::1" 0 "tcp6" } \ -+ { "tcp6:[::1]" 0 "tcp6-with-brackets" } \ -+ { "tcp:localhost" 0 "tcp" } \ -+ { "udp4:127.0.0.1" 0 "udp4" } \ -+ { "udp6:::1" 0 "udp6" } \ -+ { "udp6:[::1]" 0 "udp6-with-brackets" } \ -+ { "tcp8:123" 1 "tcp8" } \ -+ { "udp123:::" 1 "udp123" } \ -+ { "garbage:1234" 1 "garbage:1234" } \ -+ } -+ -+# The best way to test different types of connections is to set the -+# GDB_TEST_SOCKETHOST variable accordingly. -+save_vars { GDB_TEST_SOCKETHOST } { -+ foreach line $test_params { -+ set sockhost [lindex $line 0] -+ set gdbserver_should_fail [lindex $line 1] -+ set prefix [lindex $line 2] -+ -+ with_test_prefix $prefix { -+ set GDB_TEST_SOCKETHOST $sockhost -+ set test "start gdbserver" -+ -+ # Try to start gdbserver. -+ set catchres [catch {set res [gdbserver_start "" $target_exec]} errmsg] -+ -+ if { $catchres != 0 } { -+ if { $gdbserver_should_fail } { -+ pass "$test: gdbserver failed as expected" -+ } else { -+ fail "$test: $errmsg" -+ } -+ continue -+ } else { -+ if { $gdbserver_should_fail } { -+ fail "$test: gdbserver should fail but did not" -+ } else { -+ pass "$test" -+ } -+ } -+ -+ set gdbserver_protocol [lindex $res 0] -+ set gdbserver_gdbport [lindex $res 1] -+ set test "connect to gdbserver using $sockhost" -+ -+ if { [gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport] == 0 } { -+ pass $test -+ } else { -+ fail $test -+ } -+ } -+ } -+} -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 -@@ -211,7 +211,7 @@ proc gdbserver_default_get_remote_address { host port } { - # Default routine to compute the "comm" argument for gdbserver. - - proc gdbserver_default_get_comm_port { port } { -- return ":$port" -+ return "$port" - } - - # Start a gdbserver process with initial OPTIONS and trailing ARGUMENTS. -@@ -221,6 +221,7 @@ proc gdbserver_default_get_comm_port { port } { - - proc gdbserver_start { options arguments } { - global portnum -+ global GDB_TEST_SOCKETHOST - - # Port id -- either specified in baseboard file, or managed here. - if [target_info exists gdb,socketport] { -@@ -231,10 +232,22 @@ proc gdbserver_start { options arguments } { - } - - # Extract the local and remote host ids from the target board struct. -- if [target_info exists sockethost] { -+ if { [info exists GDB_TEST_SOCKETHOST] } { -+ # The user is not supposed to provide a port number, just a -+ # hostname/address, therefore we add the trailing ":" here. -+ set debughost "${GDB_TEST_SOCKETHOST}:" -+ # Escape open and close square brackets. -+ set debughost_tmp [string map { [ \\[ ] \\] } $debughost] -+ # We need a "gdbserver" version of the debughost, which will -+ # have the possible connection prefix stripped. This is -+ # because gdbserver currently doesn't recognize the prefixes. -+ regsub -all "^\(tcp:|udp:|tcp4:|udp4:|tcp6:|udp6:\)" $debughost_tmp "" debughost_gdbserver -+ } elseif [target_info exists sockethost] { - set debughost [target_info sockethost] -+ set debughost_gdbserver $debughost - } else { - set debughost "localhost:" -+ set debughost_gdbserver $debughost - } - - # Some boards use a different value for the port that is passed to -@@ -277,8 +290,14 @@ proc gdbserver_start { options arguments } { - if { $options != "" } { - append gdbserver_command " $options" - } -+ if { $debughost_gdbserver != "" } { -+ append gdbserver_command " $debughost_gdbserver" -+ } - if { $portnum != "" } { -- append gdbserver_command " [$get_comm_port $portnum]" -+ if { $debughost_gdbserver == "" } { -+ append gdbserver_command " " -+ } -+ append gdbserver_command "[$get_comm_port $portnum]" - } - if { $arguments != "" } { - append gdbserver_command " $arguments" -@@ -307,6 +326,9 @@ proc gdbserver_start { options arguments } { - continue - } - } -+ -re ".*: cannot resolve name: Name or service not known\r\n" { -+ error "gdbserver cannot resolve name." -+ } - timeout { - error "Timeout waiting for gdbserver response." - } -diff --git a/gdb/unittests/parse-connection-spec-selftests.c b/gdb/unittests/parse-connection-spec-selftests.c -new file mode 100644 ---- /dev/null -+++ b/gdb/unittests/parse-connection-spec-selftests.c -@@ -0,0 +1,249 @@ -+/* Self tests for parsing connection specs for GDB, the GNU debugger. -+ -+ Copyright (C) 2018 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ 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 3 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 . */ -+ -+#include "defs.h" -+#include "selftest.h" -+#include "common/netstuff.h" -+#include "diagnostics.h" -+#ifdef USE_WIN32API -+#include -+#include -+#else -+#include -+#include -+#include -+#include -+#include -+#endif -+ -+namespace selftests { -+namespace parse_connection_spec_tests { -+ -+/* Auxiliary struct that holds info about a specific test for a -+ connection spec. */ -+ -+struct parse_conn_test -+{ -+ /* The connection spec. */ -+ const char *connspec; -+ -+ /* Expected result from 'parse_connection_spec'. */ -+ parsed_connection_spec expected_result; -+ -+ /* True if this test should fail, false otherwise. If true, only -+ the CONNSPEC field should be considered as valid. */ -+ bool should_fail; -+ -+ /* The expected AI_FAMILY to be found on the 'struct addrinfo' -+ HINT. */ -+ int exp_ai_family; -+ -+ /* The expected AI_SOCKTYPE to be found on the 'struct addrinfo' -+ HINT. */ -+ int exp_ai_socktype; -+ -+ /* The expected AI_PROTOCOL to be found on the 'struct addrinfo' -+ HINT. */ -+ int exp_ai_protocol; -+}; -+ -+/* Some defines to help us fill a 'struct parse_conn_test'. */ -+ -+/* Initialize a full entry. */ -+#define INIT_ENTRY(ADDR, EXP_HOST, EXP_PORT, SHOULD_FAIL, EXP_AI_FAMILY, \ -+ EXP_AI_SOCKTYPE, EXP_AI_PROTOCOL) \ -+ { ADDR, { EXP_HOST, EXP_PORT }, SHOULD_FAIL, EXP_AI_FAMILY, \ -+ EXP_AI_SOCKTYPE, EXP_AI_PROTOCOL } -+ -+/* Initialize an unprefixed entry. In this case, we don't expect -+ anything on the 'struct addrinfo' HINT. */ -+#define INIT_UNPREFIXED_ENTRY(ADDR, EXP_HOST, EXP_PORT) \ -+ INIT_ENTRY (ADDR, EXP_HOST, EXP_PORT, false, 0, 0, 0) -+ -+/* Initialized an unprefixed IPv6 entry. In this case, we don't -+ expect anything on the 'struct addrinfo' HINT. */ -+#define INIT_UNPREFIXED_IPV6_ENTRY(ADDR, EXP_HOST, EXP_PORT) \ -+ INIT_ENTRY (ADDR, EXP_HOST, EXP_PORT, false, AF_INET6, 0, 0) -+ -+/* Initialize a prefixed entry. */ -+#define INIT_PREFIXED_ENTRY(ADDR, EXP_HOST, EXP_PORT, EXP_AI_FAMILY, \ -+ EXP_AI_SOCKTYPE, EXP_AI_PROTOCOL) \ -+ INIT_ENTRY (ADDR, EXP_HOST, EXP_PORT, false, EXP_AI_FAMILY, \ -+ EXP_AI_SOCKTYPE, EXP_AI_PROTOCOL) -+ -+/* Initialize an entry prefixed with "tcp4:". */ -+#define INIT_PREFIXED_IPV4_TCP(ADDR, EXP_HOST, EXP_PORT) \ -+ INIT_PREFIXED_ENTRY (ADDR, EXP_HOST, EXP_PORT, AF_INET, SOCK_STREAM, \ -+ IPPROTO_TCP) -+ -+/* Initialize an entry prefixed with "tcp6:". */ -+#define INIT_PREFIXED_IPV6_TCP(ADDR, EXP_HOST, EXP_PORT) \ -+ INIT_PREFIXED_ENTRY (ADDR, EXP_HOST, EXP_PORT, AF_INET6, SOCK_STREAM, \ -+ IPPROTO_TCP) -+ -+/* Initialize an entry prefixed with "udp4:". */ -+#define INIT_PREFIXED_IPV4_UDP(ADDR, EXP_HOST, EXP_PORT) \ -+ INIT_PREFIXED_ENTRY (ADDR, EXP_HOST, EXP_PORT, AF_INET, SOCK_DGRAM, \ -+ IPPROTO_UDP) -+ -+/* Initialize an entry prefixed with "udp6:". */ -+#define INIT_PREFIXED_IPV6_UDP(ADDR, EXP_HOST, EXP_PORT) \ -+ INIT_PREFIXED_ENTRY (ADDR, EXP_HOST, EXP_PORT, AF_INET6, SOCK_DGRAM, \ -+ IPPROTO_UDP) -+ -+/* Initialize a bogus entry, i.e., a connection spec that should -+ fail. */ -+#define INIT_BOGUS_ENTRY(ADDR) \ -+ INIT_ENTRY (ADDR, "", "", true, 0, 0, 0) -+ -+/* The variable which holds all of our tests. */ -+ -+static const parse_conn_test conn_test[] = -+ { -+ /* Unprefixed addresses. */ -+ -+ /* IPv4, host and port present. */ -+ INIT_UNPREFIXED_ENTRY ("127.0.0.1:1234", "127.0.0.1", "1234"), -+ /* IPv4, only host. */ -+ INIT_UNPREFIXED_ENTRY ("127.0.0.1", "127.0.0.1", ""), -+ /* IPv4, missing port. */ -+ INIT_UNPREFIXED_ENTRY ("127.0.0.1:", "127.0.0.1", ""), -+ -+ /* IPv6, host and port present, no brackets. */ -+ INIT_UNPREFIXED_ENTRY ("::1:1234", "::1", "1234"), -+ /* IPv6, missing port, no brackets. */ -+ INIT_UNPREFIXED_ENTRY ("::1:", "::1", ""), -+ /* IPv6, host and port present, with brackets. */ -+ INIT_UNPREFIXED_IPV6_ENTRY ("[::1]:1234", "::1", "1234"), -+ /* IPv6, only host, with brackets. */ -+ INIT_UNPREFIXED_IPV6_ENTRY ("[::1]", "::1", ""), -+ /* IPv6, missing port, with brackets. */ -+ INIT_UNPREFIXED_IPV6_ENTRY ("[::1]:", "::1", ""), -+ -+ /* Unspecified, only port. */ -+ INIT_UNPREFIXED_ENTRY (":1234", "localhost", "1234"), -+ -+ /* Prefixed addresses. */ -+ -+ /* Prefixed "tcp4:" IPv4, host and port presents. */ -+ INIT_PREFIXED_IPV4_TCP ("tcp4:127.0.0.1:1234", "127.0.0.1", "1234"), -+ /* Prefixed "tcp4:" IPv4, only port. */ -+ INIT_PREFIXED_IPV4_TCP ("tcp4::1234", "localhost", "1234"), -+ /* Prefixed "tcp4:" IPv4, only host. */ -+ INIT_PREFIXED_IPV4_TCP ("tcp4:127.0.0.1", "127.0.0.1", ""), -+ /* Prefixed "tcp4:" IPv4, missing port. */ -+ INIT_PREFIXED_IPV4_TCP ("tcp4:127.0.0.1:", "127.0.0.1", ""), -+ -+ /* Prefixed "udp4:" IPv4, host and port present. */ -+ INIT_PREFIXED_IPV4_UDP ("udp4:127.0.0.1:1234", "127.0.0.1", "1234"), -+ /* Prefixed "udp4:" IPv4, only port. */ -+ INIT_PREFIXED_IPV4_UDP ("udp4::1234", "localhost", "1234"), -+ /* Prefixed "udp4:" IPv4, only host. */ -+ INIT_PREFIXED_IPV4_UDP ("udp4:127.0.0.1", "127.0.0.1", ""), -+ /* Prefixed "udp4:" IPv4, missing port. */ -+ INIT_PREFIXED_IPV4_UDP ("udp4:127.0.0.1:", "127.0.0.1", ""), -+ -+ -+ /* Prefixed "tcp6:" IPv6, host and port present. */ -+ INIT_PREFIXED_IPV6_TCP ("tcp6:::1:1234", "::1", "1234"), -+ /* Prefixed "tcp6:" IPv6, only port. */ -+ INIT_PREFIXED_IPV6_TCP ("tcp6::1234", "localhost", "1234"), -+ /* Prefixed "tcp6:" IPv6, only host. */ -+ //INIT_PREFIXED_IPV6_TCP ("tcp6:::1", "::1", ""), -+ /* Prefixed "tcp6:" IPv6, missing port. */ -+ INIT_PREFIXED_IPV6_TCP ("tcp6:::1:", "::1", ""), -+ -+ /* Prefixed "udp6:" IPv6, host and port present. */ -+ INIT_PREFIXED_IPV6_UDP ("udp6:::1:1234", "::1", "1234"), -+ /* Prefixed "udp6:" IPv6, only port. */ -+ INIT_PREFIXED_IPV6_UDP ("udp6::1234", "localhost", "1234"), -+ /* Prefixed "udp6:" IPv6, only host. */ -+ //INIT_PREFIXED_IPV6_UDP ("udp6:::1", "::1", ""), -+ /* Prefixed "udp6:" IPv6, missing port. */ -+ INIT_PREFIXED_IPV6_UDP ("udp6:::1:", "::1", ""), -+ -+ /* Prefixed "tcp6:" IPv6 with brackets, host and port present. */ -+ INIT_PREFIXED_IPV6_TCP ("tcp6:[::1]:1234", "::1", "1234"), -+ /* Prefixed "tcp6:" IPv6 with brackets, only host. */ -+ INIT_PREFIXED_IPV6_TCP ("tcp6:[::1]", "::1", ""), -+ /* Prefixed "tcp6:" IPv6 with brackets, missing port. */ -+ INIT_PREFIXED_IPV6_TCP ("tcp6:[::1]:", "::1", ""), -+ -+ /* Prefixed "udp6:" IPv6 with brackets, host and port present. */ -+ INIT_PREFIXED_IPV6_UDP ("udp6:[::1]:1234", "::1", "1234"), -+ /* Prefixed "udp6:" IPv6 with brackets, only host. */ -+ INIT_PREFIXED_IPV6_UDP ("udp6:[::1]", "::1", ""), -+ /* Prefixed "udp6:" IPv6 with brackets, missing port. */ -+ INIT_PREFIXED_IPV6_UDP ("udp6:[::1]:", "::1", ""), -+ -+ -+ /* Bogus addresses. */ -+ INIT_BOGUS_ENTRY ("tcp6:[::1]123:44"), -+ INIT_BOGUS_ENTRY ("[::1"), -+ INIT_BOGUS_ENTRY ("tcp6:::1]:"), -+ }; -+ -+/* Test a connection spec C. */ -+ -+static void -+test_conn (const parse_conn_test &c) -+{ -+ struct addrinfo hint; -+ parsed_connection_spec ret; -+ -+ memset (&hint, 0, sizeof (hint)); -+ -+ TRY -+ { -+ ret = parse_connection_spec (c.connspec, &hint); -+ } -+ CATCH (ex, RETURN_MASK_ERROR) -+ { -+ /* If we caught an error, we should check if this connection -+ spec was supposed to fail. */ -+ SELF_CHECK (c.should_fail); -+ return; -+ } -+ END_CATCH -+ -+ SELF_CHECK (!c.should_fail); -+ SELF_CHECK (ret.host_str == c.expected_result.host_str); -+ SELF_CHECK (ret.port_str == c.expected_result.port_str); -+ SELF_CHECK (hint.ai_family == c.exp_ai_family); -+ SELF_CHECK (hint.ai_socktype == c.exp_ai_socktype); -+ SELF_CHECK (hint.ai_protocol == c.exp_ai_protocol); -+} -+ -+/* Run the tests associated with parsing connection specs. */ -+ -+static void -+run_tests () -+{ -+ for (const parse_conn_test &c : conn_test) -+ test_conn (c); -+} -+} /* namespace parse_connection_spec_tests */ -+} /* namespace selftests */ -+ -+void -+_initialize_parse_connection_spec_selftests () -+{ -+ selftests::register_test ("parse_connection_spec", -+ selftests::parse_connection_spec_tests::run_tests); -+} 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-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch index faf836c..6054a4c 100644 --- a/gdb-vla-intel-fortran-strides.patch +++ b/gdb-vla-intel-fortran-strides.patch @@ -37,7 +37,7 @@ dbfd7140bf4c0500d1f5d192be781f83f78f7922 diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c -@@ -2600,11 +2600,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, +@@ -2659,11 +2659,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, /* See dwarf2loc.h. */ int @@ -54,7 +54,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c if (prop == NULL) return 0; -@@ -2628,7 +2631,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, +@@ -2687,7 +2690,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, *value = value_as_address (val); } @@ -63,7 +63,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c } } break; -@@ -2650,7 +2653,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, +@@ -2709,7 +2712,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, if (!value_optimized_out (val)) { *value = value_as_address (val); @@ -72,7 +72,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c } } } -@@ -2658,8 +2661,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, +@@ -2717,8 +2720,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, case PROP_CONST: *value = prop->data.const_val; @@ -83,7 +83,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c case PROP_ADDR_OFFSET: { struct dwarf2_property_baton *baton -@@ -2680,11 +2683,38 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, +@@ -2739,11 +2742,38 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, val = value_at (baton->offset_info.type, pinfo->addr + baton->offset_info.offset); *value = value_as_address (val); @@ -143,7 +143,7 @@ diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -17550,7 +17550,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17705,7 +17705,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type, *orig_base_type; struct type *range_type; struct attribute *attr; @@ -152,7 +152,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c int low_default_is_valid; int high_bound_is_count = 0; const char *name; -@@ -17570,7 +17570,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17725,7 +17725,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) low.kind = PROP_CONST; high.kind = PROP_CONST; @@ -162,7 +162,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow omitting DW_AT_lower_bound. */ -@@ -17603,6 +17605,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17758,6 +17760,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) break; } @@ -177,7 +177,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) attr_to_dynamic_prop (attr, die, cu, &low); -@@ -17680,7 +17690,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17850,7 +17860,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask)) high.data.const_val |= negative_mask; @@ -189,7 +189,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c diff --git a/gdb/eval.c b/gdb/eval.c --- a/gdb/eval.c +++ b/gdb/eval.c -@@ -377,29 +377,325 @@ init_array_element (struct value *array, struct value *element, +@@ -377,29 +377,324 @@ init_array_element (struct value *array, struct value *element, return index; } @@ -207,8 +207,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c + int *pos, int nargs, enum noside noside) { - int pc = (*pos) + 1; -+ int i, dim_count = 0; - LONGEST low_bound, high_bound; +- LONGEST low_bound, high_bound; - struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array))); - enum range_type range_type - = (enum range_type) longest_to_int (exp->elts[pc].longconst); @@ -219,6 +218,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c - low_bound = TYPE_LOW_BOUND (range); - else - low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); ++ int i, dim_count = 0; + struct value *new_array = array; + struct type *array_type = check_typedef (value_type (new_array)); + struct type *elt_type; @@ -533,7 +533,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c } -@@ -1926,19 +2222,8 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1930,19 +2225,8 @@ evaluate_subexp_standard (struct type *expect_type, switch (code) { case TYPE_CODE_ARRAY: @@ -554,7 +554,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c case TYPE_CODE_PTR: case TYPE_CODE_FUNC: -@@ -2334,49 +2619,6 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2338,49 +2622,6 @@ evaluate_subexp_standard (struct type *expect_type, } return (arg1); @@ -604,7 +604,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c case BINOP_LOGICAL_AND: arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); if (noside == EVAL_SKIP) -@@ -3293,6 +3535,9 @@ calc_f77_array_dims (struct type *array_type) +@@ -3301,6 +3542,9 @@ calc_f77_array_dims (struct type *array_type) int ndimen = 1; struct type *tmp_type; @@ -832,7 +832,7 @@ diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c -@@ -902,7 +902,8 @@ operator== (const range_bounds &l, const range_bounds &r) +@@ -911,7 +911,8 @@ operator== (const range_bounds &l, const range_bounds &r) struct type * create_range_type (struct type *result_type, struct type *index_type, const struct dynamic_prop *low_bound, @@ -842,7 +842,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c { if (result_type == NULL) result_type = alloc_type_copy (index_type); -@@ -917,6 +918,7 @@ create_range_type (struct type *result_type, struct type *index_type, +@@ -926,6 +927,7 @@ create_range_type (struct type *result_type, struct type *index_type, TYPE_ZALLOC (result_type, sizeof (struct range_bounds)); TYPE_RANGE_DATA (result_type)->low = *low_bound; TYPE_RANGE_DATA (result_type)->high = *high_bound; @@ -850,7 +850,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0) TYPE_UNSIGNED (result_type) = 1; -@@ -945,7 +947,7 @@ struct type * +@@ -954,7 +956,7 @@ struct type * create_static_range_type (struct type *result_type, struct type *index_type, LONGEST low_bound, LONGEST high_bound) { @@ -859,7 +859,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c low.kind = PROP_CONST; low.data.const_val = low_bound; -@@ -953,7 +955,11 @@ create_static_range_type (struct type *result_type, struct type *index_type, +@@ -962,7 +964,11 @@ create_static_range_type (struct type *result_type, struct type *index_type, high.kind = PROP_CONST; high.data.const_val = high_bound; @@ -872,7 +872,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c return result_type; } -@@ -1171,16 +1177,20 @@ create_array_type_with_stride (struct type *result_type, +@@ -1180,16 +1186,20 @@ create_array_type_with_stride (struct type *result_type, && (!type_not_associated (result_type) && !type_not_allocated (result_type))) { @@ -894,7 +894,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c else if (bit_stride > 0) TYPE_LENGTH (result_type) = (bit_stride * (high_bound - low_bound + 1) + 7) / 8; -@@ -1981,12 +1991,12 @@ resolve_dynamic_range (struct type *dyn_range_type, +@@ -1990,12 +2000,12 @@ resolve_dynamic_range (struct type *dyn_range_type, CORE_ADDR value; struct type *static_range_type, *static_target_type; const struct dynamic_prop *prop; @@ -909,7 +909,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c { low_bound.kind = PROP_CONST; low_bound.data.const_val = value; -@@ -1998,7 +2008,7 @@ resolve_dynamic_range (struct type *dyn_range_type, +@@ -2007,7 +2017,7 @@ resolve_dynamic_range (struct type *dyn_range_type, } prop = &TYPE_RANGE_DATA (dyn_range_type)->high; @@ -918,7 +918,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c { high_bound.kind = PROP_CONST; high_bound.data.const_val = value; -@@ -2013,12 +2023,20 @@ resolve_dynamic_range (struct type *dyn_range_type, +@@ -2022,12 +2032,20 @@ resolve_dynamic_range (struct type *dyn_range_type, high_bound.data.const_val = 0; } @@ -943,7 +943,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h -@@ -612,6 +612,10 @@ struct range_bounds +@@ -613,6 +613,10 @@ struct range_bounds struct dynamic_prop high; @@ -954,7 +954,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h /* True if HIGH range bound contains the number of elements in the subrange. This affects how the final hight bound is computed. */ -@@ -776,7 +780,6 @@ struct main_type +@@ -777,7 +781,6 @@ struct main_type /* * Union member used for range types. */ struct range_bounds *bounds; @@ -962,7 +962,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h } flds_bnds; /* * Slot to point to additional language-specific fields of this -@@ -1329,6 +1332,15 @@ extern bool set_type_align (struct type *, ULONGEST); +@@ -1330,6 +1333,15 @@ extern bool set_type_align (struct type *, ULONGEST); TYPE_RANGE_DATA(range_type)->high.kind #define TYPE_LOW_BOUND_KIND(range_type) \ TYPE_RANGE_DATA(range_type)->low.kind @@ -978,7 +978,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h /* Property accessors for the type data location. */ #define TYPE_DATA_LOCATION(thistype) \ -@@ -1363,6 +1375,9 @@ extern bool set_type_align (struct type *, ULONGEST); +@@ -1364,6 +1376,9 @@ extern bool set_type_align (struct type *, ULONGEST); TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \ TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) @@ -988,7 +988,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype)))) -@@ -1892,6 +1907,7 @@ extern struct type *create_array_type_with_stride +@@ -1899,6 +1914,7 @@ extern struct type *create_array_type_with_stride struct dynamic_prop *, unsigned int); extern struct type *create_range_type (struct type *, struct type *, @@ -999,7 +999,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h diff --git a/gdb/parse.c b/gdb/parse.c --- a/gdb/parse.c +++ b/gdb/parse.c -@@ -989,24 +989,20 @@ operator_length_standard (const struct expression *expr, int endpos, +@@ -988,24 +988,20 @@ operator_length_standard (const struct expression *expr, int endpos, case OP_RANGE: oplen = 3; @@ -1038,7 +1038,7 @@ diff --git a/gdb/parse.c b/gdb/parse.c diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y --- a/gdb/rust-exp.y +++ b/gdb/rust-exp.y -@@ -2478,24 +2478,28 @@ convert_ast_to_expression (struct parser_state *state, +@@ -2475,24 +2475,28 @@ rust_parser::convert_ast_to_expression (const struct rust_op *operation, case OP_RANGE: { @@ -1047,13 +1047,13 @@ diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y if (operation->left.op != NULL) { - convert_ast_to_expression (state, operation->left.op, top); + convert_ast_to_expression (operation->left.op, top); - kind = HIGH_BOUND_DEFAULT; + kind = SUBARRAY_LOW_BOUND; } if (operation->right.op != NULL) { - convert_ast_to_expression (state, operation->right.op, top); + convert_ast_to_expression (operation->right.op, top); - if (kind == BOTH_BOUND_DEFAULT) - kind = (operation->inclusive - ? LOW_BOUND_DEFAULT : LOW_BOUND_DEFAULT_EXCLUSIVE); @@ -1078,7 +1078,7 @@ diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c -@@ -1149,13 +1149,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside) +@@ -1181,13 +1181,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside) kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst); *pos += 3; @@ -1095,7 +1095,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c if (noside == EVAL_SKIP) return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1); -@@ -1244,7 +1242,7 @@ rust_compute_range (struct type *type, struct value *range, +@@ -1276,7 +1274,7 @@ rust_compute_range (struct type *type, struct value *range, *low = 0; *high = 0; @@ -1104,7 +1104,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c if (TYPE_NFIELDS (type) == 0) return; -@@ -1252,15 +1250,14 @@ rust_compute_range (struct type *type, struct value *range, +@@ -1284,15 +1282,14 @@ rust_compute_range (struct type *type, struct value *range, i = 0; if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0) { @@ -1122,7 +1122,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c *high = value_as_long (value_field (range, i)); if (rust_inclusive_range_type_p (type)) -@@ -1278,7 +1275,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, +@@ -1310,7 +1307,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, struct type *rhstype; LONGEST low, high_bound; /* Initialized to appease the compiler. */ @@ -1131,7 +1131,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c LONGEST high = 0; int want_slice = 0; -@@ -1376,7 +1373,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, +@@ -1408,7 +1405,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, error (_("Cannot subscript non-array type")); if (want_slice @@ -1140,7 +1140,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c low = low_bound; if (low < 0) error (_("Index less than zero")); -@@ -1394,7 +1391,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, +@@ -1426,7 +1423,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, CORE_ADDR addr; struct value *addrval, *tem; @@ -1761,7 +1761,7 @@ diff --git a/gdb/testsuite/gdb.fortran/vla.f90 b/gdb/testsuite/gdb.fortran/vla.f diff --git a/gdb/valarith.c b/gdb/valarith.c --- a/gdb/valarith.c +++ b/gdb/valarith.c -@@ -187,10 +187,16 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) +@@ -187,11 +187,17 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); ULONGEST elt_size = type_length_units (elt_type); @@ -1774,16 +1774,17 @@ diff --git a/gdb/valarith.c b/gdb/valarith.c + else + elt_offs *= elt_size; - if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) -- && elt_offs >= type_length_units (array_type))) -+ && abs (elt_offs) >= type_length_units (array_type))) + if (index < lowerbound + || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) +- && elt_offs >= type_length_units (array_type)) ++ && abs (elt_offs) >= type_length_units (array_type)) + || (VALUE_LVAL (array) != lval_memory + && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type))) { - if (type_not_associated (array_type)) - error (_("no such vector element (vector not associated)")); diff --git a/gdb/valops.c b/gdb/valops.c --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -3808,56 +3808,195 @@ value_of_this_silent (const struct language_defn *lang) +@@ -3807,56 +3807,195 @@ value_of_this_silent (const struct language_defn *lang) struct value * value_slice (struct value *array, int lowbound, int length) diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch index 8c15121..1646bd3 100644 --- a/gdb-vla-intel-fortran-vla-strings.patch +++ b/gdb-vla-intel-fortran-vla-strings.patch @@ -33,7 +33,7 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings diff --git a/gdb/NEWS b/gdb/NEWS --- a/gdb/NEWS +++ b/gdb/NEWS -@@ -106,6 +106,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* +@@ -203,6 +203,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* *** Changes in GDB 8.1 @@ -77,7 +77,7 @@ diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -1789,7 +1789,8 @@ static void read_signatured_type (struct signatured_type *); +@@ -1799,7 +1799,8 @@ static void read_signatured_type (struct signatured_type *); static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, struct dwarf2_cu *cu, @@ -87,7 +87,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c /* memory allocation interface */ -@@ -13648,7 +13649,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -13748,7 +13749,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) { newobj->static_link = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop); @@ -95,8 +95,8 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c + attr_to_dynamic_prop (attr, die, cu, newobj->static_link, NULL, 0); } - cu->list_in_scope = &local_symbols; -@@ -16313,7 +16314,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) + cu->list_in_scope = cu->builder->get_local_symbols (); +@@ -16468,7 +16469,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) byte_stride_prop = (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop)); @@ -106,7 +106,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (!stride_ok) { complaint (_("unable to read array DW_AT_byte_stride " -@@ -17074,29 +17076,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17229,29 +17231,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -150,7 +150,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c + operand. */ + DW_OP_deref_size, + /* Operand for DW_OP_deref_size. */ -+ DW_UNSND(byte_size) }; ++ (gdb_byte) DW_UNSND(byte_size) }; + + if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops, + ARRAY_SIZE(append_ops))) @@ -208,7 +208,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -17444,7 +17507,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17599,7 +17662,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, @@ -218,7 +218,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c { struct dwarf2_property_baton *baton; struct obstack *obstack -@@ -17455,14 +17519,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17610,14 +17674,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, if (attr_form_is_block (attr)) { @@ -256,7 +256,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } else if (attr_form_is_ref (attr)) { -@@ -17495,8 +17578,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17650,8 +17733,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, baton = XOBNEW (obstack, struct dwarf2_property_baton); baton->referenced_type = die_type (target_die, target_cu); baton->locexpr.per_cu = cu->per_cu; @@ -287,7 +287,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c prop->data.baton = baton; prop->kind = PROP_LOCEXPR; gdb_assert (prop->data.baton != NULL); -@@ -17607,7 +17710,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17762,7 +17865,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_byte_stride, cu); if (attr) @@ -296,7 +296,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c complaint (_("Missing DW_AT_byte_stride " "- DIE at 0x%s [in module %s]"), sect_offset_str (die->sect_off), -@@ -17615,7 +17718,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17770,7 +17873,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) @@ -305,20 +305,20 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c else if (!low_default_is_valid) complaint (_("Missing DW_AT_lower_bound " "- DIE at %s [in module %s]"), -@@ -17623,10 +17726,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - objfile_name (cu->per_cu->dwarf2_per_objfile->objfile)); +@@ -17779,10 +17882,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - attr = dwarf2_attr (die, DW_AT_upper_bound, cu); + struct attribute *attr_ub, *attr_count; + attr = attr_ub = dwarf2_attr (die, DW_AT_upper_bound, cu); - if (!attr_to_dynamic_prop (attr, die, cu, &high)) + if (!attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0)) { - attr = dwarf2_attr (die, DW_AT_count, cu); + attr = attr_count = dwarf2_attr (die, DW_AT_count, cu); - if (attr_to_dynamic_prop (attr, die, cu, &high)) + if (attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0)) { /* If bounds are constant do the final calculation here. */ if (low.kind == PROP_CONST && high.kind == PROP_CONST) -@@ -25127,7 +25230,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25337,7 +25440,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_allocated, cu); if (attr_form_is_block (attr)) { @@ -327,7 +327,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ALLOCATED, prop, type); } else if (attr != NULL) -@@ -25141,7 +25244,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25351,7 +25454,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_associated, cu); if (attr_form_is_block (attr)) { @@ -336,7 +336,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type); } else if (attr != NULL) -@@ -25153,7 +25256,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25363,7 +25466,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) /* Read DW_AT_data_location and set in type. */ attr = dwarf2_attr (die, DW_AT_data_location, cu); @@ -500,7 +500,7 @@ diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c -@@ -1904,7 +1904,8 @@ is_dynamic_type_internal (struct type *type, int top_level) +@@ -1913,7 +1913,8 @@ is_dynamic_type_internal (struct type *type, int top_level) type = check_typedef (type); /* We only want to recognize references at the outermost level. */ @@ -510,7 +510,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c type = check_typedef (TYPE_TARGET_TYPE (type)); /* Types that have a dynamic TYPE_DATA_LOCATION are considered -@@ -1938,6 +1939,7 @@ is_dynamic_type_internal (struct type *type, int top_level) +@@ -1947,6 +1948,7 @@ is_dynamic_type_internal (struct type *type, int top_level) } case TYPE_CODE_ARRAY: @@ -518,7 +518,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c { gdb_assert (TYPE_NFIELDS (type) == 1); -@@ -2056,7 +2058,8 @@ resolve_dynamic_array (struct type *type, +@@ -2065,7 +2067,8 @@ resolve_dynamic_array (struct type *type, struct dynamic_prop *prop; unsigned int bit_stride = 0; @@ -528,7 +528,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c type = copy_type (type); -@@ -2081,11 +2084,15 @@ resolve_dynamic_array (struct type *type, +@@ -2090,11 +2093,15 @@ resolve_dynamic_array (struct type *type, ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type)); @@ -545,7 +545,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c prop = get_dyn_prop (DYN_PROP_BYTE_STRIDE, type); if (prop != NULL) { -@@ -2240,6 +2247,28 @@ resolve_dynamic_struct (struct type *type, +@@ -2249,6 +2256,28 @@ resolve_dynamic_struct (struct type *type, return resolved_type; } @@ -574,7 +574,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c /* Worker for resolved_dynamic_type. */ static struct type * -@@ -2288,7 +2317,12 @@ resolve_dynamic_type_internal (struct type *type, +@@ -2297,7 +2326,12 @@ resolve_dynamic_type_internal (struct type *type, break; } diff --git a/gdb-vla-intel-stringbt-fix.patch b/gdb-vla-intel-stringbt-fix.patch index b2170f4..7b420ab 100644 --- a/gdb-vla-intel-stringbt-fix.patch +++ b/gdb-vla-intel-stringbt-fix.patch @@ -38,7 +38,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c #include "common/underlying.h" #include "common/byte-vector.h" -@@ -2348,6 +2349,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, +@@ -2388,6 +2389,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, ctx.per_cu = per_cu; ctx.obj_address = 0; diff --git a/gdb.spec b/gdb.spec index 4997f0c..918f9d9 100644 --- a/gdb.spec +++ b/gdb.spec @@ -18,15 +18,15 @@ Name: %{?scl_prefix}gdb # Freeze it when GDB gets branched -%global snapsrc 20180727 +%global snapsrc 20180917 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20161115 %global tarname gdb-%{version} -Version: 8.1.90.%{snapsrc} +Version: 8.2.50.%{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: 45%{?dist} +Release: 1%{?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 @@ -1022,6 +1022,10 @@ fi %endif %changelog +* Mon Sep 17 2018 Sergio Durigan Junior - 8.2.50.20180917-1.fc30 +- Rebase to FSF GDB 8.2.50.20180917 (8.3pre). +- Add 'gdb-rhbz795424-bitpos-arrayview.patch'. + * Tue Aug 21 2018 Sergio Durigan Junior - 8.1.90.20180727-45.fc30 - Enable verbose output when running "make". diff --git a/sources b/sources index 5d8b853..c17ff7d 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz) = a8b1c54dd348cfeb37da73f968742896be3dd13a4215f8d8519870c2abea915f5176c3fa6989ddd10f20020a16f0fab20cbae68ee8d58a82234d8778023520f8 -SHA512 (gdb-8.1.90.20180727.tar.xz) = 0f8e9cfaeaf9f22361b3b8d5d490d0a8bea3eeaaa0c6813d5df0a6d5267ff3f597747cc0e97d70c4196d78ee32e0e82d5893283d71b449d89703893bf1ae0014 SHA512 (v2.0.tar.gz) = ec63151e842c81cc73ea11ba560b63e005cefbe19d98de24ae5c8caa4de7c9c1d71d1ec5b6214a347592eac675b75a3d2b26d4691ca86f91020ebfea8e912939 +SHA512 (gdb-8.2.50.20180917.tar.xz) = 92f07fc062ff9d7cb5683507a256f65ae9d29b7d6368d22f474041201c129b1d3f687f02e89e509d5fd8e9c08dbc8bbf9d9aad56d9dbdc2f6e2baef223cc90ef From fc163ce193e50744345e6947b3c5214b45d1df12 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 19 Sep 2018 16:28:35 -0400 Subject: [PATCH 28/35] Remove 'gdb-6.5-bz203661-emit-relocs.patch'. Update changelog entry for last release. --- _gdb.spec.Patch.include | 216 ++++++++++++++--------------- _gdb.spec.patch.include | 1 - _patch_order | 1 - gdb-6.5-bz203661-emit-relocs.patch | 24 ---- gdb.spec | 16 ++- 5 files changed, 121 insertions(+), 137 deletions(-) delete mode 100644 gdb-6.5-bz203661-emit-relocs.patch diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include index 47bf685..8000fa7 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -58,246 +58,242 @@ Patch014: gdb-6.3-inheritancetest-20050726.patch #=push Patch015: gdb-6.3-readnever-20050907.patch -# Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661). -#=push+jan: There was some mail thread about it, this patch may be a hack. -Patch016: gdb-6.5-bz203661-emit-relocs.patch - # Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337). #=push+jan: It should be replaced by Infinity project. -Patch017: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +Patch016: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch # Fix TLS symbols resolving for shared libraries with a relative pathname. # The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'. #=fedoratest: One should recheck if it is really fixed upstream. -Patch018: gdb-6.5-sharedlibrary-path.patch +Patch017: gdb-6.5-sharedlibrary-path.patch # Improved testsuite results by the testsuite provided by the courtesy of BEA. #=fedoratest: For upstream it should be rewritten as a dejagnu test, the test of no "??" was useful. -Patch019: gdb-6.5-BEA-testsuite.patch +Patch018: gdb-6.5-BEA-testsuite.patch # Testcase for deadlocking on last address space byte; for corrupted backtraces. #=fedoratest -Patch020: gdb-6.5-last-address-space-byte-test.patch +Patch019: gdb-6.5-last-address-space-byte-test.patch # Fix readline segfault on excessively long hand-typed lines. #=fedoratest -Patch021: gdb-6.5-readline-long-line-crash-test.patch +Patch020: gdb-6.5-readline-long-line-crash-test.patch # Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711). #=fedora -Patch022: gdb-6.5-bz216711-clone-is-outermost.patch +Patch021: gdb-6.5-bz216711-clone-is-outermost.patch # Test sideeffects of skipping ppc .so libs trampolines (BZ 218379). #=fedoratest -Patch023: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +Patch022: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch # Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379). #=fedora -Patch024: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +Patch023: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch # Find symbols properly at their original (included) file (BZ 109921). #=fedoratest -Patch025: gdb-6.5-bz109921-DW_AT_decl_file-test.patch +Patch024: gdb-6.5-bz109921-DW_AT_decl_file-test.patch # Update PPC unwinding patches to their upstream variants (BZ 140532). #=fedoratest -Patch026: gdb-6.3-bz140532-ppc-unwinding-test.patch +Patch025: gdb-6.3-bz140532-ppc-unwinding-test.patch # Testcase for exec() from threaded program (BZ 202689). #=fedoratest -Patch027: gdb-6.3-bz202689-exec-from-pthread-test.patch +Patch026: gdb-6.3-bz202689-exec-from-pthread-test.patch # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). #=fedoratest -Patch028: gdb-6.6-bz230000-power6-disassembly-test.patch +Patch027: gdb-6.6-bz230000-power6-disassembly-test.patch # Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517). #=fedoratest -Patch029: gdb-6.6-bz229517-gcore-without-terminal.patch +Patch028: gdb-6.6-bz229517-gcore-without-terminal.patch # Avoid too long timeouts on failing cases of "annota1.exp annota3.exp". #=fedoratest -Patch030: gdb-6.6-testsuite-timeouts.patch +Patch029: gdb-6.6-testsuite-timeouts.patch # Support for stepping over PPC atomic instruction sequences (BZ 237572). #=fedoratest -Patch031: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch030: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch # Make upstream `set scheduler-locking step' as default. #=push+jan: How much is scheduler-locking relevant after non-stop? -Patch032: gdb-6.6-scheduler_locking-step-is-default.patch +Patch031: gdb-6.6-scheduler_locking-step-is-default.patch # Test kernel VDSO decoding while attaching to an i386 process. #=fedoratest -Patch033: gdb-6.3-attach-see-vdso-test.patch +Patch032: gdb-6.3-attach-see-vdso-test.patch # Test leftover zombie process (BZ 243845). #=fedoratest -Patch034: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch033: gdb-6.5-bz243845-stale-testing-zombie-test.patch # New locating of the matching binaries from the pure core file (build-id). #=push+jan -Patch035: gdb-6.6-buildid-locate.patch +Patch034: gdb-6.6-buildid-locate.patch # Fix loading of core files without build-ids but with build-ids in executables. # Load strictly build-id-checked core files only if no executable is specified # (Jan Kratochvil, RH BZ 1339862). #=push+jan -Patch036: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch035: gdb-6.6-buildid-locate-solib-missing-ids.patch #=push+jan -Patch037: gdb-6.6-buildid-locate-rpm.patch +Patch036: gdb-6.6-buildid-locate-rpm.patch # Fix displaying of numeric char arrays as strings (BZ 224128). #=fedoratest: But it is failing anyway, one should check the behavior more. -Patch038: gdb-6.7-charsign-test.patch +Patch037: gdb-6.7-charsign-test.patch # Test PPC hiding of call-volatile parameter register. #=fedoratest -Patch039: gdb-6.7-ppc-clobbered-registers-O2-test.patch +Patch038: gdb-6.7-ppc-clobbered-registers-O2-test.patch # Testsuite fixes for more stable/comparable results. #=fedoratest -Patch040: gdb-6.7-testsuite-stable-results.patch +Patch039: gdb-6.7-testsuite-stable-results.patch # Test ia64 memory leaks of the code using libunwind. #=fedoratest -Patch041: gdb-6.5-ia64-libunwind-leak-test.patch +Patch040: gdb-6.5-ia64-libunwind-leak-test.patch # Test hiding unexpected breakpoints on intentional step commands. #=fedoratest -Patch042: gdb-6.5-missed-trap-on-step-test.patch +Patch041: gdb-6.5-missed-trap-on-step-test.patch # Test gcore memory and time requirements for large inferiors. #=fedoratest -Patch043: gdb-6.5-gcore-buffer-limit-test.patch +Patch042: gdb-6.5-gcore-buffer-limit-test.patch # Test GCORE for shmid 0 shared memory mappings. #=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible. -Patch044: gdb-6.3-mapping-zero-inode-test.patch +Patch043: gdb-6.3-mapping-zero-inode-test.patch # Test a crash on `focus cmd', `focus prev' commands. #=fedoratest -Patch045: gdb-6.3-focus-cmd-prev-test.patch +Patch044: gdb-6.3-focus-cmd-prev-test.patch # Test various forms of threads tracking across exec() (BZ 442765). #=fedoratest -Patch046: gdb-6.8-bz442765-threaded-exec-test.patch +Patch045: gdb-6.8-bz442765-threaded-exec-test.patch # Silence memcpy check which returns false positive (sparc64) #=push: But it is just a GCC workaround, look up the existing GCC PR for it. -Patch047: gdb-6.8-sparc64-silence-memcpy-check.patch +Patch046: gdb-6.8-sparc64-silence-memcpy-check.patch # Test a crash on libraries missing the .text section. #=fedoratest -Patch048: gdb-6.5-section-num-fixup-test.patch +Patch047: gdb-6.5-section-num-fixup-test.patch # Fix register assignments with no GDB stack frames (BZ 436037). #=push+jan: This fix is incorrect. -Patch049: gdb-6.8-bz436037-reg-no-longer-active.patch +Patch048: gdb-6.8-bz436037-reg-no-longer-active.patch # Test the watchpoints conditionals works. #=fedoratest -Patch050: gdb-6.8-watchpoint-conditionals-test.patch +Patch049: gdb-6.8-watchpoint-conditionals-test.patch # Fix resolving of variables at locations lists in prelinked libs (BZ 466901). #=fedoratest -Patch051: gdb-6.8-bz466901-backtrace-full-prelinked.patch +Patch050: gdb-6.8-bz466901-backtrace-full-prelinked.patch # New test for step-resume breakpoint placed in multiple threads at once. #=fedoratest -Patch052: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch051: gdb-simultaneous-step-resume-breakpoint-test.patch # Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. # Fix regression of undisplayed missing shared libraries caused by a fix for. #=fedoratest: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*> -Patch053: gdb-core-open-vdso-warning.patch +Patch052: gdb-core-open-vdso-warning.patch # Fix syscall restarts for amd64->i386 biarch. #=push+jan -Patch054: gdb-x86_64-i386-syscall-restart.patch +Patch053: gdb-x86_64-i386-syscall-restart.patch # Fix stepping with OMP parallel Fortran sections (BZ 533176). #=push+jan: It requires some better DWARF annotations. -Patch055: gdb-bz533176-fortran-omp-step.patch +Patch054: gdb-bz533176-fortran-omp-step.patch # Fix regression by python on ia64 due to stale current frame. #=push+jan -Patch056: gdb-follow-child-stale-parent.patch +Patch055: gdb-follow-child-stale-parent.patch # Workaround ccache making lineno non-zero for command-line definitions. #=fedoratest: ccache is rarely used and it is even fixed now. -Patch057: gdb-ccache-workaround.patch +Patch056: gdb-ccache-workaround.patch #=push+jan: May get obsoleted by Tom's unrelocated objfiles patch. -Patch058: gdb-archer-pie-addons.patch +Patch057: gdb-archer-pie-addons.patch #=push+jan: Breakpoints disabling matching should not be based on address. -Patch059: gdb-archer-pie-addons-keep-disabled.patch +Patch058: gdb-archer-pie-addons-keep-disabled.patch # Testcase for "Do not make up line information" fix by Daniel Jacobowitz. #=fedoratest -Patch060: gdb-lineno-makeup-test.patch +Patch059: gdb-lineno-makeup-test.patch # Test power7 ppc disassembly. #=fedoratest -Patch061: gdb-ppc-power7-test.patch +Patch060: gdb-ppc-power7-test.patch # Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866). # Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866). #=push+jan: It should be fixed properly instead. -Patch062: gdb-bz541866-rwatch-before-run.patch +Patch061: gdb-bz541866-rwatch-before-run.patch # Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623). #=push+jan: Currently it is still not fully safe. -Patch063: gdb-moribund-utrace-workaround.patch +Patch062: gdb-moribund-utrace-workaround.patch # Fix follow-exec for C++ programs (bugreported by Martin Stransky). #=fedoratest -Patch064: gdb-archer-next-over-throw-cxx-exec.patch +Patch063: gdb-archer-next-over-throw-cxx-exec.patch # Backport DWARF-4 support (BZ 601887, Tom Tromey). #=fedoratest -Patch065: gdb-bz601887-dwarf4-rh-test.patch +Patch064: gdb-bz601887-dwarf4-rh-test.patch #=push+jan -Patch066: gdb-6.6-buildid-locate-core-as-arg.patch +Patch065: gdb-6.6-buildid-locate-core-as-arg.patch # Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). #=push+jan -Patch067: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +Patch066: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch # [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604). #=fedoratest -Patch068: gdb-test-bt-cfi-without-die.patch +Patch067: gdb-test-bt-cfi-without-die.patch # Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248). #=push+jan: Inferior objects should be read in parts, then this patch gets obsoleted. -Patch069: gdb-bz568248-oom-is-error.patch +Patch068: gdb-bz568248-oom-is-error.patch # Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). #=fedoratest -Patch070: gdb-bz634108-solib_address.patch +Patch069: gdb-bz634108-solib_address.patch # New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435). #=fedoratest -Patch071: gdb-test-pid0-core.patch +Patch070: gdb-test-pid0-core.patch # [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp. #=fedoratest -Patch072: gdb-test-dw2-aranges.patch +Patch071: gdb-test-dw2-aranges.patch # [archer-keiths-expr-cumulative+upstream] Import C++ testcases. #=fedoratest -Patch073: gdb-test-expr-cumulative-archer.patch +Patch072: gdb-test-expr-cumulative-archer.patch # Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). #=fedoratest -Patch074: gdb-physname-pr11734-test.patch +Patch073: gdb-physname-pr11734-test.patch # Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). #=fedoratest -Patch075: gdb-physname-pr12273-test.patch +Patch074: gdb-physname-pr12273-test.patch # Toolchain on sparc is slightly broken and debuginfo files are generated # with non 64bit aligned tables/offsets. @@ -311,201 +307,201 @@ Patch075: gdb-physname-pr12273-test.patch # While we figure out what's wrong in the toolchain and do a full archive # rebuild to fix it, we need to be able to use gdb :) #=push -Patch076: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch +Patch075: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch # Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890). #=fedoratest -Patch077: gdb-test-ivy-bridge.patch +Patch076: gdb-test-ivy-bridge.patch # Hack for proper PIE run of the testsuite. #=fedoratest -Patch078: gdb-runtest-pie-override.patch +Patch077: gdb-runtest-pie-override.patch # Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878). #=push+jan -Patch079: gdb-attach-fail-reasons-5of5.patch +Patch078: gdb-attach-fail-reasons-5of5.patch # Workaround PR libc/14166 for inferior calls of strstr. #=fedora: Compatibility with RHELs (unchecked which ones). -Patch080: gdb-glibc-strstr-workaround.patch +Patch079: gdb-glibc-strstr-workaround.patch # Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789). #=fedoratest -Patch081: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +Patch080: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch # Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343). #=fedoratest -Patch082: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch081: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch083: gdb-rhbz795424-bitpos-20of25.patch +Patch082: gdb-rhbz795424-bitpos-20of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch084: gdb-rhbz795424-bitpos-21of25.patch +Patch083: gdb-rhbz795424-bitpos-21of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch085: gdb-rhbz795424-bitpos-22of25.patch +Patch084: gdb-rhbz795424-bitpos-22of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch086: gdb-rhbz795424-bitpos-23of25.patch +Patch085: gdb-rhbz795424-bitpos-23of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch087: gdb-rhbz795424-bitpos-25of25.patch +Patch086: gdb-rhbz795424-bitpos-25of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch088: gdb-rhbz795424-bitpos-25of25-test.patch +Patch087: gdb-rhbz795424-bitpos-25of25-test.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch089: gdb-rhbz795424-bitpos-lazyvalue.patch +Patch088: gdb-rhbz795424-bitpos-lazyvalue.patch # Import regression test for `gdb/findvar.c:417: internal-error: # read_var_value: Assertion `frame' failed.' (RH BZ 947564) from RHEL 6.5. #=fedoratest -Patch090: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch089: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch # Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211). #=push+jan -Patch091: gdb-gnat-dwarf-crash-3of3.patch +Patch090: gdb-gnat-dwarf-crash-3of3.patch # Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614) #=fedoratest -Patch092: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch091: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch # Fix 'gdb gives highly misleading error when debuginfo pkg is present, # but not corresponding binary pkg' (RH BZ 981154). #=push+jan -Patch093: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +Patch092: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch #=fedoratest -Patch094: gdb-archer-vla-tests.patch +Patch093: gdb-archer-vla-tests.patch #=fedoratest -Patch095: gdb-vla-intel-tests.patch +Patch094: gdb-vla-intel-tests.patch # Continue backtrace even if a frame filter throws an exception (Phil Muldoon). #=push -Patch096: gdb-btrobust.patch +Patch095: gdb-btrobust.patch # Display Fortran strings in backtraces. #=fedoratest -Patch097: gdb-fortran-frame-string.patch +Patch096: gdb-fortran-frame-string.patch # Fix Python GIL with gdb.execute("continue") (Phil Muldoon, BZ 1116957). #=push -Patch098: gdb-python-gil.patch +Patch097: gdb-python-gil.patch # Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to # crash.' (RH BZ 1156192). #=fedoratest -Patch099: gdb-rhbz1156192-recursive-dlopen-test.patch +Patch098: gdb-rhbz1156192-recursive-dlopen-test.patch # Fix jit-reader.h for multi-lib. #=push+jan -Patch100: gdb-jit-reader-multilib.patch +Patch099: gdb-jit-reader-multilib.patch # Fix '`catch syscall' doesn't work for parent after `fork' is called' # (Philippe Waroquiers, RH BZ 1149205). #=fedoratest -Patch101: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch100: gdb-rhbz1149205-catch-syscall-after-fork-test.patch # Fix 'backport GDB 7.4 fix to RHEL 6.6 GDB' [Original Sourceware bug # description: 'C++ (and objc): Internal error on unqualified name # re-set', PR 11657] (RH BZ 1186476). #=fedoratest -Patch102: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch +Patch101: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch # Test 'info type-printers' Python error (RH BZ 1350436). #=fedoratest -Patch103: gdb-rhbz1350436-type-printers-error.patch +Patch102: gdb-rhbz1350436-type-printers-error.patch # Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan # Kratochvil, RH BZ 1084404). #=fedoratest -Patch104: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch103: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch # Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747). #=push+jan -Patch105: gdb-bz1219747-attach-kills.patch +Patch104: gdb-bz1219747-attach-kills.patch # Force libncursesw over libncurses to match the includes (RH BZ 1270534). #=push+jan -Patch106: gdb-fedora-libncursesw.patch +Patch105: gdb-fedora-libncursesw.patch # Test clflushopt instruction decode (for RH BZ 1262471). #=fedoratest -Patch107: gdb-opcodes-clflushopt-test.patch +Patch106: gdb-opcodes-clflushopt-test.patch # [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon). #=fedora -Patch108: gdb-dts-rhel6-python-compat.patch +Patch107: gdb-dts-rhel6-python-compat.patch # [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585). #=push+jan -Patch109: gdb-6.6-buildid-locate-rpm-scl.patch +Patch108: gdb-6.6-buildid-locate-rpm-scl.patch # Work around readline-6.2 incompatibility not asking for --more-- (BZ 701131). #=fedora -Patch110: gdb-readline62-ask-more-rh.patch +Patch109: gdb-readline62-ask-more-rh.patch # Make the GDB quit processing non-abortable to cleanup everything properly. #=fedora: It was useful only after gdb-6.8-attach-signalled-detach-stopped.patch . -Patch111: gdb-6.8-quit-never-aborts.patch +Patch110: gdb-6.8-quit-never-aborts.patch # [aarch64] Fix hardware watchpoints (RH BZ 1261564). #=fedoratest -Patch112: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch111: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch # Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114). #=fedora -Patch113: gdb-container-rh-pkg.patch +Patch112: gdb-container-rh-pkg.patch # New test for Python "Cannot locate object file for block" (for RH BZ 1325795). #=fedoratest -Patch114: gdb-rhbz1325795-framefilters-test.patch +Patch113: gdb-rhbz1325795-framefilters-test.patch # [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). #=fedora -Patch115: gdb-linux_perf-bundle.patch +Patch114: gdb-linux_perf-bundle.patch # Fix gdb-headless /usr/bin/ executables (BZ 1390251). #=fedora -Patch116: gdb-libexec-add-index.patch +Patch115: gdb-libexec-add-index.patch # New testcase for: Fix -completion crash (Gary Benson, RH BZ 1398387). #=fedoratest -Patch117: gdb-rhbz1398387-tab-crash-test.patch +Patch116: gdb-rhbz1398387-tab-crash-test.patch # [testsuite] Fix false selftest.exp FAIL from system readline-6.3+ (Patrick Palka). #=fedoratest -Patch118: gdb-testsuite-readline63-sigint.patch +Patch117: gdb-testsuite-readline63-sigint.patch # Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher #=push -Patch119: gdb-archer.patch +Patch118: gdb-archer.patch # Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd -Patch120: gdb-vla-intel-fix-print-char-array.patch +Patch119: gdb-vla-intel-fix-print-char-array.patch # [s390x] Backport arch12 instructions decoding (RH BZ 1553104). # =fedoratest -Patch121: gdb-rhbz1553104-s390x-arch12-test.patch +Patch120: gdb-rhbz1553104-s390x-arch12-test.patch # This patch is needed to compile GDB after -Werror=narrowing has # been enabled by default. # Author: Sergio Durigan Junior. -Patch122: gdb-rhbz795424-bitpos-arrayview.patch +Patch121: gdb-rhbz795424-bitpos-arrayview.patch diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include index 131cf93..a663edb 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -119,4 +119,3 @@ %patch119 -p1 %patch120 -p1 %patch121 -p1 -%patch122 -p1 diff --git a/_patch_order b/_patch_order index 4d199ce..b7f1dc0 100644 --- a/_patch_order +++ b/_patch_order @@ -13,7 +13,6 @@ gdb-6.3-threaded-watchpoints2-20050225.patch gdb-6.3-inferior-notification-20050721.patch gdb-6.3-inheritancetest-20050726.patch gdb-6.3-readnever-20050907.patch -gdb-6.5-bz203661-emit-relocs.patch gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch gdb-6.5-sharedlibrary-path.patch gdb-6.5-BEA-testsuite.patch diff --git a/gdb-6.5-bz203661-emit-relocs.patch b/gdb-6.5-bz203661-emit-relocs.patch deleted file mode 100644 index 75ca84f..0000000 --- a/gdb-6.5-bz203661-emit-relocs.patch +++ /dev/null @@ -1,24 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.5-bz203661-emit-relocs.patch - -;; Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661). -;;=push+jan: There was some mail thread about it, this patch may be a hack. - -diff --git a/gdb/symfile.c b/gdb/symfile.c ---- a/gdb/symfile.c -+++ b/gdb/symfile.c -@@ -3584,6 +3584,12 @@ default_symfile_relocate (struct objfile *objfile, asection *sectp, - DWO file. */ - bfd *abfd = sectp->owner; - -+ /* Executable files have all the relocations already resolved. -+ Handle files linked with --emit-relocs. -+ http://sources.redhat.com/ml/gdb/2006-08/msg00137.html */ -+ if ((abfd->flags & EXEC_P) != 0) -+ return NULL; -+ - /* We're only interested in sections with relocation - information. */ - if ((sectp->flags & SEC_RELOC) == 0) diff --git a/gdb.spec b/gdb.spec index 918f9d9..aadf8a8 100644 --- a/gdb.spec +++ b/gdb.spec @@ -26,7 +26,7 @@ Version: 8.2.50.%{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: 1%{?dist} +Release: 2%{?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 @@ -1022,9 +1022,23 @@ fi %endif %changelog +* Wed Sep 19 2018 Sergio Durigan Junior - 8.2.50.20180917-2.fc30 +- Remove 'gdb-6.5-bz203661-emit-relocs.patch'. +- Update changelog entry for last release. + * Mon Sep 17 2018 Sergio Durigan Junior - 8.2.50.20180917-1.fc30 - Rebase to FSF GDB 8.2.50.20180917 (8.3pre). - Add 'gdb-rhbz795424-bitpos-arrayview.patch'. +- Remove 'gdb-rhbz881849-ipv6-1of3.patch'. +- Remove 'gdb-rhbz881849-ipv6-2of3.patch'. +- Remove 'gdb-rhbz881849-ipv6-3of3.patch'. +- Remove 'gdb-rhbz1187581-power8-regs-1of7.patch'. +- Remove 'gdb-rhbz1187581-power8-regs-2of7.patch'. +- Remove 'gdb-rhbz1187581-power8-regs-3of7.patch'. +- Remove 'gdb-rhbz1187581-power8-regs-4of7.patch'. +- Remove 'gdb-rhbz1187581-power8-regs-5of7.patch'. +- Remove 'gdb-rhbz1187581-power8-regs-6of7.patch'. +- Remove 'gdb-rhbz1187581-power8-regs-7of7.patch'. * Tue Aug 21 2018 Sergio Durigan Junior - 8.1.90.20180727-45.fc30 - Enable verbose output when running "make". From 453d99770b2860297ec764f0db725666441ae9bb Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 4 Oct 2018 21:56:50 +0200 Subject: [PATCH 29/35] Fix annobin complaints (RH BZ 1630564): --without-stage1-ldflags: Disable static libstdc++ and libgcc linking. --disable-libmcheck: That is a distro-level decision, not package decision. --- gdb.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb.spec b/gdb.spec index aadf8a8..162376b 100644 --- a/gdb.spec +++ b/gdb.spec @@ -26,7 +26,7 @@ Version: 8.2.50.%{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: 2%{?dist} +Release: 3%{?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 @@ -566,6 +566,8 @@ export CXXFLAGS="$CFLAGS" --with-separate-debug-dir=/usr/lib/debug \ --disable-sim \ --disable-rpath \ + --without-stage1-ldflags \ + --disable-libmcheck \ %if 0%{!?rhel:1} || 0%{?rhel} > 7 --with-babeltrace \ --with-guile \ @@ -1022,6 +1024,11 @@ fi %endif %changelog +* Thu Oct 4 2018 Jan Kratochvil - 8.2.50.20180917-3.fc30 +- Fix annobin complaints (RH BZ 1630564): + --without-stage1-ldflags: Disable static libstdc++ and libgcc linking. + --disable-libmcheck: That is a distro-level decision, not package decision. + * Wed Sep 19 2018 Sergio Durigan Junior - 8.2.50.20180917-2.fc30 - Remove 'gdb-6.5-bz203661-emit-relocs.patch'. - Update changelog entry for last release. From a3b5cf46c2e607fd1d3ca52fa1afb22ac705b9ca Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Sun, 7 Oct 2018 01:19:34 -0400 Subject: [PATCH 30/35] Rebase to FSF GDB 8.2.50.20181006 (8.3pre). --- .gitignore | 2 +- _git_upstream_commit | 2 +- gdb-6.3-gstack-20050411.patch | 6 +- gdb-6.6-buildid-locate-rpm.patch | 10 +- ...6.6-buildid-locate-solib-missing-ids.patch | 4 +- gdb-6.6-buildid-locate.patch | 18 ++-- gdb-6.8-bz436037-reg-no-longer-active.patch | 4 +- gdb-archer-pie-addons-keep-disabled.patch | 6 +- gdb-archer.patch | 18 ++-- gdb-attach-fail-reasons-5of5.patch | 12 +-- gdb-bz541866-rwatch-before-run.patch | 4 +- gdb-container-rh-pkg.patch | 2 +- gdb-fedora-libncursesw.patch | 8 +- gdb-glibc-strstr-workaround.patch | 2 +- gdb-gnat-dwarf-crash-3of3.patch | 2 +- gdb-jit-reader-multilib.patch | 2 +- gdb-linux_perf-bundle.patch | 4 +- gdb-moribund-utrace-workaround.patch | 2 +- gdb-python-gil.patch | 2 +- gdb-rhbz795424-bitpos-20of25.patch | 40 +++---- gdb-rhbz795424-bitpos-21of25.patch | 6 +- gdb-rhbz795424-bitpos-22of25.patch | 10 +- gdb-rhbz795424-bitpos-23of25.patch | 101 ++++++++++++------ gdb-vla-intel-fortran-strides.patch | 92 +++++++++++----- gdb-vla-intel-fortran-vla-strings.patch | 30 +++--- gdb-x86_64-i386-syscall-restart.patch | 4 +- gdb.spec | 7 +- sources | 2 +- 28 files changed, 242 insertions(+), 160 deletions(-) diff --git a/.gitignore b/.gitignore index 912afa8..0ec9ea0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz /v2.0.tar.gz -/gdb-8.2.50.20180917.tar.xz +/gdb-8.2.50.20181006.tar.xz diff --git a/_git_upstream_commit b/_git_upstream_commit index 5d82e25..127b1d6 100644 --- a/_git_upstream_commit +++ b/_git_upstream_commit @@ -1 +1 @@ -e08ef628a7e3098699ec6939584e2c9f7a9e1952 +ce3a1736b59a05128049459fcd6c91c221f40257 diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 523d0d0..8c40414 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -1732,7 +1732,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force +@@ -1733,7 +1733,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force install: all @$(MAKE) $(FLAGS_TO_PASS) install-only @@ -25,7 +25,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -1781,7 +1781,25 @@ install-guile: +@@ -1782,7 +1782,25 @@ install-guile: install-python: $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb @@ -52,7 +52,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ -@@ -1804,6 +1822,18 @@ uninstall: force $(CONFIG_UNINSTALL) +@@ -1805,6 +1823,18 @@ uninstall: force $(CONFIG_UNINSTALL) fi @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index c9cdce4..18cfb65 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -690,7 +690,7 @@ diff --git a/gdb/config.in b/gdb/config.in /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS -@@ -258,6 +261,9 @@ +@@ -261,6 +264,9 @@ /* Define if Python 2.7 is being used. */ #undef HAVE_LIBPYTHON2_7 @@ -723,7 +723,7 @@ diff --git a/gdb/configure b/gdb/configure enable_targets enable_64_bit_bfd enable_gdbmi -@@ -910,6 +916,11 @@ CCC +@@ -911,6 +917,11 @@ CCC CPP MAKEINFO MAKEINFOFLAGS @@ -735,7 +735,7 @@ diff --git a/gdb/configure b/gdb/configure YACC YFLAGS XMKMF' -@@ -1578,6 +1589,8 @@ Optional Packages: +@@ -1580,6 +1591,8 @@ Optional Packages: [--with-auto-load-dir] --without-auto-load-safe-path do not restrict auto-loaded files locations @@ -744,7 +744,7 @@ diff --git a/gdb/configure b/gdb/configure --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets --with-curses use the curses library instead of the termcap library -@@ -1635,6 +1648,13 @@ Some influential environment variables: +@@ -1637,6 +1650,13 @@ Some influential environment variables: MAKEINFO Parent configure detects if it is of sufficient version. MAKEINFOFLAGS Parameters for MAKEINFO. @@ -758,7 +758,7 @@ diff --git a/gdb/configure b/gdb/configure YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. -@@ -6570,6 +6590,494 @@ _ACEOF +@@ -6618,6 +6638,494 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 $as_echo "$with_auto_load_safe_path" >&6; } diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch index 6da53a7..e86920b 100644 --- a/gdb-6.6-buildid-locate-solib-missing-ids.patch +++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch @@ -14,7 +14,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1339862 diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c -@@ -1343,14 +1343,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1347,14 +1347,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, } { @@ -44,7 +44,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c if (build_id != NULL) { char *name, *build_id_filename; -@@ -1365,23 +1378,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1369,23 +1382,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, xfree (name); } else diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index b37a396..bc9f5ac 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -55,13 +55,13 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + && namesz == sizeof "GNU" + && memcmp (xnp->name, "GNU", sizeof "GNU") == 0) + { -+ size_t size = descsz; ++ size_t sz = descsz; + gdb_byte *data = (gdb_byte *) descdata; + struct bfd_build_id *retval; + -+ retval = (struct bfd_build_id *) xmalloc (sizeof *retval - 1 + size); -+ retval->size = size; -+ memcpy (retval->data, data, size); ++ retval = (struct bfd_build_id *) xmalloc (sizeof *retval - 1 + sz); ++ retval->size = sz; ++ memcpy (retval->data, data, sz); + + return retval; + } @@ -977,7 +977,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -19772,6 +19772,27 @@ information files. +@@ -19829,6 +19829,27 @@ information files. @end table @@ -1029,7 +1029,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (dwz_bfd == NULL) error (_("could not find '.gnu_debugaltlink' file for %s"), -@@ -6198,7 +6198,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) +@@ -6197,7 +6197,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) static gdb::array_view get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) { @@ -1038,7 +1038,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (build_id == nullptr) return {}; -@@ -6211,7 +6211,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) +@@ -6210,7 +6210,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) static gdb::array_view get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz) { @@ -1062,7 +1062,7 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c if (debugfile.empty ()) debugfile = find_separate_debug_file_by_debuglink (objfile); @@ -1301,6 +1303,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) - symbol_file_add_separate (abfd.get (), debugfile.c_str (), + symbol_file_add_separate (debug_bfd.get (), debugfile.c_str (), symfile_flags, objfile); } + /* Check if any separate debug info has been extracted out. */ @@ -1118,7 +1118,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c static struct link_map_offsets *svr4_fetch_link_map_offsets (void); static int svr4_have_link_map_offsets (void); -@@ -1341,9 +1342,51 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1345,9 +1346,51 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, continue; } diff --git a/gdb-6.8-bz436037-reg-no-longer-active.patch b/gdb-6.8-bz436037-reg-no-longer-active.patch index ea240af..2e89141 100644 --- a/gdb-6.8-bz436037-reg-no-longer-active.patch +++ b/gdb-6.8-bz436037-reg-no-longer-active.patch @@ -9,7 +9,7 @@ Subject: gdb-6.8-bz436037-reg-no-longer-active.patch diff --git a/gdb/valops.c b/gdb/valops.c --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -1104,6 +1104,8 @@ value_assign (struct value *toval, struct value *fromval) +@@ -1097,6 +1097,8 @@ value_assign (struct value *toval, struct value *fromval) struct gdbarch *gdbarch; int value_reg; @@ -18,7 +18,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c /* Figure out which frame this is in currently. We use VALUE_FRAME_ID for obtaining the value's frame id instead of -@@ -1113,8 +1115,14 @@ value_assign (struct value *toval, struct value *fromval) +@@ -1106,8 +1108,14 @@ value_assign (struct value *toval, struct value *fromval) frame. */ frame = frame_find_by_id (VALUE_FRAME_ID (toval)); diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch index 1833f98..1e0bb94 100644 --- a/gdb-archer-pie-addons-keep-disabled.patch +++ b/gdb-archer-pie-addons-keep-disabled.patch @@ -8,9 +8,9 @@ Subject: gdb-archer-pie-addons-keep-disabled.patch diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -15506,6 +15506,50 @@ initialize_breakpoint_ops (void) +@@ -15506,6 +15506,50 @@ static struct cmd_list_element *enablebreaklist = NULL; - static struct cmd_list_element *enablebreaklist = NULL; + cmd_list_element *commands_cmd_element = nullptr; +void +breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta) @@ -75,7 +75,7 @@ diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h diff --git a/gdb/objfiles.c b/gdb/objfiles.c --- a/gdb/objfiles.c +++ b/gdb/objfiles.c -@@ -880,6 +880,11 @@ objfile_relocate1 (struct objfile *objfile, +@@ -878,6 +878,11 @@ objfile_relocate1 (struct objfile *objfile, obj_section_addr (s)); } diff --git a/gdb-archer.patch b/gdb-archer.patch index 882b86e..734ef57 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -17,7 +17,7 @@ tromey/python diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -2092,6 +2092,12 @@ stamp-h: $(srcdir)/config.in config.status +@@ -2093,6 +2093,12 @@ stamp-h: $(srcdir)/config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -365,7 +365,7 @@ new file mode 100644 diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h -@@ -636,6 +636,9 @@ class gdbpy_enter_varobj : public gdbpy_enter +@@ -629,6 +629,9 @@ class gdbpy_enter_varobj : public gdbpy_enter }; @@ -417,7 +417,7 @@ diff --git a/gdb/python/python.c b/gdb/python/python.c /* Set the quit flag. */ static void -@@ -1312,6 +1337,92 @@ gdbpy_print_stack (void) +@@ -1311,6 +1336,92 @@ gdbpy_print_stack (void) @@ -510,7 +510,7 @@ diff --git a/gdb/python/python.c b/gdb/python/python.c /* Return a sequence holding all the Progspaces. */ static PyObject * -@@ -1963,6 +2074,8 @@ PyMethodDef python_GdbMethods[] = +@@ -1965,6 +2076,8 @@ PyMethodDef python_GdbMethods[] = Evaluate command, a string, as a gdb CLI command. Optionally returns\n\ a Python String containing the output of the command if to_string is\n\ set to True." }, @@ -522,10 +522,14 @@ diff --git a/gdb/python/python.c b/gdb/python/python.c diff --git a/gdb/python/python.h b/gdb/python/python.h --- a/gdb/python/python.h +++ b/gdb/python/python.h -@@ -25,4 +25,6 @@ +@@ -25,7 +25,10 @@ /* This is all that python exports to gdb. */ extern const struct extension_language_defn extension_language_python; ++ + /* Command element for the 'python' command. */ + extern cmd_list_element *python_cmd_element; + +extern void run_python_script (int argc, char **argv); + #endif /* GDB_PYTHON_H */ @@ -544,7 +548,7 @@ diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp -@@ -384,6 +384,15 @@ proc test_value_after_death {} { +@@ -399,6 +399,15 @@ proc test_value_after_death {} { "print value's type" } @@ -560,7 +564,7 @@ diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py # Regression test for invalid subscript operations. The bug was that # the type of the value was not being checked before allowing a # subscript operation to proceed. -@@ -512,6 +521,7 @@ if ![runto_main] then { +@@ -540,6 +549,7 @@ if ![runto_main] then { test_value_in_inferior test_inferior_function_call test_value_after_death diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch index 659aec6..9dfac38 100644 --- a/gdb-attach-fail-reasons-5of5.patch +++ b/gdb-attach-fail-reasons-5of5.patch @@ -45,7 +45,7 @@ gdb/gdbserver/ diff --git a/gdb/config.in b/gdb/config.in --- a/gdb/config.in +++ b/gdb/config.in -@@ -264,6 +264,9 @@ +@@ -267,6 +267,9 @@ /* Define if librpm library is being used. */ #undef HAVE_LIBRPM @@ -55,7 +55,7 @@ diff --git a/gdb/config.in b/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -@@ -387,6 +390,9 @@ +@@ -393,6 +396,9 @@ /* Define to 1 if you have the `scm_new_smob' function. */ #undef HAVE_SCM_NEW_SMOB @@ -68,7 +68,7 @@ diff --git a/gdb/config.in b/gdb/config.in diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -15793,6 +15793,64 @@ cat >>confdefs.h <<_ACEOF +@@ -15841,6 +15841,64 @@ cat >>confdefs.h <<_ACEOF _ACEOF @@ -136,7 +136,7 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -2031,6 +2031,10 @@ case $host_os in +@@ -2009,6 +2009,10 @@ case $host_os in esac AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.]) @@ -173,7 +173,7 @@ diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure -@@ -8568,6 +8568,64 @@ if $want_ipa ; then +@@ -8564,6 +8564,64 @@ if $want_ipa ; then fi fi @@ -241,7 +241,7 @@ diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac -@@ -486,6 +486,10 @@ if $want_ipa ; then +@@ -480,6 +480,10 @@ if $want_ipa ; then fi fi diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch index a297bbe..d5a9e1a 100644 --- a/gdb-bz541866-rwatch-before-run.patch +++ b/gdb-bz541866-rwatch-before-run.patch @@ -10,7 +10,7 @@ Subject: gdb-bz541866-rwatch-before-run.patch diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -8789,7 +8789,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, +@@ -8785,7 +8785,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, int enabled, int internal, unsigned flags, int display_canonical) { @@ -19,7 +19,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c if (type == bp_hardware_breakpoint) { -@@ -14340,7 +14340,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition, +@@ -14336,7 +14336,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition, if (bpt->type == bp_hardware_breakpoint) { diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch index b8e576d..c19f23e 100644 --- a/gdb-container-rh-pkg.patch +++ b/gdb-container-rh-pkg.patch @@ -9,7 +9,7 @@ Subject: gdb-container-rh-pkg.patch diff --git a/gdb/remote.c b/gdb/remote.c --- a/gdb/remote.c +++ b/gdb/remote.c -@@ -14010,7 +14010,17 @@ remote_target::pid_to_exec_file (int pid) +@@ -14004,7 +14004,17 @@ remote_target::pid_to_exec_file (int pid) char *annex = NULL; if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch index 6b01919..6581fde 100644 --- a/gdb-fedora-libncursesw.patch +++ b/gdb-fedora-libncursesw.patch @@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1270534 diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -9362,6 +9362,7 @@ if test x"$prefer_curses" = xyes; then +@@ -9410,6 +9410,7 @@ if test x"$prefer_curses" = xyes; then # search /usr/local/include, if ncurses is installed in /usr/local. A # default installation of ncurses on alpha*-dec-osf* will lead to such # a situation. @@ -20,7 +20,7 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 $as_echo_n "checking for library containing waddstr... " >&6; } if ${ac_cv_search_waddstr+:} false; then : -@@ -9386,7 +9387,7 @@ return waddstr (); +@@ -9434,7 +9435,7 @@ return waddstr (); return 0; } _ACEOF @@ -29,7 +29,7 @@ diff --git a/gdb/configure b/gdb/configure if test -z "$ac_lib"; then ac_res="none required" else -@@ -9460,6 +9461,7 @@ case $host_os in +@@ -9508,6 +9509,7 @@ case $host_os in esac # These are the libraries checked by Readline. @@ -37,7 +37,7 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 $as_echo_n "checking for library containing tgetent... " >&6; } if ${ac_cv_search_tgetent+:} false; then : -@@ -9484,7 +9486,7 @@ return tgetent (); +@@ -9532,7 +9534,7 @@ return tgetent (); return 0; } _ACEOF diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch index 63bc7e3..a6b4c2c 100644 --- a/gdb-glibc-strstr-workaround.patch +++ b/gdb-glibc-strstr-workaround.patch @@ -9,7 +9,7 @@ Subject: gdb-glibc-strstr-workaround.patch diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -21443,6 +21443,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, +@@ -21441,6 +21441,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* Cache this symbol's name and the name's demangled form (if any). */ SYMBOL_SET_LANGUAGE (sym, cu->language, &objfile->objfile_obstack); linkagename = dwarf2_physname (name, die, cu); diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch index c227f8a..88600e6 100644 --- a/gdb-gnat-dwarf-crash-3of3.patch +++ b/gdb-gnat-dwarf-crash-3of3.patch @@ -42,7 +42,7 @@ gdb/ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -10586,6 +10586,13 @@ private: +@@ -10584,6 +10584,13 @@ private: static void process_die (struct die_info *die, struct dwarf2_cu *cu) { diff --git a/gdb-jit-reader-multilib.patch b/gdb-jit-reader-multilib.patch index e676c9e..15fa27c 100644 --- a/gdb-jit-reader-multilib.patch +++ b/gdb-jit-reader-multilib.patch @@ -9,7 +9,7 @@ Subject: gdb-jit-reader-multilib.patch diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -9649,10 +9649,12 @@ _ACEOF +@@ -9697,10 +9697,12 @@ _ACEOF diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch index 95e755f..a96209d 100644 --- a/gdb-linux_perf-bundle.patch +++ b/gdb-linux_perf-bundle.patch @@ -9,7 +9,7 @@ Subject: gdb-linux_perf-bundle.patch diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -12028,7 +12028,7 @@ else +@@ -12080,7 +12080,7 @@ else #include #ifndef PERF_ATTR_SIZE_VER5 @@ -21,7 +21,7 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -1454,7 +1454,7 @@ else +@@ -1458,7 +1458,7 @@ else AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ #include #ifndef PERF_ATTR_SIZE_VER5 diff --git a/gdb-moribund-utrace-workaround.patch b/gdb-moribund-utrace-workaround.patch index 1b26f7f..3f26be4 100644 --- a/gdb-moribund-utrace-workaround.patch +++ b/gdb-moribund-utrace-workaround.patch @@ -14,7 +14,7 @@ Bug in FSF GDB exploited by the ptrace-on-utrace interaction. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -11998,6 +11998,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode) +@@ -11994,6 +11994,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode) traps we can no longer explain. */ old_loc->events_till_retirement = 3 * (thread_count () + 1); diff --git a/gdb-python-gil.patch b/gdb-python-gil.patch index b852854..b6e80bc 100644 --- a/gdb-python-gil.patch +++ b/gdb-python-gil.patch @@ -27,7 +27,7 @@ diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h -@@ -144,6 +144,8 @@ typedef int Py_ssize_t; +@@ -137,6 +137,8 @@ typedef int Py_ssize_t; #define PyGILState_Release(ARG) ((void)(ARG)) #define PyEval_InitThreads() #define PyThreadState_Swap(ARG) ((void)(ARG)) diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index ad2daf4..1702214 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -1311,7 +1311,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c } return 0; } -@@ -6805,7 +6805,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1, +@@ -6801,7 +6801,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1, static int breakpoint_address_match_range (const address_space *aspace1, CORE_ADDR addr1, @@ -1320,7 +1320,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c CORE_ADDR addr2) { return ((gdbarch_has_global_breakpoints (target_gdbarch ()) -@@ -10887,7 +10887,7 @@ can_use_hardware_watchpoint (const std::vector &vals) +@@ -10883,7 +10883,7 @@ can_use_hardware_watchpoint (const std::vector &vals) && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR vaddr = value_address (v); @@ -1650,7 +1650,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } static void -@@ -15077,8 +15077,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, +@@ -15075,8 +15075,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, object, and then subtract off the number of bits of the field itself. The result is the bit offset of the LSB of the field. */ @@ -1707,7 +1707,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c struct type **arg_types; pc = (*pos)++; -@@ -1732,7 +1733,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1735,7 +1736,7 @@ evaluate_subexp_standard (struct type *expect_type, struct type *range_type = TYPE_INDEX_TYPE (type); struct type *element_type = TYPE_TARGET_TYPE (type); struct value *array = allocate_value (expect_type); @@ -2563,9 +2563,9 @@ diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options) -@@ -71,8 +71,8 @@ pascal_val_print (struct type *type, +@@ -70,8 +70,8 @@ pascal_val_print (struct type *type, + unsigned int i = 0; /* Number of characters printed */ unsigned len; - LONGEST low_bound, high_bound; struct type *elttype; - unsigned eltlen; - int length_pos, length_size, string_pos; @@ -2589,7 +2589,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c -@@ -1706,7 +1706,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, +@@ -1705,7 +1705,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, const struct floatformat ** ppc_floatformat_for_type (struct gdbarch *gdbarch, @@ -2622,7 +2622,7 @@ diff --git a/gdb/printcmd.c b/gdb/printcmd.c diff --git a/gdb/procfs.c b/gdb/procfs.c --- a/gdb/procfs.c +++ b/gdb/procfs.c -@@ -3361,7 +3361,7 @@ procfs_target::remove_watchpoint (CORE_ADDR addr, int len, +@@ -3367,7 +3367,7 @@ procfs_target::remove_watchpoint (CORE_ADDR addr, int len, } int @@ -2758,7 +2758,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, struct expression *) override; -@@ -10446,7 +10446,7 @@ int remote_hw_watchpoint_length_limit = -1; +@@ -10441,7 +10441,7 @@ int remote_hw_watchpoint_length_limit = -1; int remote_hw_breakpoint_limit = -1; int @@ -2825,7 +2825,7 @@ diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c diff --git a/gdb/stack.c b/gdb/stack.c --- a/gdb/stack.c +++ b/gdb/stack.c -@@ -190,7 +190,7 @@ print_stack_frame (struct frame_info *frame, int print_level, +@@ -192,7 +192,7 @@ print_stack_frame (struct frame_info *frame, int print_level, argument (not just the first nameless argument). */ static void @@ -2834,7 +2834,7 @@ diff --git a/gdb/stack.c b/gdb/stack.c int first, struct ui_file *stream) { struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -540,7 +540,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, +@@ -542,7 +542,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, /* Offset of next stack argument beyond the one we have seen that is at the highest offset, or -1 if we haven't come to a stack argument yet. */ @@ -2843,7 +2843,7 @@ diff --git a/gdb/stack.c b/gdb/stack.c /* Number of ints of arguments that we have printed so far. */ int args_printed = 0; /* True if we should print arguments, false otherwise. */ -@@ -569,8 +569,8 @@ print_frame_args (struct symbol *func, struct frame_info *frame, +@@ -571,8 +571,8 @@ print_frame_args (struct symbol *func, struct frame_info *frame, case LOC_ARG: case LOC_REF_ARG: { @@ -2854,7 +2854,7 @@ diff --git a/gdb/stack.c b/gdb/stack.c /* Compute address of next argument by adding the size of this argument and rounding to an int boundary. */ -@@ -705,7 +705,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, +@@ -707,7 +707,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, enough about the stack to find them. */ if (num != -1) { @@ -3156,7 +3156,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c const char *, struct type *, int, enum noside); -@@ -183,7 +183,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) +@@ -176,7 +176,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) space. */ struct value * @@ -3165,7 +3165,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c { struct objfile *objf; struct value *val = find_function_in_inferior ("malloc", &objf); -@@ -398,12 +398,12 @@ value_cast (struct type *type, struct value *arg2) +@@ -391,12 +391,12 @@ value_cast (struct type *type, struct value *arg2) if (code1 == TYPE_CODE_ARRAY) { struct type *element_type = TYPE_TARGET_TYPE (type); @@ -3180,7 +3180,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c LONGEST low_bound, high_bound, new_length; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -@@ -1055,7 +1055,7 @@ value_assign (struct value *toval, struct value *fromval) +@@ -1048,7 +1048,7 @@ value_assign (struct value *toval, struct value *fromval) { const gdb_byte *dest_buffer; CORE_ADDR changed_addr; @@ -3189,7 +3189,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c gdb_byte buffer[sizeof (LONGEST)]; if (value_bitsize (toval)) -@@ -3356,7 +3356,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) +@@ -3349,7 +3349,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) the form "DOMAIN::NAME". */ static struct value * @@ -3198,7 +3198,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c struct type *curtype, const char *name, struct type *intype, int want_address, -@@ -3390,7 +3390,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, +@@ -3383,7 +3383,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, if (want_address) return value_from_longest (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), @@ -3207,7 +3207,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c else if (noside != EVAL_NORMAL) return allocate_value (TYPE_FIELD_TYPE (t, i)); else -@@ -3563,7 +3563,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, +@@ -3556,7 +3556,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) { struct value *v; @@ -3216,7 +3216,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (t, i)) base_offset = 0; -@@ -3712,7 +3712,7 @@ value_rtti_indirect_type (struct value *v, int *full, +@@ -3705,7 +3705,7 @@ value_rtti_indirect_type (struct value *v, int *full, struct value * value_full_object (struct value *argp, struct type *rtype, diff --git a/gdb-rhbz795424-bitpos-21of25.patch b/gdb-rhbz795424-bitpos-21of25.patch index a70254f..a293b6d 100644 --- a/gdb-rhbz795424-bitpos-21of25.patch +++ b/gdb-rhbz795424-bitpos-21of25.patch @@ -90,7 +90,7 @@ diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c diff --git a/gdb/defs.h b/gdb/defs.h --- a/gdb/defs.h +++ b/gdb/defs.h -@@ -665,4 +665,6 @@ DEF_ENUM_FLAGS_TYPE (enum user_selected_what_flag, user_selected_what); +@@ -668,4 +668,6 @@ DEF_ENUM_FLAGS_TYPE (enum user_selected_what_flag, user_selected_what); #include "utils.h" @@ -100,7 +100,7 @@ diff --git a/gdb/defs.h b/gdb/defs.h diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c -@@ -773,6 +773,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr, +@@ -775,6 +775,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr, if (boffset < 0 || boffset >= TYPE_LENGTH (type)) { @@ -132,7 +132,7 @@ diff --git a/gdb/utils.c b/gdb/utils.c diff --git a/gdb/valops.c b/gdb/valops.c --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -2087,6 +2087,7 @@ search_struct_method (const char *name, struct value **arg1p, +@@ -2080,6 +2080,7 @@ search_struct_method (const char *name, struct value **arg1p, { CORE_ADDR address; diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch index 9e6882c..a3c1300 100644 --- a/gdb-rhbz795424-bitpos-22of25.patch +++ b/gdb-rhbz795424-bitpos-22of25.patch @@ -354,7 +354,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c diff --git a/gdb/procfs.c b/gdb/procfs.c --- a/gdb/procfs.c +++ b/gdb/procfs.c -@@ -1565,7 +1565,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr) +@@ -1540,7 +1540,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr) } static int @@ -363,7 +363,7 @@ diff --git a/gdb/procfs.c b/gdb/procfs.c { struct { procfs_ctl_t cmd; -@@ -3217,7 +3217,7 @@ procfs_target::pid_to_str (ptid_t ptid) +@@ -3231,7 +3231,7 @@ procfs_target::pid_to_exec_file (int pid) /* Insert a watchpoint. */ static int @@ -384,7 +384,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c int can_use_hw_breakpoint (enum bptype, int, int) override; -@@ -10375,7 +10375,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, +@@ -10370,7 +10370,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); @@ -393,7 +393,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); -@@ -10395,7 +10395,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, +@@ -10390,7 +10390,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, bool remote_target::watchpoint_addr_within_range (CORE_ADDR addr, @@ -402,7 +402,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c { CORE_ADDR diff = remote_address_masked (addr - start); -@@ -10424,7 +10424,7 @@ remote_target::remove_watchpoint (CORE_ADDR addr, int len, +@@ -10419,7 +10419,7 @@ remote_target::remove_watchpoint (CORE_ADDR addr, int len, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); diff --git a/gdb-rhbz795424-bitpos-23of25.patch b/gdb-rhbz795424-bitpos-23of25.patch index d87895c..a2c1166 100644 --- a/gdb-rhbz795424-bitpos-23of25.patch +++ b/gdb-rhbz795424-bitpos-23of25.patch @@ -588,7 +588,7 @@ diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c -@@ -2239,7 +2239,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv, +@@ -2238,7 +2238,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv, for (i = 0; i < argc; i++) { @@ -620,7 +620,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c if (mips_debug && out != NULL) { int i; -@@ -4561,13 +4561,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -4562,13 +4562,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte ref_valbuf[MAX_MIPS_ABI_REGSIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -637,7 +637,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c /* The EABI passes structures that do not fit in a register by reference. */ -@@ -4837,7 +4837,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -4838,7 +4838,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct value *function, static int mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, @@ -646,7 +646,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c { int i; -@@ -4852,7 +4852,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, +@@ -4853,7 +4853,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, for (i = 0; i < TYPE_NFIELDS (arg_type); i++) { @@ -655,16 +655,29 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c struct type *field_type; /* We're only looking at normal fields. */ -@@ -4894,7 +4894,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -4895,7 +4895,8 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; -- int len = 0; +- int arg_space = 0; ++ ULONGEST arg_space = 0; + LONGEST len = 0; int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5245,11 +5245,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -4924,9 +4925,9 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, +- "mips_n32n64_push_dummy_call: sp=%s allocated %ld\n", ++ "mips_n32n64_push_dummy_call: sp=%s allocated %s\n", + paddress (gdbarch, sp), +- (long) align_up (arg_space, 16)); ++ pulongest (align_up (arg_space, 16))); + + /* Initialize the integer and float register pointers. */ + argreg = MIPS_A0_REGNUM; +@@ -5247,11 +5248,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, : MIPS_V0_REGNUM); field < TYPE_NFIELDS (type); field++, regnum += 2) { @@ -680,7 +693,7 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) { /* A 16-byte long double field goes in two consecutive -@@ -5291,8 +5291,8 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -5293,8 +5294,8 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, if (offset + xfer > TYPE_LENGTH (type)) xfer = TYPE_LENGTH (type) - offset; if (mips_debug) @@ -691,16 +704,29 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c mips_xfer_register (gdbarch, regcache, gdbarch_num_regs (gdbarch) + regnum, xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf, -@@ -5350,7 +5350,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -5352,7 +5353,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; -- int len = 0; +- int arg_space = 0; ++ ULONGEST arg_space = 0; + LONGEST len = 0; int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5414,13 +5414,13 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -5389,9 +5391,9 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, +- "mips_o32_push_dummy_call: sp=%s allocated %ld\n", ++ "mips_o32_push_dummy_call: sp=%s allocated %s\n", + paddress (gdbarch, sp), +- (long) align_up (arg_space, 16)); ++ pulongest (align_up (arg_space, 16))); + + /* Initialize the integer and float register pointers. */ + argreg = MIPS_A0_REGNUM; +@@ -5417,13 +5419,13 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -717,18 +743,30 @@ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c val = value_contents (arg); -@@ -5874,8 +5874,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -5877,8 +5879,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; -- int len = 0; +- int arg_space = 0; - int stack_offset = 0; -+ LONGEST len = 0; ++ ULONGEST arg_space = 0; + LONGEST stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5935,13 +5935,13 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -5911,9 +5913,9 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, + + if (mips_debug) + fprintf_unfiltered (gdb_stdlog, +- "mips_o64_push_dummy_call: sp=%s allocated %ld\n", ++ "mips_o64_push_dummy_call: sp=%s allocated %s\n", + paddress (gdbarch, sp), +- (long) align_up (arg_space, 16)); ++ pulongest (align_up (arg_space, 16))); + + /* Initialize the integer and float register pointers. */ + argreg = MIPS_A0_REGNUM; +@@ -5939,13 +5941,13 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -1022,7 +1060,7 @@ diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c --- a/gdb/tic6x-tdep.c +++ b/gdb/tic6x-tdep.c -@@ -881,7 +881,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -880,7 +880,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg = 0; int argnum; int stack_offset = 4; @@ -1031,7 +1069,7 @@ diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); struct type *func_type = value_type (function); /* The first arg passed on stack. Mostly the first 10 args are passed by -@@ -914,7 +914,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -913,7 +913,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Now make space on the stack for the args. */ for (argnum = 0; argnum < nargs; argnum++) { @@ -1040,7 +1078,7 @@ diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c if (argnum >= 10 - argreg) references_offset += len; stack_offset += len; -@@ -933,7 +933,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -932,7 +932,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -1049,7 +1087,7 @@ diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c enum type_code typecode = TYPE_CODE (arg_type); val = value_contents (arg); -@@ -1089,7 +1089,8 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -1087,7 +1087,8 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else internal_error (__FILE__, __LINE__, @@ -1074,16 +1112,17 @@ diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c -@@ -1019,7 +1019,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch, +@@ -1019,7 +1019,8 @@ v850_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argreg; int argnum; -- int len = 0; +- int arg_space = 0; ++ ULONGEST arg_space = 0; + LONGEST len = 0; int stack_offset; if (gdbarch_tdep (gdbarch)->abi == V850_ABI_RH850) -@@ -1047,7 +1047,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch, +@@ -1047,7 +1048,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch, in four registers available. Loop thru args from first to last. */ for (argnum = 0; argnum < nargs; argnum++) { @@ -1116,7 +1155,7 @@ diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c -@@ -232,8 +232,9 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch, +@@ -232,8 +232,10 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR stack_dest = sp; int argreg = E_1ST_ARG_REGNUM; @@ -1125,9 +1164,10 @@ diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c + int i, slacklen; + LONGEST j; + LONGEST typelen; - const gdb_byte *val; ++ const gdb_byte *val; gdb_byte buf[xstormy16_pc_size]; + /* If struct_return is true, then the struct return address will diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -1141,11 +1181,12 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c areg = arreg_number (gdbarch, gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb); -@@ -1700,18 +1699,18 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1699,18 +1698,19 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, + CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int i; - int size, onstack_size; ++ int i; + LONGEST size, onstack_size; gdb_byte *buf = (gdb_byte *) alloca (16); CORE_ADDR ra, ps; @@ -1163,7 +1204,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c int regno; /* regno if in register. */ } u; }; -@@ -1735,9 +1734,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1733,9 +1733,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); @@ -1177,7 +1218,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c switch (TYPE_CODE (arg_type)) { case TYPE_CODE_INT: -@@ -1807,8 +1807,8 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1804,8 +1805,8 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long); break; } @@ -1187,7 +1228,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c /* Align size and onstack_size. */ size = (size + info->align - 1) & ~(info->align - 1); -@@ -1853,7 +1853,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1850,7 +1851,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, if (info->onstack) { @@ -1196,7 +1237,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c CORE_ADDR offset = sp + info->u.offset; /* Odd-sized structs are aligned to the lower side of a memory -@@ -1869,7 +1869,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1866,7 +1867,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, } else { diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch index 6054a4c..2a1d2b5 100644 --- a/gdb-vla-intel-fortran-strides.patch +++ b/gdb-vla-intel-fortran-strides.patch @@ -143,7 +143,7 @@ diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -17705,7 +17705,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17703,7 +17703,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type, *orig_base_type; struct type *range_type; struct attribute *attr; @@ -152,7 +152,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c int low_default_is_valid; int high_bound_is_count = 0; const char *name; -@@ -17725,7 +17725,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17723,7 +17723,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) low.kind = PROP_CONST; high.kind = PROP_CONST; @@ -162,7 +162,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow omitting DW_AT_lower_bound. */ -@@ -17758,6 +17760,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17756,6 +17758,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) break; } @@ -177,7 +177,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) attr_to_dynamic_prop (attr, die, cu, &low); -@@ -17850,7 +17860,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17848,7 +17858,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask)) high.data.const_val |= negative_mask; @@ -223,7 +223,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c + struct type *array_type = check_typedef (value_type (new_array)); + struct type *elt_type; + -+ typedef struct subscript_range ++ typedef struct + { + enum range_type f90_range_type; + LONGEST low, high, stride; @@ -272,11 +272,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c + for (i = 0; i < nargs; i++) + { + struct subscript_store *index = &subscript_array[i]; - -- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT) -- high_bound = TYPE_HIGH_BOUND (range); -- else -- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); ++ + /* The user input is a range, with or without lower and upper bound. + E.g.: "p arry(2:5)", "p arry( :5)", "p arry( : )", etc. */ + if (exp->elts[*pos].opcode == OP_RANGE) @@ -310,7 +306,11 @@ diff --git a/gdb/eval.c b/gdb/eval.c + /* Assign the default stride value '1'. */ + else + range->stride = 1; -+ + +- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT) +- high_bound = TYPE_HIGH_BOUND (range); +- else +- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); + /* Check the provided stride value is illegal, aka '0'. */ + if (range->stride == 0) + error (_("Stride must not be 0")); @@ -480,7 +480,8 @@ diff --git a/gdb/eval.c b/gdb/eval.c + struct value *v = NULL; + + elt_type = TYPE_TARGET_TYPE (value_type (new_array)); -+ + +- return value_slice (array, low_bound, high_bound - low_bound + 1); + /* Every SUBSCRIPT_RANGE in the user input signifies an actual range in + the output array. So we traverse the SUBSCRIPT_ARRAY again, looking + for a range entry. When we find one, we use the range info to create @@ -497,8 +498,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c + struct type *range_type, *interim_array_type; + + int new_length; - -- return value_slice (array, low_bound, high_bound - low_bound + 1); ++ + /* The length of a sub-dimension with all elements between the + bounds plus the start element itself. It may be modified by + a user provided stride value. */ @@ -533,20 +533,54 @@ diff --git a/gdb/eval.c b/gdb/eval.c } -@@ -1930,19 +2225,8 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1238,19 +1533,6 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos, + return eval_call (exp, noside, nargs, argvec, var_func_name, expect_type); + } + +-/* Helper for skipping all the arguments in an undetermined argument list. +- This function was designed for use in the OP_F77_UNDETERMINED_ARGLIST +- case of evaluate_subexp_standard as multiple, but not all, code paths +- require a generic skip. */ +- +-static void +-skip_undetermined_arglist (int nargs, struct expression *exp, int *pos, +- enum noside noside) +-{ +- for (int i = 0; i < nargs; ++i) +- evaluate_subexp (NULL_TYPE, exp, pos, noside); +-} +- + struct value * + evaluate_subexp_standard (struct type *expect_type, + struct expression *exp, int *pos, +@@ -1946,33 +2228,8 @@ evaluate_subexp_standard (struct type *expect_type, switch (code) { case TYPE_CODE_ARRAY: - if (exp->elts[*pos].opcode == OP_RANGE) - return value_f90_subarray (arg1, exp, pos, noside); - else -- goto multi_f77_subscript; +- { +- if (noside == EVAL_SKIP) +- { +- skip_undetermined_arglist (nargs, exp, pos, noside); +- /* Return the dummy value with the correct type. */ +- return arg1; +- } +- goto multi_f77_subscript; +- } - case TYPE_CODE_STRING: - if (exp->elts[*pos].opcode == OP_RANGE) - return value_f90_subarray (arg1, exp, pos, noside); - else - { +- if (noside == EVAL_SKIP) +- { +- skip_undetermined_arglist (nargs, exp, pos, noside); +- /* Return the dummy value with the correct type. */ +- return arg1; +- } - arg2 = evaluate_subexp_with_coercion (exp, pos, noside); - return value_subscript (arg1, value_as_long (arg2)); - } @@ -554,7 +588,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c case TYPE_CODE_PTR: case TYPE_CODE_FUNC: -@@ -2338,49 +2622,6 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2369,49 +2626,6 @@ evaluate_subexp_standard (struct type *expect_type, } return (arg1); @@ -604,7 +638,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c case BINOP_LOGICAL_AND: arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); if (noside == EVAL_SKIP) -@@ -3301,6 +3542,9 @@ calc_f77_array_dims (struct type *array_type) +@@ -3331,6 +3545,9 @@ calc_f77_array_dims (struct type *array_type) int ndimen = 1; struct type *tmp_type; @@ -639,7 +673,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c print_subexp (exp, pos, stream, PREC_ABOVE_COMMA); fputs_filtered (")", stream); return; -@@ -1098,22 +1095,24 @@ dump_subexp_body_standard (struct expression *exp, +@@ -1105,22 +1102,24 @@ dump_subexp_body_standard (struct expression *exp, switch (range_type) { @@ -672,7 +706,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c fputs_filtered ("ExclusiveRange 'EXP..EXP'", stream); break; default: -@@ -1121,11 +1120,9 @@ dump_subexp_body_standard (struct expression *exp, +@@ -1128,11 +1127,9 @@ dump_subexp_body_standard (struct expression *exp, break; } @@ -689,7 +723,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c diff --git a/gdb/expression.h b/gdb/expression.h --- a/gdb/expression.h +++ b/gdb/expression.h -@@ -148,28 +148,27 @@ extern void dump_raw_expression (struct expression *, +@@ -150,28 +150,27 @@ extern void dump_raw_expression (struct expression *, struct ui_file *, const char *); extern void dump_prefix_expression (struct expression *, struct ui_file *); @@ -999,7 +1033,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h diff --git a/gdb/parse.c b/gdb/parse.c --- a/gdb/parse.c +++ b/gdb/parse.c -@@ -988,24 +988,20 @@ operator_length_standard (const struct expression *expr, int endpos, +@@ -989,24 +989,20 @@ operator_length_standard (const struct expression *expr, int endpos, case OP_RANGE: oplen = 3; @@ -1078,7 +1112,7 @@ diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c -@@ -1181,13 +1181,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside) +@@ -1179,13 +1179,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside) kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst); *pos += 3; @@ -1095,7 +1129,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c if (noside == EVAL_SKIP) return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1); -@@ -1276,7 +1274,7 @@ rust_compute_range (struct type *type, struct value *range, +@@ -1274,7 +1272,7 @@ rust_compute_range (struct type *type, struct value *range, *low = 0; *high = 0; @@ -1104,7 +1138,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c if (TYPE_NFIELDS (type) == 0) return; -@@ -1284,15 +1282,14 @@ rust_compute_range (struct type *type, struct value *range, +@@ -1282,15 +1280,14 @@ rust_compute_range (struct type *type, struct value *range, i = 0; if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0) { @@ -1122,7 +1156,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c *high = value_as_long (value_field (range, i)); if (rust_inclusive_range_type_p (type)) -@@ -1310,7 +1307,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, +@@ -1308,7 +1305,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, struct type *rhstype; LONGEST low, high_bound; /* Initialized to appease the compiler. */ @@ -1131,7 +1165,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c LONGEST high = 0; int want_slice = 0; -@@ -1408,7 +1405,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, +@@ -1406,7 +1403,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, error (_("Cannot subscript non-array type")); if (want_slice @@ -1140,7 +1174,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c low = low_bound; if (low < 0) error (_("Index less than zero")); -@@ -1426,7 +1423,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, +@@ -1424,7 +1421,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, CORE_ADDR addr; struct value *addrval, *tem; @@ -1784,7 +1818,7 @@ diff --git a/gdb/valarith.c b/gdb/valarith.c diff --git a/gdb/valops.c b/gdb/valops.c --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -3807,56 +3807,195 @@ value_of_this_silent (const struct language_defn *lang) +@@ -3800,56 +3800,195 @@ value_of_this_silent (const struct language_defn *lang) struct value * value_slice (struct value *array, int lowbound, int length) diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch index 1646bd3..4c5b11b 100644 --- a/gdb-vla-intel-fortran-vla-strings.patch +++ b/gdb-vla-intel-fortran-vla-strings.patch @@ -33,7 +33,7 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings diff --git a/gdb/NEWS b/gdb/NEWS --- a/gdb/NEWS +++ b/gdb/NEWS -@@ -203,6 +203,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* +@@ -229,6 +229,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* *** Changes in GDB 8.1 @@ -87,7 +87,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c /* memory allocation interface */ -@@ -13748,7 +13749,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -13746,7 +13747,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) { newobj->static_link = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop); @@ -96,7 +96,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } cu->list_in_scope = cu->builder->get_local_symbols (); -@@ -16468,7 +16469,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -16466,7 +16467,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) byte_stride_prop = (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop)); @@ -106,7 +106,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (!stride_ok) { complaint (_("unable to read array DW_AT_byte_stride " -@@ -17229,29 +17231,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17227,29 +17229,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -208,7 +208,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -17599,7 +17662,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17597,7 +17660,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, @@ -218,7 +218,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c { struct dwarf2_property_baton *baton; struct obstack *obstack -@@ -17610,14 +17674,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17608,14 +17672,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, if (attr_form_is_block (attr)) { @@ -256,7 +256,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } else if (attr_form_is_ref (attr)) { -@@ -17650,8 +17733,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17648,8 +17731,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, baton = XOBNEW (obstack, struct dwarf2_property_baton); baton->referenced_type = die_type (target_die, target_cu); baton->locexpr.per_cu = cu->per_cu; @@ -287,7 +287,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c prop->data.baton = baton; prop->kind = PROP_LOCEXPR; gdb_assert (prop->data.baton != NULL); -@@ -17762,7 +17865,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17760,7 +17863,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_byte_stride, cu); if (attr) @@ -296,7 +296,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c complaint (_("Missing DW_AT_byte_stride " "- DIE at 0x%s [in module %s]"), sect_offset_str (die->sect_off), -@@ -17770,7 +17873,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17768,7 +17871,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) @@ -305,7 +305,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c else if (!low_default_is_valid) complaint (_("Missing DW_AT_lower_bound " "- DIE at %s [in module %s]"), -@@ -17779,10 +17882,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17777,10 +17880,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct attribute *attr_ub, *attr_count; attr = attr_ub = dwarf2_attr (die, DW_AT_upper_bound, cu); @@ -318,7 +318,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c { /* If bounds are constant do the final calculation here. */ if (low.kind == PROP_CONST && high.kind == PROP_CONST) -@@ -25337,7 +25440,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25335,7 +25438,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_allocated, cu); if (attr_form_is_block (attr)) { @@ -327,7 +327,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ALLOCATED, prop, type); } else if (attr != NULL) -@@ -25351,7 +25454,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25349,7 +25452,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_associated, cu); if (attr_form_is_block (attr)) { @@ -336,7 +336,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type); } else if (attr != NULL) -@@ -25363,7 +25466,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25361,7 +25464,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) /* Read DW_AT_data_location and set in type. */ attr = dwarf2_attr (die, DW_AT_data_location, cu); @@ -1306,7 +1306,7 @@ diff --git a/gdb/typeprint.c b/gdb/typeprint.c diff --git a/gdb/valops.c b/gdb/valops.c --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -1565,6 +1565,19 @@ value_ind (struct value *arg1) +@@ -1558,6 +1558,19 @@ value_ind (struct value *arg1) if (TYPE_CODE (base_type) == TYPE_CODE_PTR) { struct type *enc_type; @@ -1326,7 +1326,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c /* We may be pointing to something embedded in a larger object. Get the real type of the enclosing object. */ -@@ -1580,8 +1593,7 @@ value_ind (struct value *arg1) +@@ -1573,8 +1586,7 @@ value_ind (struct value *arg1) else /* Retrieve the enclosing object pointed to. */ arg2 = value_at_lazy (enc_type, diff --git a/gdb-x86_64-i386-syscall-restart.patch b/gdb-x86_64-i386-syscall-restart.patch index 575674f..e4a41c8 100644 --- a/gdb-x86_64-i386-syscall-restart.patch +++ b/gdb-x86_64-i386-syscall-restart.patch @@ -111,11 +111,11 @@ diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c + for -ERESTART* values -512 being above 0xfffffffffffffe00; tested by + interrupt.exp. */ + -+ int i = I386_EAX_REGNUM; ++ int k = I386_EAX_REGNUM; + + if (regnum == -1 || regnum == i) + { -+ void *ptr = regs + amd64_native_gregset_reg_offset (gdbarch, i); ++ void *ptr = regs + amd64_native_gregset_reg_offset (gdbarch, k); + + *(int64_t *) ptr = *(int32_t *) ptr; + } diff --git a/gdb.spec b/gdb.spec index 162376b..97fdfac 100644 --- a/gdb.spec +++ b/gdb.spec @@ -18,7 +18,7 @@ Name: %{?scl_prefix}gdb # Freeze it when GDB gets branched -%global snapsrc 20180917 +%global snapsrc 20181006 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20161115 %global tarname gdb-%{version} @@ -26,7 +26,7 @@ Version: 8.2.50.%{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: 3%{?dist} +Release: 4%{?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 @@ -1024,6 +1024,9 @@ fi %endif %changelog +* Sat Oct 6 2018 Sergio Durigan Junior - 8.2.50.20181006-4.fc30 +- Rebase to FSF GDB 8.2.50.20181006 (8.3pre). + * Thu Oct 4 2018 Jan Kratochvil - 8.2.50.20180917-3.fc30 - Fix annobin complaints (RH BZ 1630564): --without-stage1-ldflags: Disable static libstdc++ and libgcc linking. diff --git a/sources b/sources index c17ff7d..07ccb0d 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz) = a8b1c54dd348cfeb37da73f968742896be3dd13a4215f8d8519870c2abea915f5176c3fa6989ddd10f20020a16f0fab20cbae68ee8d58a82234d8778023520f8 SHA512 (v2.0.tar.gz) = ec63151e842c81cc73ea11ba560b63e005cefbe19d98de24ae5c8caa4de7c9c1d71d1ec5b6214a347592eac675b75a3d2b26d4691ca86f91020ebfea8e912939 -SHA512 (gdb-8.2.50.20180917.tar.xz) = 92f07fc062ff9d7cb5683507a256f65ae9d29b7d6368d22f474041201c129b1d3f687f02e89e509d5fd8e9c08dbc8bbf9d9aad56d9dbdc2f6e2baef223cc90ef +SHA512 (gdb-8.2.50.20181006.tar.xz) = 60258237e19127f339f7bfe0a75a1ea46be3e1c789c2ab184825b7eff8977f27454feaf84b283f1807e2a0355e8c8c1216ac3a1bd7c3cddd934d06532b0bea09 From d82716127f2144276449193784cd8d0c6685ee56 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 10 Oct 2018 18:37:53 -0400 Subject: [PATCH 31/35] Rebase to FSF GDB 8.2.50.20181010 (8.3pre). Remove 'gdb-6.8-sparc64-silence-memcpy-check.patch'. Remove 'gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch'. --- .gitignore | 2 +- _gdb.spec.Patch.include | 166 ++++++++---------- _gdb.spec.patch.include | 2 - _git_upstream_commit | 2 +- _patch_order | 2 - gdb-6.3-gstack-20050411.patch | 6 +- gdb-6.6-buildid-locate-rpm-scl.patch | 4 +- gdb-6.6-buildid-locate.patch | 8 +- gdb-6.8-sparc64-silence-memcpy-check.patch | 19 -- ...add-workaround-to-broken-debug-files.patch | 68 ------- gdb-archer.patch | 4 +- gdb-bz541866-rwatch-before-run.patch | 4 +- gdb-glibc-strstr-workaround.patch | 2 +- gdb-gnat-dwarf-crash-3of3.patch | 2 +- gdb-rhbz795424-bitpos-20of25.patch | 22 +-- gdb-vla-intel-fortran-strides.patch | 10 +- gdb-vla-intel-fortran-vla-strings.patch | 28 +-- gdb.spec | 9 +- sources | 2 +- 19 files changed, 129 insertions(+), 233 deletions(-) delete mode 100644 gdb-6.8-sparc64-silence-memcpy-check.patch delete mode 100644 gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch diff --git a/.gitignore b/.gitignore index 0ec9ea0..c43a666 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz /v2.0.tar.gz -/gdb-8.2.50.20181006.tar.xz +/gdb-8.2.50.20181010.tar.xz diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include index 8000fa7..7c221e5 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -180,328 +180,310 @@ Patch044: gdb-6.3-focus-cmd-prev-test.patch #=fedoratest Patch045: gdb-6.8-bz442765-threaded-exec-test.patch -# Silence memcpy check which returns false positive (sparc64) -#=push: But it is just a GCC workaround, look up the existing GCC PR for it. -Patch046: gdb-6.8-sparc64-silence-memcpy-check.patch - # Test a crash on libraries missing the .text section. #=fedoratest -Patch047: gdb-6.5-section-num-fixup-test.patch +Patch046: gdb-6.5-section-num-fixup-test.patch # Fix register assignments with no GDB stack frames (BZ 436037). #=push+jan: This fix is incorrect. -Patch048: gdb-6.8-bz436037-reg-no-longer-active.patch +Patch047: gdb-6.8-bz436037-reg-no-longer-active.patch # Test the watchpoints conditionals works. #=fedoratest -Patch049: gdb-6.8-watchpoint-conditionals-test.patch +Patch048: gdb-6.8-watchpoint-conditionals-test.patch # Fix resolving of variables at locations lists in prelinked libs (BZ 466901). #=fedoratest -Patch050: gdb-6.8-bz466901-backtrace-full-prelinked.patch +Patch049: gdb-6.8-bz466901-backtrace-full-prelinked.patch # New test for step-resume breakpoint placed in multiple threads at once. #=fedoratest -Patch051: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch050: gdb-simultaneous-step-resume-breakpoint-test.patch # Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. # Fix regression of undisplayed missing shared libraries caused by a fix for. #=fedoratest: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*> -Patch052: gdb-core-open-vdso-warning.patch +Patch051: gdb-core-open-vdso-warning.patch # Fix syscall restarts for amd64->i386 biarch. #=push+jan -Patch053: gdb-x86_64-i386-syscall-restart.patch +Patch052: gdb-x86_64-i386-syscall-restart.patch # Fix stepping with OMP parallel Fortran sections (BZ 533176). #=push+jan: It requires some better DWARF annotations. -Patch054: gdb-bz533176-fortran-omp-step.patch +Patch053: gdb-bz533176-fortran-omp-step.patch # Fix regression by python on ia64 due to stale current frame. #=push+jan -Patch055: gdb-follow-child-stale-parent.patch +Patch054: gdb-follow-child-stale-parent.patch # Workaround ccache making lineno non-zero for command-line definitions. #=fedoratest: ccache is rarely used and it is even fixed now. -Patch056: gdb-ccache-workaround.patch +Patch055: gdb-ccache-workaround.patch #=push+jan: May get obsoleted by Tom's unrelocated objfiles patch. -Patch057: gdb-archer-pie-addons.patch +Patch056: gdb-archer-pie-addons.patch #=push+jan: Breakpoints disabling matching should not be based on address. -Patch058: gdb-archer-pie-addons-keep-disabled.patch +Patch057: gdb-archer-pie-addons-keep-disabled.patch # Testcase for "Do not make up line information" fix by Daniel Jacobowitz. #=fedoratest -Patch059: gdb-lineno-makeup-test.patch +Patch058: gdb-lineno-makeup-test.patch # Test power7 ppc disassembly. #=fedoratest -Patch060: gdb-ppc-power7-test.patch +Patch059: gdb-ppc-power7-test.patch # Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866). # Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866). #=push+jan: It should be fixed properly instead. -Patch061: gdb-bz541866-rwatch-before-run.patch +Patch060: gdb-bz541866-rwatch-before-run.patch # Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623). #=push+jan: Currently it is still not fully safe. -Patch062: gdb-moribund-utrace-workaround.patch +Patch061: gdb-moribund-utrace-workaround.patch # Fix follow-exec for C++ programs (bugreported by Martin Stransky). #=fedoratest -Patch063: gdb-archer-next-over-throw-cxx-exec.patch +Patch062: gdb-archer-next-over-throw-cxx-exec.patch # Backport DWARF-4 support (BZ 601887, Tom Tromey). #=fedoratest -Patch064: gdb-bz601887-dwarf4-rh-test.patch +Patch063: gdb-bz601887-dwarf4-rh-test.patch #=push+jan -Patch065: gdb-6.6-buildid-locate-core-as-arg.patch +Patch064: gdb-6.6-buildid-locate-core-as-arg.patch # Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). #=push+jan -Patch066: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +Patch065: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch # [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604). #=fedoratest -Patch067: gdb-test-bt-cfi-without-die.patch +Patch066: gdb-test-bt-cfi-without-die.patch # Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248). #=push+jan: Inferior objects should be read in parts, then this patch gets obsoleted. -Patch068: gdb-bz568248-oom-is-error.patch +Patch067: gdb-bz568248-oom-is-error.patch # Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). #=fedoratest -Patch069: gdb-bz634108-solib_address.patch +Patch068: gdb-bz634108-solib_address.patch # New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435). #=fedoratest -Patch070: gdb-test-pid0-core.patch +Patch069: gdb-test-pid0-core.patch # [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp. #=fedoratest -Patch071: gdb-test-dw2-aranges.patch +Patch070: gdb-test-dw2-aranges.patch # [archer-keiths-expr-cumulative+upstream] Import C++ testcases. #=fedoratest -Patch072: gdb-test-expr-cumulative-archer.patch +Patch071: gdb-test-expr-cumulative-archer.patch # Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). #=fedoratest -Patch073: gdb-physname-pr11734-test.patch +Patch072: gdb-physname-pr11734-test.patch # Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). #=fedoratest -Patch074: gdb-physname-pr12273-test.patch - -# Toolchain on sparc is slightly broken and debuginfo files are generated -# with non 64bit aligned tables/offsets. -# See for example readelf -S ../Xvnc.debug. -# -# As a consenquence calculation of sectp->filepos as used in -# dwarf2_read_section (gdb/dwarf2read.c:1525) will return a non aligned buffer -# that cannot be used directly as done with MMAP. -# Usage will result in a BusError. -# -# While we figure out what's wrong in the toolchain and do a full archive -# rebuild to fix it, we need to be able to use gdb :) -#=push -Patch075: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch +Patch073: gdb-physname-pr12273-test.patch # Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890). #=fedoratest -Patch076: gdb-test-ivy-bridge.patch +Patch074: gdb-test-ivy-bridge.patch # Hack for proper PIE run of the testsuite. #=fedoratest -Patch077: gdb-runtest-pie-override.patch +Patch075: gdb-runtest-pie-override.patch # Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878). #=push+jan -Patch078: gdb-attach-fail-reasons-5of5.patch +Patch076: gdb-attach-fail-reasons-5of5.patch # Workaround PR libc/14166 for inferior calls of strstr. #=fedora: Compatibility with RHELs (unchecked which ones). -Patch079: gdb-glibc-strstr-workaround.patch +Patch077: gdb-glibc-strstr-workaround.patch # Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789). #=fedoratest -Patch080: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +Patch078: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch # Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343). #=fedoratest -Patch081: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch079: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch082: gdb-rhbz795424-bitpos-20of25.patch +Patch080: gdb-rhbz795424-bitpos-20of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch083: gdb-rhbz795424-bitpos-21of25.patch +Patch081: gdb-rhbz795424-bitpos-21of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch084: gdb-rhbz795424-bitpos-22of25.patch +Patch082: gdb-rhbz795424-bitpos-22of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch085: gdb-rhbz795424-bitpos-23of25.patch +Patch083: gdb-rhbz795424-bitpos-23of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch086: gdb-rhbz795424-bitpos-25of25.patch +Patch084: gdb-rhbz795424-bitpos-25of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch087: gdb-rhbz795424-bitpos-25of25-test.patch +Patch085: gdb-rhbz795424-bitpos-25of25-test.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch088: gdb-rhbz795424-bitpos-lazyvalue.patch +Patch086: gdb-rhbz795424-bitpos-lazyvalue.patch # Import regression test for `gdb/findvar.c:417: internal-error: # read_var_value: Assertion `frame' failed.' (RH BZ 947564) from RHEL 6.5. #=fedoratest -Patch089: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch087: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch # Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211). #=push+jan -Patch090: gdb-gnat-dwarf-crash-3of3.patch +Patch088: gdb-gnat-dwarf-crash-3of3.patch # Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614) #=fedoratest -Patch091: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch089: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch # Fix 'gdb gives highly misleading error when debuginfo pkg is present, # but not corresponding binary pkg' (RH BZ 981154). #=push+jan -Patch092: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +Patch090: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch #=fedoratest -Patch093: gdb-archer-vla-tests.patch +Patch091: gdb-archer-vla-tests.patch #=fedoratest -Patch094: gdb-vla-intel-tests.patch +Patch092: gdb-vla-intel-tests.patch # Continue backtrace even if a frame filter throws an exception (Phil Muldoon). #=push -Patch095: gdb-btrobust.patch +Patch093: gdb-btrobust.patch # Display Fortran strings in backtraces. #=fedoratest -Patch096: gdb-fortran-frame-string.patch +Patch094: gdb-fortran-frame-string.patch # Fix Python GIL with gdb.execute("continue") (Phil Muldoon, BZ 1116957). #=push -Patch097: gdb-python-gil.patch +Patch095: gdb-python-gil.patch # Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to # crash.' (RH BZ 1156192). #=fedoratest -Patch098: gdb-rhbz1156192-recursive-dlopen-test.patch +Patch096: gdb-rhbz1156192-recursive-dlopen-test.patch # Fix jit-reader.h for multi-lib. #=push+jan -Patch099: gdb-jit-reader-multilib.patch +Patch097: gdb-jit-reader-multilib.patch # Fix '`catch syscall' doesn't work for parent after `fork' is called' # (Philippe Waroquiers, RH BZ 1149205). #=fedoratest -Patch100: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch098: gdb-rhbz1149205-catch-syscall-after-fork-test.patch # Fix 'backport GDB 7.4 fix to RHEL 6.6 GDB' [Original Sourceware bug # description: 'C++ (and objc): Internal error on unqualified name # re-set', PR 11657] (RH BZ 1186476). #=fedoratest -Patch101: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch +Patch099: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch # Test 'info type-printers' Python error (RH BZ 1350436). #=fedoratest -Patch102: gdb-rhbz1350436-type-printers-error.patch +Patch100: gdb-rhbz1350436-type-printers-error.patch # Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan # Kratochvil, RH BZ 1084404). #=fedoratest -Patch103: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch101: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch # Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747). #=push+jan -Patch104: gdb-bz1219747-attach-kills.patch +Patch102: gdb-bz1219747-attach-kills.patch # Force libncursesw over libncurses to match the includes (RH BZ 1270534). #=push+jan -Patch105: gdb-fedora-libncursesw.patch +Patch103: gdb-fedora-libncursesw.patch # Test clflushopt instruction decode (for RH BZ 1262471). #=fedoratest -Patch106: gdb-opcodes-clflushopt-test.patch +Patch104: gdb-opcodes-clflushopt-test.patch # [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon). #=fedora -Patch107: gdb-dts-rhel6-python-compat.patch +Patch105: gdb-dts-rhel6-python-compat.patch # [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585). #=push+jan -Patch108: gdb-6.6-buildid-locate-rpm-scl.patch +Patch106: gdb-6.6-buildid-locate-rpm-scl.patch # Work around readline-6.2 incompatibility not asking for --more-- (BZ 701131). #=fedora -Patch109: gdb-readline62-ask-more-rh.patch +Patch107: gdb-readline62-ask-more-rh.patch # Make the GDB quit processing non-abortable to cleanup everything properly. #=fedora: It was useful only after gdb-6.8-attach-signalled-detach-stopped.patch . -Patch110: gdb-6.8-quit-never-aborts.patch +Patch108: gdb-6.8-quit-never-aborts.patch # [aarch64] Fix hardware watchpoints (RH BZ 1261564). #=fedoratest -Patch111: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch109: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch # Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114). #=fedora -Patch112: gdb-container-rh-pkg.patch +Patch110: gdb-container-rh-pkg.patch # New test for Python "Cannot locate object file for block" (for RH BZ 1325795). #=fedoratest -Patch113: gdb-rhbz1325795-framefilters-test.patch +Patch111: gdb-rhbz1325795-framefilters-test.patch # [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). #=fedora -Patch114: gdb-linux_perf-bundle.patch +Patch112: gdb-linux_perf-bundle.patch # Fix gdb-headless /usr/bin/ executables (BZ 1390251). #=fedora -Patch115: gdb-libexec-add-index.patch +Patch113: gdb-libexec-add-index.patch # New testcase for: Fix -completion crash (Gary Benson, RH BZ 1398387). #=fedoratest -Patch116: gdb-rhbz1398387-tab-crash-test.patch +Patch114: gdb-rhbz1398387-tab-crash-test.patch # [testsuite] Fix false selftest.exp FAIL from system readline-6.3+ (Patrick Palka). #=fedoratest -Patch117: gdb-testsuite-readline63-sigint.patch +Patch115: gdb-testsuite-readline63-sigint.patch # Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher #=push -Patch118: gdb-archer.patch +Patch116: gdb-archer.patch # Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd -Patch119: gdb-vla-intel-fix-print-char-array.patch +Patch117: gdb-vla-intel-fix-print-char-array.patch # [s390x] Backport arch12 instructions decoding (RH BZ 1553104). # =fedoratest -Patch120: gdb-rhbz1553104-s390x-arch12-test.patch +Patch118: gdb-rhbz1553104-s390x-arch12-test.patch # This patch is needed to compile GDB after -Werror=narrowing has # been enabled by default. # Author: Sergio Durigan Junior. -Patch121: gdb-rhbz795424-bitpos-arrayview.patch +Patch119: gdb-rhbz795424-bitpos-arrayview.patch diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include index a663edb..235c823 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -117,5 +117,3 @@ %patch117 -p1 %patch118 -p1 %patch119 -p1 -%patch120 -p1 -%patch121 -p1 diff --git a/_git_upstream_commit b/_git_upstream_commit index 127b1d6..386104d 100644 --- a/_git_upstream_commit +++ b/_git_upstream_commit @@ -1 +1 @@ -ce3a1736b59a05128049459fcd6c91c221f40257 +daff3a48c17625ade8b57cf770fc77b4c1815df2 diff --git a/_patch_order b/_patch_order index b7f1dc0..f8b45dd 100644 --- a/_patch_order +++ b/_patch_order @@ -43,7 +43,6 @@ gdb-6.5-gcore-buffer-limit-test.patch gdb-6.3-mapping-zero-inode-test.patch gdb-6.3-focus-cmd-prev-test.patch gdb-6.8-bz442765-threaded-exec-test.patch -gdb-6.8-sparc64-silence-memcpy-check.patch gdb-6.5-section-num-fixup-test.patch gdb-6.8-bz436037-reg-no-longer-active.patch gdb-6.8-watchpoint-conditionals-test.patch @@ -72,7 +71,6 @@ gdb-test-dw2-aranges.patch gdb-test-expr-cumulative-archer.patch gdb-physname-pr11734-test.patch gdb-physname-pr12273-test.patch -gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch gdb-test-ivy-bridge.patch gdb-runtest-pie-override.patch gdb-attach-fail-reasons-5of5.patch diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 8c40414..91eaed9 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -1733,7 +1733,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force +@@ -1734,7 +1734,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force install: all @$(MAKE) $(FLAGS_TO_PASS) install-only @@ -25,7 +25,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -1782,7 +1782,25 @@ install-guile: +@@ -1783,7 +1783,25 @@ install-guile: install-python: $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb @@ -52,7 +52,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ -@@ -1805,6 +1823,18 @@ uninstall: force $(CONFIG_UNINSTALL) +@@ -1806,6 +1824,18 @@ uninstall: force $(CONFIG_UNINSTALL) fi @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch index da2bf5d..612cdc0 100644 --- a/gdb-6.6-buildid-locate-rpm-scl.patch +++ b/gdb-6.6-buildid-locate-rpm-scl.patch @@ -99,7 +99,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -3467,6 +3467,16 @@ read_gdb_index_from_buffer (struct objfile *objfile, +@@ -3468,6 +3468,16 @@ read_gdb_index_from_buffer (struct objfile *objfile, "set use-deprecated-index-sections on". */ if (version < 6 && !deprecated_ok) { @@ -116,7 +116,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c static int warning_printed = 0; if (!warning_printed) { -@@ -3478,6 +3488,10 @@ to use the section anyway."), +@@ -3479,6 +3489,10 @@ to use the section anyway."), warning_printed = 1; } return 0; diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index bc9f5ac..28c0637 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -977,7 +977,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -19829,6 +19829,27 @@ information files. +@@ -19835,6 +19835,27 @@ information files. @end table @@ -1020,7 +1020,7 @@ diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -2693,7 +2693,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile) +@@ -2694,7 +2694,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile) } if (dwz_bfd == NULL) @@ -1029,7 +1029,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (dwz_bfd == NULL) error (_("could not find '.gnu_debugaltlink' file for %s"), -@@ -6197,7 +6197,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) +@@ -6198,7 +6198,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) static gdb::array_view get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) { @@ -1038,7 +1038,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (build_id == nullptr) return {}; -@@ -6210,7 +6210,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) +@@ -6211,7 +6211,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) static gdb::array_view get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz) { diff --git a/gdb-6.8-sparc64-silence-memcpy-check.patch b/gdb-6.8-sparc64-silence-memcpy-check.patch deleted file mode 100644 index 6c0848d..0000000 --- a/gdb-6.8-sparc64-silence-memcpy-check.patch +++ /dev/null @@ -1,19 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.8-sparc64-silence-memcpy-check.patch - -;; Silence memcpy check which returns false positive (sparc64) -;;=push: But it is just a GCC workaround, look up the existing GCC PR for it. - -diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c ---- a/gdb/sparc-tdep.c -+++ b/gdb/sparc-tdep.c -@@ -1462,6 +1462,7 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache, - if (sparc_floating_p (type) || sparc_complex_floating_p (type)) - { - /* Floating return values. */ -+ len = (len <= 8) ? len : 8; - memcpy (buf, valbuf, len); - regcache->cooked_write (SPARC_F0_REGNUM, buf); - if (len > 4) diff --git a/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch b/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch deleted file mode 100644 index fc75329..0000000 --- a/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch +++ /dev/null @@ -1,68 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch - -;; Toolchain on sparc is slightly broken and debuginfo files are generated -;; with non 64bit aligned tables/offsets. -;; See for example readelf -S ../Xvnc.debug. -;; -;; As a consenquence calculation of sectp->filepos as used in -;; dwarf2_read_section (gdb/dwarf2read.c:1525) will return a non aligned buffer -;; that cannot be used directly as done with MMAP. -;; Usage will result in a BusError. -;; -;; While we figure out what's wrong in the toolchain and do a full archive -;; rebuild to fix it, we need to be able to use gdb :) -;;=push - -diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c ---- a/gdb/gdb_bfd.c -+++ b/gdb/gdb_bfd.c -@@ -24,12 +24,14 @@ - #include "hashtab.h" - #include "filestuff.h" - #include "vec.h" -+#ifndef __sparc__ - #ifdef HAVE_MMAP - #include - #ifndef MAP_FAILED - #define MAP_FAILED ((void *) -1) - #endif - #endif -+#endif - #include "target.h" - #include "gdb/fileio.h" - #include "inferior.h" -@@ -484,6 +486,7 @@ free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore) - - if (sect != NULL && sect->data != NULL) - { -+#ifndef __sparc__ - #ifdef HAVE_MMAP - if (sect->map_addr != NULL) - { -@@ -493,6 +496,7 @@ free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore) - gdb_assert (res == 0); - } - else -+#endif - #endif - xfree (sect->data); - } -@@ -659,6 +663,7 @@ gdb_bfd_map_section (asection *sectp, bfd_size_type *size) - if (descriptor->data != NULL) - goto done; - -+#ifndef __sparc__ - #ifdef HAVE_MMAP - if (!bfd_is_section_compressed (abfd, sectp)) - { -@@ -693,6 +698,7 @@ gdb_bfd_map_section (asection *sectp, bfd_size_type *size) - } - } - #endif /* HAVE_MMAP */ -+#endif - - /* Handle compressed sections, or ordinary uncompressed sections in - the no-mmap case. */ diff --git a/gdb-archer.patch b/gdb-archer.patch index 734ef57..8c2a432 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -17,7 +17,7 @@ tromey/python diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -2093,6 +2093,12 @@ stamp-h: $(srcdir)/config.in config.status +@@ -2094,6 +2094,12 @@ stamp-h: $(srcdir)/config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -53,7 +53,7 @@ diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -1245,6 +1245,16 @@ for remote debugging. +@@ -1251,6 +1251,16 @@ for remote debugging. Run using @var{device} for your program's standard input and output. @c FIXME: kingdon thinks there is more to -tty. Investigate. diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch index d5a9e1a..5cba714 100644 --- a/gdb-bz541866-rwatch-before-run.patch +++ b/gdb-bz541866-rwatch-before-run.patch @@ -97,7 +97,7 @@ new file mode 100644 diff --git a/gdb/configure.nat b/gdb/configure.nat --- a/gdb/configure.nat +++ b/gdb/configure.nat -@@ -238,6 +238,7 @@ case ${gdb_host} in +@@ -242,6 +242,7 @@ case ${gdb_host} in ;; i386) # Host: Intel 386 running GNU/Linux. @@ -105,7 +105,7 @@ diff --git a/gdb/configure.nat b/gdb/configure.nat NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \ i386-linux-nat.o x86-linux-nat.o linux-btrace.o \ x86-linux.o x86-linux-dregs.o" -@@ -294,6 +295,7 @@ case ${gdb_host} in +@@ -298,6 +299,7 @@ case ${gdb_host} in case ${gdb_host_cpu} in i386) # Host: GNU/Linux x86-64 diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch index a6b4c2c..7d1a7cf 100644 --- a/gdb-glibc-strstr-workaround.patch +++ b/gdb-glibc-strstr-workaround.patch @@ -9,7 +9,7 @@ Subject: gdb-glibc-strstr-workaround.patch diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -21441,6 +21441,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, +@@ -21458,6 +21458,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* Cache this symbol's name and the name's demangled form (if any). */ SYMBOL_SET_LANGUAGE (sym, cu->language, &objfile->objfile_obstack); linkagename = dwarf2_physname (name, die, cu); diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch index 88600e6..d2d1f60 100644 --- a/gdb-gnat-dwarf-crash-3of3.patch +++ b/gdb-gnat-dwarf-crash-3of3.patch @@ -42,7 +42,7 @@ gdb/ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -10584,6 +10584,13 @@ private: +@@ -10585,6 +10585,13 @@ private: static void process_die (struct die_info *die, struct dwarf2_cu *cu) { diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index 1702214..e2cf82f 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -1634,7 +1634,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -2031,11 +2031,11 @@ dwarf2_complex_location_expr_complaint (void) +@@ -2032,11 +2032,11 @@ dwarf2_complex_location_expr_complaint (void) } static void @@ -1650,7 +1650,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } static void -@@ -15075,8 +15075,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, +@@ -15092,8 +15092,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, object, and then subtract off the number of bits of the field itself. The result is the bit offset of the LSB of the field. */ @@ -2691,7 +2691,7 @@ diff --git a/gdb/regcache.c b/gdb/regcache.c diff --git a/gdb/regcache.h b/gdb/regcache.h --- a/gdb/regcache.h +++ b/gdb/regcache.h -@@ -256,8 +256,8 @@ public: +@@ -273,8 +273,8 @@ public: enum register_status raw_read (int regnum, T *val); /* Partial transfer of raw registers. Return the status of the register. */ @@ -2702,7 +2702,7 @@ diff --git a/gdb/regcache.h b/gdb/regcache.h /* Make certain that the register REGNUM is up-to-date. */ virtual void raw_update (int regnum) = 0; -@@ -269,8 +269,8 @@ public: +@@ -286,8 +286,8 @@ public: enum register_status cooked_read (int regnum, T *val); /* Partial transfer of a cooked register. */ @@ -2713,7 +2713,7 @@ diff --git a/gdb/regcache.h b/gdb/regcache.h /* Read register REGNUM from the regcache and return a new value. This will call mark_value_bytes_unavailable as appropriate. */ -@@ -280,7 +280,7 @@ protected: +@@ -297,7 +297,7 @@ protected: /* Perform a partial register transfer using a read, modify, write operation. Will fail if register is currently invalid. */ @@ -2722,7 +2722,7 @@ diff --git a/gdb/regcache.h b/gdb/regcache.h gdb_byte *out, bool is_raw); }; -@@ -338,11 +338,12 @@ public: +@@ -355,11 +355,12 @@ public: /* Partial transfer of raw registers. Perform read, modify, write style operations. */ @@ -2737,7 +2737,7 @@ diff --git a/gdb/regcache.h b/gdb/regcache.h const gdb_byte *buf); void supply_regset (const struct regset *regset, -@@ -393,7 +394,7 @@ private: +@@ -410,7 +411,7 @@ private: /* Perform a partial register transfer using a read, modify, write operation. */ @@ -3189,7 +3189,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c gdb_byte buffer[sizeof (LONGEST)]; if (value_bitsize (toval)) -@@ -3349,7 +3349,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) +@@ -3392,7 +3392,7 @@ get_baseclass_offset (struct type *vt, struct type *cls, the form "DOMAIN::NAME". */ static struct value * @@ -3198,7 +3198,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c struct type *curtype, const char *name, struct type *intype, int want_address, -@@ -3383,7 +3383,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, +@@ -3426,7 +3426,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, if (want_address) return value_from_longest (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), @@ -3207,7 +3207,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c else if (noside != EVAL_NORMAL) return allocate_value (TYPE_FIELD_TYPE (t, i)); else -@@ -3556,7 +3556,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, +@@ -3617,7 +3617,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) { struct value *v; @@ -3216,7 +3216,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (t, i)) base_offset = 0; -@@ -3705,7 +3705,7 @@ value_rtti_indirect_type (struct value *v, int *full, +@@ -3766,7 +3766,7 @@ value_rtti_indirect_type (struct value *v, int *full, struct value * value_full_object (struct value *argp, struct type *rtype, diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch index 2a1d2b5..e2cb702 100644 --- a/gdb-vla-intel-fortran-strides.patch +++ b/gdb-vla-intel-fortran-strides.patch @@ -143,7 +143,7 @@ diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -17703,7 +17703,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17720,7 +17720,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type, *orig_base_type; struct type *range_type; struct attribute *attr; @@ -152,7 +152,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c int low_default_is_valid; int high_bound_is_count = 0; const char *name; -@@ -17723,7 +17723,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17740,7 +17740,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) low.kind = PROP_CONST; high.kind = PROP_CONST; @@ -162,7 +162,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow omitting DW_AT_lower_bound. */ -@@ -17756,6 +17758,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17773,6 +17775,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) break; } @@ -177,7 +177,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) attr_to_dynamic_prop (attr, die, cu, &low); -@@ -17848,7 +17858,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17865,7 +17875,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask)) high.data.const_val |= negative_mask; @@ -1818,7 +1818,7 @@ diff --git a/gdb/valarith.c b/gdb/valarith.c diff --git a/gdb/valops.c b/gdb/valops.c --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -3800,56 +3800,195 @@ value_of_this_silent (const struct language_defn *lang) +@@ -3861,56 +3861,195 @@ value_of_this_silent (const struct language_defn *lang) struct value * value_slice (struct value *array, int lowbound, int length) diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch index 4c5b11b..c5a3885 100644 --- a/gdb-vla-intel-fortran-vla-strings.patch +++ b/gdb-vla-intel-fortran-vla-strings.patch @@ -33,7 +33,7 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings diff --git a/gdb/NEWS b/gdb/NEWS --- a/gdb/NEWS +++ b/gdb/NEWS -@@ -229,6 +229,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* +@@ -239,6 +239,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* *** Changes in GDB 8.1 @@ -77,7 +77,7 @@ diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -1799,7 +1799,8 @@ static void read_signatured_type (struct signatured_type *); +@@ -1800,7 +1800,8 @@ static void read_signatured_type (struct signatured_type *); static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, struct dwarf2_cu *cu, @@ -87,7 +87,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c /* memory allocation interface */ -@@ -13746,7 +13747,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -13748,7 +13749,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) { newobj->static_link = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop); @@ -96,7 +96,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } cu->list_in_scope = cu->builder->get_local_symbols (); -@@ -16466,7 +16467,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -16483,7 +16484,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) byte_stride_prop = (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop)); @@ -106,7 +106,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (!stride_ok) { complaint (_("unable to read array DW_AT_byte_stride " -@@ -17227,29 +17229,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17244,29 +17246,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -208,7 +208,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -17597,7 +17660,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17614,7 +17677,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, @@ -218,7 +218,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c { struct dwarf2_property_baton *baton; struct obstack *obstack -@@ -17608,14 +17672,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17625,14 +17689,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, if (attr_form_is_block (attr)) { @@ -256,7 +256,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } else if (attr_form_is_ref (attr)) { -@@ -17648,8 +17731,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17665,8 +17748,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, baton = XOBNEW (obstack, struct dwarf2_property_baton); baton->referenced_type = die_type (target_die, target_cu); baton->locexpr.per_cu = cu->per_cu; @@ -287,7 +287,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c prop->data.baton = baton; prop->kind = PROP_LOCEXPR; gdb_assert (prop->data.baton != NULL); -@@ -17760,7 +17863,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17777,7 +17880,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_byte_stride, cu); if (attr) @@ -296,7 +296,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c complaint (_("Missing DW_AT_byte_stride " "- DIE at 0x%s [in module %s]"), sect_offset_str (die->sect_off), -@@ -17768,7 +17871,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17785,7 +17888,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) @@ -305,7 +305,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c else if (!low_default_is_valid) complaint (_("Missing DW_AT_lower_bound " "- DIE at %s [in module %s]"), -@@ -17777,10 +17880,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17794,10 +17897,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct attribute *attr_ub, *attr_count; attr = attr_ub = dwarf2_attr (die, DW_AT_upper_bound, cu); @@ -318,7 +318,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c { /* If bounds are constant do the final calculation here. */ if (low.kind == PROP_CONST && high.kind == PROP_CONST) -@@ -25335,7 +25438,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25353,7 +25456,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_allocated, cu); if (attr_form_is_block (attr)) { @@ -327,7 +327,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ALLOCATED, prop, type); } else if (attr != NULL) -@@ -25349,7 +25452,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25367,7 +25470,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_associated, cu); if (attr_form_is_block (attr)) { @@ -336,7 +336,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type); } else if (attr != NULL) -@@ -25361,7 +25464,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25379,7 +25482,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) /* Read DW_AT_data_location and set in type. */ attr = dwarf2_attr (die, DW_AT_data_location, cu); diff --git a/gdb.spec b/gdb.spec index 97fdfac..cd552de 100644 --- a/gdb.spec +++ b/gdb.spec @@ -18,7 +18,7 @@ Name: %{?scl_prefix}gdb # Freeze it when GDB gets branched -%global snapsrc 20181006 +%global snapsrc 20181010 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20161115 %global tarname gdb-%{version} @@ -26,7 +26,7 @@ Version: 8.2.50.%{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: 4%{?dist} +Release: 5%{?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 @@ -1024,6 +1024,11 @@ fi %endif %changelog +* Wed Oct 10 2018 Sergio Durigan Junior - 8.2.50.20181010-5.fc30 +- Rebase to FSF GDB 8.2.50.20181010 (8.3pre). +- Remove 'gdb-6.8-sparc64-silence-memcpy-check.patch'. +- Remove 'gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch'. + * Sat Oct 6 2018 Sergio Durigan Junior - 8.2.50.20181006-4.fc30 - Rebase to FSF GDB 8.2.50.20181006 (8.3pre). diff --git a/sources b/sources index 07ccb0d..2ba807d 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz) = a8b1c54dd348cfeb37da73f968742896be3dd13a4215f8d8519870c2abea915f5176c3fa6989ddd10f20020a16f0fab20cbae68ee8d58a82234d8778023520f8 SHA512 (v2.0.tar.gz) = ec63151e842c81cc73ea11ba560b63e005cefbe19d98de24ae5c8caa4de7c9c1d71d1ec5b6214a347592eac675b75a3d2b26d4691ca86f91020ebfea8e912939 -SHA512 (gdb-8.2.50.20181006.tar.xz) = 60258237e19127f339f7bfe0a75a1ea46be3e1c789c2ab184825b7eff8977f27454feaf84b283f1807e2a0355e8c8c1216ac3a1bd7c3cddd934d06532b0bea09 +SHA512 (gdb-8.2.50.20181010.tar.xz) = 1c7797e87b87de8cbe948b2bb97613a282f066c8c4a262f25f37ecf7d217bdb8cc84da7e147f81b4ebc00ea2f873ac9440c80f6da822a2df2563e57a2c7b9a83 From e18aa17153c28bc6f471e1fb02dbd6bab379af37 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Tue, 16 Oct 2018 18:33:39 -0400 Subject: [PATCH 32/35] Rebase to FSF GDB 8.2.50.20181016 (8.3pre). Enable and always run the unittests when building the package. --- .gitignore | 2 +- _git_upstream_commit | 2 +- gdb-6.6-buildid-locate-rpm.patch | 8 ++++---- gdb-attach-fail-reasons-5of5.patch | 6 +++--- gdb-container-rh-pkg.patch | 2 +- gdb-fedora-libncursesw.patch | 8 ++++---- gdb-jit-reader-multilib.patch | 2 +- gdb-linux_perf-bundle.patch | 2 +- gdb-rhbz795424-bitpos-20of25.patch | 2 +- gdb-rhbz795424-bitpos-22of25.patch | 6 +++--- gdb.spec | 11 +++++++++-- sources | 2 +- 12 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index c43a666..a025f9b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz /v2.0.tar.gz -/gdb-8.2.50.20181010.tar.xz +/gdb-8.2.50.20181016.tar.xz diff --git a/_git_upstream_commit b/_git_upstream_commit index 386104d..ae7c651 100644 --- a/_git_upstream_commit +++ b/_git_upstream_commit @@ -1 +1 @@ -daff3a48c17625ade8b57cf770fc77b4c1815df2 +d53eec4ef86cf85841ceaec7db99753827f2beee diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index 18cfb65..d21a0fe 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -723,7 +723,7 @@ diff --git a/gdb/configure b/gdb/configure enable_targets enable_64_bit_bfd enable_gdbmi -@@ -911,6 +917,11 @@ CCC +@@ -912,6 +918,11 @@ CCC CPP MAKEINFO MAKEINFOFLAGS @@ -735,7 +735,7 @@ diff --git a/gdb/configure b/gdb/configure YACC YFLAGS XMKMF' -@@ -1580,6 +1591,8 @@ Optional Packages: +@@ -1583,6 +1594,8 @@ Optional Packages: [--with-auto-load-dir] --without-auto-load-safe-path do not restrict auto-loaded files locations @@ -744,7 +744,7 @@ diff --git a/gdb/configure b/gdb/configure --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets --with-curses use the curses library instead of the termcap library -@@ -1637,6 +1650,13 @@ Some influential environment variables: +@@ -1640,6 +1653,13 @@ Some influential environment variables: MAKEINFO Parent configure detects if it is of sufficient version. MAKEINFOFLAGS Parameters for MAKEINFO. @@ -758,7 +758,7 @@ diff --git a/gdb/configure b/gdb/configure YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. -@@ -6618,6 +6638,494 @@ _ACEOF +@@ -6621,6 +6641,494 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 $as_echo "$with_auto_load_safe_path" >&6; } diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch index 9dfac38..3a95fdb 100644 --- a/gdb-attach-fail-reasons-5of5.patch +++ b/gdb-attach-fail-reasons-5of5.patch @@ -68,7 +68,7 @@ diff --git a/gdb/config.in b/gdb/config.in diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -15841,6 +15841,64 @@ cat >>confdefs.h <<_ACEOF +@@ -15844,6 +15844,64 @@ cat >>confdefs.h <<_ACEOF _ACEOF @@ -173,7 +173,7 @@ diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure -@@ -8564,6 +8564,64 @@ if $want_ipa ; then +@@ -8589,6 +8589,64 @@ if $want_ipa ; then fi fi @@ -241,7 +241,7 @@ diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac -@@ -480,6 +480,10 @@ if $want_ipa ; then +@@ -478,6 +478,10 @@ if $want_ipa ; then fi fi diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch index c19f23e..53f0cf8 100644 --- a/gdb-container-rh-pkg.patch +++ b/gdb-container-rh-pkg.patch @@ -9,7 +9,7 @@ Subject: gdb-container-rh-pkg.patch diff --git a/gdb/remote.c b/gdb/remote.c --- a/gdb/remote.c +++ b/gdb/remote.c -@@ -14004,7 +14004,17 @@ remote_target::pid_to_exec_file (int pid) +@@ -14008,7 +14008,17 @@ remote_target::pid_to_exec_file (int pid) char *annex = NULL; if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch index 6581fde..f06836e 100644 --- a/gdb-fedora-libncursesw.patch +++ b/gdb-fedora-libncursesw.patch @@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1270534 diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -9410,6 +9410,7 @@ if test x"$prefer_curses" = xyes; then +@@ -9413,6 +9413,7 @@ if test x"$prefer_curses" = xyes; then # search /usr/local/include, if ncurses is installed in /usr/local. A # default installation of ncurses on alpha*-dec-osf* will lead to such # a situation. @@ -20,7 +20,7 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 $as_echo_n "checking for library containing waddstr... " >&6; } if ${ac_cv_search_waddstr+:} false; then : -@@ -9434,7 +9435,7 @@ return waddstr (); +@@ -9437,7 +9438,7 @@ return waddstr (); return 0; } _ACEOF @@ -29,7 +29,7 @@ diff --git a/gdb/configure b/gdb/configure if test -z "$ac_lib"; then ac_res="none required" else -@@ -9508,6 +9509,7 @@ case $host_os in +@@ -9511,6 +9512,7 @@ case $host_os in esac # These are the libraries checked by Readline. @@ -37,7 +37,7 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 $as_echo_n "checking for library containing tgetent... " >&6; } if ${ac_cv_search_tgetent+:} false; then : -@@ -9532,7 +9534,7 @@ return tgetent (); +@@ -9535,7 +9537,7 @@ return tgetent (); return 0; } _ACEOF diff --git a/gdb-jit-reader-multilib.patch b/gdb-jit-reader-multilib.patch index 15fa27c..d2f12c3 100644 --- a/gdb-jit-reader-multilib.patch +++ b/gdb-jit-reader-multilib.patch @@ -9,7 +9,7 @@ Subject: gdb-jit-reader-multilib.patch diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -9697,10 +9697,12 @@ _ACEOF +@@ -9700,10 +9700,12 @@ _ACEOF diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch index a96209d..6f62bba 100644 --- a/gdb-linux_perf-bundle.patch +++ b/gdb-linux_perf-bundle.patch @@ -9,7 +9,7 @@ Subject: gdb-linux_perf-bundle.patch diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -12080,7 +12080,7 @@ else +@@ -12083,7 +12083,7 @@ else #include #ifndef PERF_ATTR_SIZE_VER5 diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index e2cf82f..b25df5e 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -2758,7 +2758,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, struct expression *) override; -@@ -10441,7 +10441,7 @@ int remote_hw_watchpoint_length_limit = -1; +@@ -10445,7 +10445,7 @@ int remote_hw_watchpoint_length_limit = -1; int remote_hw_breakpoint_limit = -1; int diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch index a3c1300..2f81843 100644 --- a/gdb-rhbz795424-bitpos-22of25.patch +++ b/gdb-rhbz795424-bitpos-22of25.patch @@ -384,7 +384,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c int can_use_hw_breakpoint (enum bptype, int, int) override; -@@ -10370,7 +10370,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, +@@ -10374,7 +10374,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); @@ -393,7 +393,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); -@@ -10390,7 +10390,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, +@@ -10394,7 +10394,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, bool remote_target::watchpoint_addr_within_range (CORE_ADDR addr, @@ -402,7 +402,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c { CORE_ADDR diff = remote_address_masked (addr - start); -@@ -10419,7 +10419,7 @@ remote_target::remove_watchpoint (CORE_ADDR addr, int len, +@@ -10423,7 +10423,7 @@ remote_target::remove_watchpoint (CORE_ADDR addr, int len, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); diff --git a/gdb.spec b/gdb.spec index cd552de..92a3307 100644 --- a/gdb.spec +++ b/gdb.spec @@ -18,7 +18,7 @@ Name: %{?scl_prefix}gdb # Freeze it when GDB gets branched -%global snapsrc 20181010 +%global snapsrc 20181016 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20161115 %global tarname gdb-%{version} @@ -26,7 +26,7 @@ Version: 8.2.50.%{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: 5%{?dist} +Release: 6%{?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 @@ -693,6 +693,9 @@ cp $RPM_BUILD_DIR/%{gdb_src}/gdb/NEWS $RPM_BUILD_DIR/%{gdb_src} # Initially we're in the %{gdb_src} directory. cd %{gdb_build} +# We always run the unittests. +(cd gdb; make run GDBFLAGS='-batch -ex "maintenance selftest"') + %if 0%{!?_with_testsuite:1} echo ====================TESTSUITE DISABLED========================= %else @@ -1024,6 +1027,10 @@ fi %endif %changelog +* Tue Oct 16 2018 Sergio Durigan Junior - 8.2.50.20181016-6.fc30 +- Rebase to FSF GDB 8.2.50.20181016 (8.3pre). +- Enable and always run the unittests when building the package. + * Wed Oct 10 2018 Sergio Durigan Junior - 8.2.50.20181010-5.fc30 - Rebase to FSF GDB 8.2.50.20181010 (8.3pre). - Remove 'gdb-6.8-sparc64-silence-memcpy-check.patch'. diff --git a/sources b/sources index 2ba807d..33305d6 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz) = a8b1c54dd348cfeb37da73f968742896be3dd13a4215f8d8519870c2abea915f5176c3fa6989ddd10f20020a16f0fab20cbae68ee8d58a82234d8778023520f8 SHA512 (v2.0.tar.gz) = ec63151e842c81cc73ea11ba560b63e005cefbe19d98de24ae5c8caa4de7c9c1d71d1ec5b6214a347592eac675b75a3d2b26d4691ca86f91020ebfea8e912939 -SHA512 (gdb-8.2.50.20181010.tar.xz) = 1c7797e87b87de8cbe948b2bb97613a282f066c8c4a262f25f37ecf7d217bdb8cc84da7e147f81b4ebc00ea2f873ac9440c80f6da822a2df2563e57a2c7b9a83 +SHA512 (gdb-8.2.50.20181016.tar.xz) = ebf7abc93e08121b4a5e40f860e99251ca138b7b79976d92e834c7f13856dbe736fb545f3617dc29e8b73174fe87e69e8f0f93940cab60d938d65107da941a54 From 4336687790cf95b7cfd8e05dd5df70464fd7bc75 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 17 Oct 2018 23:26:03 -0400 Subject: [PATCH 33/35] Use "--enable-unit-tests" flag when compiling GDB. --- gdb.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb.spec b/gdb.spec index 92a3307..d7021c1 100644 --- a/gdb.spec +++ b/gdb.spec @@ -26,7 +26,7 @@ Version: 8.2.50.%{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: 6%{?dist} +Release: 7%{?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 @@ -616,6 +616,7 @@ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \ %else --without-mpfr \ %endif + --enable-unit-tests \ --with-auto-load-dir='$debugdir:$datadir/auto-load%{?scl::%{_root_datadir}/gdb/auto-load}' \ --with-auto-load-safe-path='$debugdir:$datadir/auto-load%{?scl::%{_root_datadir}/gdb/auto-load}' \ %ifarch sparc sparcv9 @@ -1027,6 +1028,9 @@ fi %endif %changelog +* Thu Oct 18 2018 Sergio Durigan Junior - 8.2.50.20181016-7.fc30 +- Use "--enable-unit-tests" flag when compiling GDB. + * Tue Oct 16 2018 Sergio Durigan Junior - 8.2.50.20181016-6.fc30 - Rebase to FSF GDB 8.2.50.20181016 (8.3pre). - Enable and always run the unittests when building the package. From 6ee43aeabb8ab99fcd93162dd6219c350b524d91 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Wed, 14 Nov 2018 16:12:07 -0500 Subject: [PATCH 34/35] Rebase to FSF GDB 8.2.50.20181114 (8.3pre). Drop gdb-6.3-ppc64syscall-20040622.patch. Drop gdb-6.3-ppc64displaysymbol-20041124.patch. Drop gdb-6.8-watchpoint-conditionals-test.patch. --- .gitignore | 2 +- _gdb.spec.Patch.include | 237 +++++++++--------- _gdb.spec.patch.include | 3 - _git_upstream_commit | 2 +- _patch_order | 3 - gdb-6.3-gstack-20050411.patch | 6 +- gdb-6.3-ppc64displaysymbol-20041124.patch | 32 --- gdb-6.3-ppc64syscall-20040622.patch | 118 --------- ...337-resolve-tls-without-debuginfo-v2.patch | 2 +- gdb-6.5-bz216711-clone-is-outermost.patch | 8 +- ...379-solib-trampoline-lookup-lock-fix.patch | 2 +- gdb-6.6-buildid-locate-core-as-arg.patch | 4 +- gdb-6.6-buildid-locate-rpm-scl.patch | 4 +- gdb-6.6-buildid-locate.patch | 16 +- ....6-scheduler_locking-step-is-default.patch | 2 +- gdb-6.8-watchpoint-conditionals-test.patch | 90 ------- gdb-archer.patch | 16 +- gdb-attach-fail-reasons-5of5.patch | 2 +- gdb-bz1219747-attach-kills.patch | 2 +- gdb-bz533176-fortran-omp-step.patch | 4 +- gdb-container-rh-pkg.patch | 2 +- gdb-glibc-strstr-workaround.patch | 2 +- gdb-gnat-dwarf-crash-3of3.patch | 2 +- gdb-rhbz795424-bitpos-20of25.patch | 120 ++++----- gdb-rhbz795424-bitpos-21of25.patch | 2 +- gdb-rhbz795424-bitpos-22of25.patch | 20 +- gdb-rhbz795424-bitpos-23of25.patch | 34 +-- gdb-vla-intel-fortran-strides.patch | 14 +- gdb-vla-intel-fortran-vla-strings.patch | 28 +-- gdb.spec | 10 +- sources | 2 +- 31 files changed, 269 insertions(+), 522 deletions(-) delete mode 100644 gdb-6.3-ppc64displaysymbol-20041124.patch delete mode 100644 gdb-6.3-ppc64syscall-20040622.patch delete mode 100644 gdb-6.8-watchpoint-conditionals-test.patch diff --git a/.gitignore b/.gitignore index a025f9b..9696042 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz /v2.0.tar.gz -/gdb-8.2.50.20181016.tar.xz +/gdb-8.2.50.20181114.tar.xz diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include index 7c221e5..6d7e6ea 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -12,478 +12,465 @@ Patch003: gdb-vla-intel-fortran-vla-strings.patch #=push+jan Patch004: gdb-vla-intel-stringbt-fix.patch -# Better parse 64-bit PPC system call prologues. -#=push: Write new testcase. -Patch005: gdb-6.3-ppc64syscall-20040622.patch - -# Include the pc's section when doing a symbol lookup so that the -# correct symbol is found. -#=push: Write new testcase. -Patch006: gdb-6.3-ppc64displaysymbol-20041124.patch - # Add a wrapper script to GDB that implements pstack using the # --readnever option. #=push -Patch007: gdb-6.3-gstack-20050411.patch +Patch005: gdb-6.3-gstack-20050411.patch # VSYSCALL and PIE #=fedoratest -Patch008: gdb-6.3-test-pie-20050107.patch +Patch006: gdb-6.3-test-pie-20050107.patch # Get selftest working with sep-debug-info #=fedoratest -Patch009: gdb-6.3-test-self-20050110.patch +Patch007: gdb-6.3-test-self-20050110.patch # Test support of multiple destructors just like multiple constructors #=fedoratest -Patch010: gdb-6.3-test-dtorfix-20050121.patch +Patch008: gdb-6.3-test-dtorfix-20050121.patch # Fix to support executable moving #=fedoratest -Patch011: gdb-6.3-test-movedir-20050125.patch +Patch009: gdb-6.3-test-movedir-20050125.patch # Test sibling threads to set threaded watchpoints for x86 and x86-64 #=fedoratest -Patch012: gdb-6.3-threaded-watchpoints2-20050225.patch +Patch010: gdb-6.3-threaded-watchpoints2-20050225.patch # Notify observers that the inferior has been created #=fedoratest -Patch013: gdb-6.3-inferior-notification-20050721.patch +Patch011: gdb-6.3-inferior-notification-20050721.patch # Verify printing of inherited members test #=fedoratest -Patch014: gdb-6.3-inheritancetest-20050726.patch +Patch012: gdb-6.3-inheritancetest-20050726.patch # Add readnever option #=push -Patch015: gdb-6.3-readnever-20050907.patch +Patch013: gdb-6.3-readnever-20050907.patch # Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337). #=push+jan: It should be replaced by Infinity project. -Patch016: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +Patch014: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch # Fix TLS symbols resolving for shared libraries with a relative pathname. # The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'. #=fedoratest: One should recheck if it is really fixed upstream. -Patch017: gdb-6.5-sharedlibrary-path.patch +Patch015: gdb-6.5-sharedlibrary-path.patch # Improved testsuite results by the testsuite provided by the courtesy of BEA. #=fedoratest: For upstream it should be rewritten as a dejagnu test, the test of no "??" was useful. -Patch018: gdb-6.5-BEA-testsuite.patch +Patch016: gdb-6.5-BEA-testsuite.patch # Testcase for deadlocking on last address space byte; for corrupted backtraces. #=fedoratest -Patch019: gdb-6.5-last-address-space-byte-test.patch +Patch017: gdb-6.5-last-address-space-byte-test.patch # Fix readline segfault on excessively long hand-typed lines. #=fedoratest -Patch020: gdb-6.5-readline-long-line-crash-test.patch +Patch018: gdb-6.5-readline-long-line-crash-test.patch # Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711). #=fedora -Patch021: gdb-6.5-bz216711-clone-is-outermost.patch +Patch019: gdb-6.5-bz216711-clone-is-outermost.patch # Test sideeffects of skipping ppc .so libs trampolines (BZ 218379). #=fedoratest -Patch022: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +Patch020: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch # Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379). #=fedora -Patch023: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +Patch021: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch # Find symbols properly at their original (included) file (BZ 109921). #=fedoratest -Patch024: gdb-6.5-bz109921-DW_AT_decl_file-test.patch +Patch022: gdb-6.5-bz109921-DW_AT_decl_file-test.patch # Update PPC unwinding patches to their upstream variants (BZ 140532). #=fedoratest -Patch025: gdb-6.3-bz140532-ppc-unwinding-test.patch +Patch023: gdb-6.3-bz140532-ppc-unwinding-test.patch # Testcase for exec() from threaded program (BZ 202689). #=fedoratest -Patch026: gdb-6.3-bz202689-exec-from-pthread-test.patch +Patch024: gdb-6.3-bz202689-exec-from-pthread-test.patch # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). #=fedoratest -Patch027: gdb-6.6-bz230000-power6-disassembly-test.patch +Patch025: gdb-6.6-bz230000-power6-disassembly-test.patch # Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517). #=fedoratest -Patch028: gdb-6.6-bz229517-gcore-without-terminal.patch +Patch026: gdb-6.6-bz229517-gcore-without-terminal.patch # Avoid too long timeouts on failing cases of "annota1.exp annota3.exp". #=fedoratest -Patch029: gdb-6.6-testsuite-timeouts.patch +Patch027: gdb-6.6-testsuite-timeouts.patch # Support for stepping over PPC atomic instruction sequences (BZ 237572). #=fedoratest -Patch030: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch028: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch # Make upstream `set scheduler-locking step' as default. #=push+jan: How much is scheduler-locking relevant after non-stop? -Patch031: gdb-6.6-scheduler_locking-step-is-default.patch +Patch029: gdb-6.6-scheduler_locking-step-is-default.patch # Test kernel VDSO decoding while attaching to an i386 process. #=fedoratest -Patch032: gdb-6.3-attach-see-vdso-test.patch +Patch030: gdb-6.3-attach-see-vdso-test.patch # Test leftover zombie process (BZ 243845). #=fedoratest -Patch033: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch031: gdb-6.5-bz243845-stale-testing-zombie-test.patch # New locating of the matching binaries from the pure core file (build-id). #=push+jan -Patch034: gdb-6.6-buildid-locate.patch +Patch032: gdb-6.6-buildid-locate.patch # Fix loading of core files without build-ids but with build-ids in executables. # Load strictly build-id-checked core files only if no executable is specified # (Jan Kratochvil, RH BZ 1339862). #=push+jan -Patch035: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch033: gdb-6.6-buildid-locate-solib-missing-ids.patch #=push+jan -Patch036: gdb-6.6-buildid-locate-rpm.patch +Patch034: gdb-6.6-buildid-locate-rpm.patch # Fix displaying of numeric char arrays as strings (BZ 224128). #=fedoratest: But it is failing anyway, one should check the behavior more. -Patch037: gdb-6.7-charsign-test.patch +Patch035: gdb-6.7-charsign-test.patch # Test PPC hiding of call-volatile parameter register. #=fedoratest -Patch038: gdb-6.7-ppc-clobbered-registers-O2-test.patch +Patch036: gdb-6.7-ppc-clobbered-registers-O2-test.patch # Testsuite fixes for more stable/comparable results. #=fedoratest -Patch039: gdb-6.7-testsuite-stable-results.patch +Patch037: gdb-6.7-testsuite-stable-results.patch # Test ia64 memory leaks of the code using libunwind. #=fedoratest -Patch040: gdb-6.5-ia64-libunwind-leak-test.patch +Patch038: gdb-6.5-ia64-libunwind-leak-test.patch # Test hiding unexpected breakpoints on intentional step commands. #=fedoratest -Patch041: gdb-6.5-missed-trap-on-step-test.patch +Patch039: gdb-6.5-missed-trap-on-step-test.patch # Test gcore memory and time requirements for large inferiors. #=fedoratest -Patch042: gdb-6.5-gcore-buffer-limit-test.patch +Patch040: gdb-6.5-gcore-buffer-limit-test.patch # Test GCORE for shmid 0 shared memory mappings. #=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible. -Patch043: gdb-6.3-mapping-zero-inode-test.patch +Patch041: gdb-6.3-mapping-zero-inode-test.patch # Test a crash on `focus cmd', `focus prev' commands. #=fedoratest -Patch044: gdb-6.3-focus-cmd-prev-test.patch +Patch042: gdb-6.3-focus-cmd-prev-test.patch # Test various forms of threads tracking across exec() (BZ 442765). #=fedoratest -Patch045: gdb-6.8-bz442765-threaded-exec-test.patch +Patch043: gdb-6.8-bz442765-threaded-exec-test.patch # Test a crash on libraries missing the .text section. #=fedoratest -Patch046: gdb-6.5-section-num-fixup-test.patch +Patch044: gdb-6.5-section-num-fixup-test.patch # Fix register assignments with no GDB stack frames (BZ 436037). #=push+jan: This fix is incorrect. -Patch047: gdb-6.8-bz436037-reg-no-longer-active.patch - -# Test the watchpoints conditionals works. -#=fedoratest -Patch048: gdb-6.8-watchpoint-conditionals-test.patch +Patch045: gdb-6.8-bz436037-reg-no-longer-active.patch # Fix resolving of variables at locations lists in prelinked libs (BZ 466901). #=fedoratest -Patch049: gdb-6.8-bz466901-backtrace-full-prelinked.patch +Patch046: gdb-6.8-bz466901-backtrace-full-prelinked.patch # New test for step-resume breakpoint placed in multiple threads at once. #=fedoratest -Patch050: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch047: gdb-simultaneous-step-resume-breakpoint-test.patch # Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. # Fix regression of undisplayed missing shared libraries caused by a fix for. #=fedoratest: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*> -Patch051: gdb-core-open-vdso-warning.patch +Patch048: gdb-core-open-vdso-warning.patch # Fix syscall restarts for amd64->i386 biarch. #=push+jan -Patch052: gdb-x86_64-i386-syscall-restart.patch +Patch049: gdb-x86_64-i386-syscall-restart.patch # Fix stepping with OMP parallel Fortran sections (BZ 533176). #=push+jan: It requires some better DWARF annotations. -Patch053: gdb-bz533176-fortran-omp-step.patch +Patch050: gdb-bz533176-fortran-omp-step.patch # Fix regression by python on ia64 due to stale current frame. #=push+jan -Patch054: gdb-follow-child-stale-parent.patch +Patch051: gdb-follow-child-stale-parent.patch # Workaround ccache making lineno non-zero for command-line definitions. #=fedoratest: ccache is rarely used and it is even fixed now. -Patch055: gdb-ccache-workaround.patch +Patch052: gdb-ccache-workaround.patch #=push+jan: May get obsoleted by Tom's unrelocated objfiles patch. -Patch056: gdb-archer-pie-addons.patch +Patch053: gdb-archer-pie-addons.patch #=push+jan: Breakpoints disabling matching should not be based on address. -Patch057: gdb-archer-pie-addons-keep-disabled.patch +Patch054: gdb-archer-pie-addons-keep-disabled.patch # Testcase for "Do not make up line information" fix by Daniel Jacobowitz. #=fedoratest -Patch058: gdb-lineno-makeup-test.patch +Patch055: gdb-lineno-makeup-test.patch # Test power7 ppc disassembly. #=fedoratest -Patch059: gdb-ppc-power7-test.patch +Patch056: gdb-ppc-power7-test.patch # Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866). # Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866). #=push+jan: It should be fixed properly instead. -Patch060: gdb-bz541866-rwatch-before-run.patch +Patch057: gdb-bz541866-rwatch-before-run.patch # Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623). #=push+jan: Currently it is still not fully safe. -Patch061: gdb-moribund-utrace-workaround.patch +Patch058: gdb-moribund-utrace-workaround.patch # Fix follow-exec for C++ programs (bugreported by Martin Stransky). #=fedoratest -Patch062: gdb-archer-next-over-throw-cxx-exec.patch +Patch059: gdb-archer-next-over-throw-cxx-exec.patch # Backport DWARF-4 support (BZ 601887, Tom Tromey). #=fedoratest -Patch063: gdb-bz601887-dwarf4-rh-test.patch +Patch060: gdb-bz601887-dwarf4-rh-test.patch #=push+jan -Patch064: gdb-6.6-buildid-locate-core-as-arg.patch +Patch061: gdb-6.6-buildid-locate-core-as-arg.patch # Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). #=push+jan -Patch065: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +Patch062: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch # [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604). #=fedoratest -Patch066: gdb-test-bt-cfi-without-die.patch +Patch063: gdb-test-bt-cfi-without-die.patch # Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248). #=push+jan: Inferior objects should be read in parts, then this patch gets obsoleted. -Patch067: gdb-bz568248-oom-is-error.patch +Patch064: gdb-bz568248-oom-is-error.patch # Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). #=fedoratest -Patch068: gdb-bz634108-solib_address.patch +Patch065: gdb-bz634108-solib_address.patch # New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435). #=fedoratest -Patch069: gdb-test-pid0-core.patch +Patch066: gdb-test-pid0-core.patch # [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp. #=fedoratest -Patch070: gdb-test-dw2-aranges.patch +Patch067: gdb-test-dw2-aranges.patch # [archer-keiths-expr-cumulative+upstream] Import C++ testcases. #=fedoratest -Patch071: gdb-test-expr-cumulative-archer.patch +Patch068: gdb-test-expr-cumulative-archer.patch # Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). #=fedoratest -Patch072: gdb-physname-pr11734-test.patch +Patch069: gdb-physname-pr11734-test.patch # Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). #=fedoratest -Patch073: gdb-physname-pr12273-test.patch +Patch070: gdb-physname-pr12273-test.patch # Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890). #=fedoratest -Patch074: gdb-test-ivy-bridge.patch +Patch071: gdb-test-ivy-bridge.patch # Hack for proper PIE run of the testsuite. #=fedoratest -Patch075: gdb-runtest-pie-override.patch +Patch072: gdb-runtest-pie-override.patch # Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878). #=push+jan -Patch076: gdb-attach-fail-reasons-5of5.patch +Patch073: gdb-attach-fail-reasons-5of5.patch # Workaround PR libc/14166 for inferior calls of strstr. #=fedora: Compatibility with RHELs (unchecked which ones). -Patch077: gdb-glibc-strstr-workaround.patch +Patch074: gdb-glibc-strstr-workaround.patch # Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789). #=fedoratest -Patch078: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +Patch075: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch # Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343). #=fedoratest -Patch079: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch076: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch080: gdb-rhbz795424-bitpos-20of25.patch +Patch077: gdb-rhbz795424-bitpos-20of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch081: gdb-rhbz795424-bitpos-21of25.patch +Patch078: gdb-rhbz795424-bitpos-21of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch082: gdb-rhbz795424-bitpos-22of25.patch +Patch079: gdb-rhbz795424-bitpos-22of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch083: gdb-rhbz795424-bitpos-23of25.patch +Patch080: gdb-rhbz795424-bitpos-23of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch084: gdb-rhbz795424-bitpos-25of25.patch +Patch081: gdb-rhbz795424-bitpos-25of25.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch085: gdb-rhbz795424-bitpos-25of25-test.patch +Patch082: gdb-rhbz795424-bitpos-25of25-test.patch # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). #=push -Patch086: gdb-rhbz795424-bitpos-lazyvalue.patch +Patch083: gdb-rhbz795424-bitpos-lazyvalue.patch # Import regression test for `gdb/findvar.c:417: internal-error: # read_var_value: Assertion `frame' failed.' (RH BZ 947564) from RHEL 6.5. #=fedoratest -Patch087: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch084: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch # Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211). #=push+jan -Patch088: gdb-gnat-dwarf-crash-3of3.patch +Patch085: gdb-gnat-dwarf-crash-3of3.patch # Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614) #=fedoratest -Patch089: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch086: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch # Fix 'gdb gives highly misleading error when debuginfo pkg is present, # but not corresponding binary pkg' (RH BZ 981154). #=push+jan -Patch090: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +Patch087: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch #=fedoratest -Patch091: gdb-archer-vla-tests.patch +Patch088: gdb-archer-vla-tests.patch #=fedoratest -Patch092: gdb-vla-intel-tests.patch +Patch089: gdb-vla-intel-tests.patch # Continue backtrace even if a frame filter throws an exception (Phil Muldoon). #=push -Patch093: gdb-btrobust.patch +Patch090: gdb-btrobust.patch # Display Fortran strings in backtraces. #=fedoratest -Patch094: gdb-fortran-frame-string.patch +Patch091: gdb-fortran-frame-string.patch # Fix Python GIL with gdb.execute("continue") (Phil Muldoon, BZ 1116957). #=push -Patch095: gdb-python-gil.patch +Patch092: gdb-python-gil.patch # Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to # crash.' (RH BZ 1156192). #=fedoratest -Patch096: gdb-rhbz1156192-recursive-dlopen-test.patch +Patch093: gdb-rhbz1156192-recursive-dlopen-test.patch # Fix jit-reader.h for multi-lib. #=push+jan -Patch097: gdb-jit-reader-multilib.patch +Patch094: gdb-jit-reader-multilib.patch # Fix '`catch syscall' doesn't work for parent after `fork' is called' # (Philippe Waroquiers, RH BZ 1149205). #=fedoratest -Patch098: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch095: gdb-rhbz1149205-catch-syscall-after-fork-test.patch # Fix 'backport GDB 7.4 fix to RHEL 6.6 GDB' [Original Sourceware bug # description: 'C++ (and objc): Internal error on unqualified name # re-set', PR 11657] (RH BZ 1186476). #=fedoratest -Patch099: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch +Patch096: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch # Test 'info type-printers' Python error (RH BZ 1350436). #=fedoratest -Patch100: gdb-rhbz1350436-type-printers-error.patch +Patch097: gdb-rhbz1350436-type-printers-error.patch # Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan # Kratochvil, RH BZ 1084404). #=fedoratest -Patch101: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch098: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch # Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747). #=push+jan -Patch102: gdb-bz1219747-attach-kills.patch +Patch099: gdb-bz1219747-attach-kills.patch # Force libncursesw over libncurses to match the includes (RH BZ 1270534). #=push+jan -Patch103: gdb-fedora-libncursesw.patch +Patch100: gdb-fedora-libncursesw.patch # Test clflushopt instruction decode (for RH BZ 1262471). #=fedoratest -Patch104: gdb-opcodes-clflushopt-test.patch +Patch101: gdb-opcodes-clflushopt-test.patch # [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon). #=fedora -Patch105: gdb-dts-rhel6-python-compat.patch +Patch102: gdb-dts-rhel6-python-compat.patch # [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585). #=push+jan -Patch106: gdb-6.6-buildid-locate-rpm-scl.patch +Patch103: gdb-6.6-buildid-locate-rpm-scl.patch # Work around readline-6.2 incompatibility not asking for --more-- (BZ 701131). #=fedora -Patch107: gdb-readline62-ask-more-rh.patch +Patch104: gdb-readline62-ask-more-rh.patch # Make the GDB quit processing non-abortable to cleanup everything properly. #=fedora: It was useful only after gdb-6.8-attach-signalled-detach-stopped.patch . -Patch108: gdb-6.8-quit-never-aborts.patch +Patch105: gdb-6.8-quit-never-aborts.patch # [aarch64] Fix hardware watchpoints (RH BZ 1261564). #=fedoratest -Patch109: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch106: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch # Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114). #=fedora -Patch110: gdb-container-rh-pkg.patch +Patch107: gdb-container-rh-pkg.patch # New test for Python "Cannot locate object file for block" (for RH BZ 1325795). #=fedoratest -Patch111: gdb-rhbz1325795-framefilters-test.patch +Patch108: gdb-rhbz1325795-framefilters-test.patch # [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). #=fedora -Patch112: gdb-linux_perf-bundle.patch +Patch109: gdb-linux_perf-bundle.patch # Fix gdb-headless /usr/bin/ executables (BZ 1390251). #=fedora -Patch113: gdb-libexec-add-index.patch +Patch110: gdb-libexec-add-index.patch # New testcase for: Fix -completion crash (Gary Benson, RH BZ 1398387). #=fedoratest -Patch114: gdb-rhbz1398387-tab-crash-test.patch +Patch111: gdb-rhbz1398387-tab-crash-test.patch # [testsuite] Fix false selftest.exp FAIL from system readline-6.3+ (Patrick Palka). #=fedoratest -Patch115: gdb-testsuite-readline63-sigint.patch +Patch112: gdb-testsuite-readline63-sigint.patch # Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher #=push -Patch116: gdb-archer.patch +Patch113: gdb-archer.patch # Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd -Patch117: gdb-vla-intel-fix-print-char-array.patch +Patch114: gdb-vla-intel-fix-print-char-array.patch # [s390x] Backport arch12 instructions decoding (RH BZ 1553104). # =fedoratest -Patch118: gdb-rhbz1553104-s390x-arch12-test.patch +Patch115: gdb-rhbz1553104-s390x-arch12-test.patch # This patch is needed to compile GDB after -Werror=narrowing has # been enabled by default. # Author: Sergio Durigan Junior. -Patch119: gdb-rhbz795424-bitpos-arrayview.patch +Patch116: gdb-rhbz795424-bitpos-arrayview.patch diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include index 235c823..f0da001 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -114,6 +114,3 @@ %patch114 -p1 %patch115 -p1 %patch116 -p1 -%patch117 -p1 -%patch118 -p1 -%patch119 -p1 diff --git a/_git_upstream_commit b/_git_upstream_commit index ae7c651..ad75dd2 100644 --- a/_git_upstream_commit +++ b/_git_upstream_commit @@ -1 +1 @@ -d53eec4ef86cf85841ceaec7db99753827f2beee +dd9168931facd539a585b88d7b7c6c04c8c065c2 diff --git a/_patch_order b/_patch_order index f8b45dd..b59f1cf 100644 --- a/_patch_order +++ b/_patch_order @@ -2,8 +2,6 @@ gdb-6.3-rh-testversion-20041202.patch gdb-vla-intel-fortran-strides.patch gdb-vla-intel-fortran-vla-strings.patch gdb-vla-intel-stringbt-fix.patch -gdb-6.3-ppc64syscall-20040622.patch -gdb-6.3-ppc64displaysymbol-20041124.patch gdb-6.3-gstack-20050411.patch gdb-6.3-test-pie-20050107.patch gdb-6.3-test-self-20050110.patch @@ -45,7 +43,6 @@ gdb-6.3-focus-cmd-prev-test.patch gdb-6.8-bz442765-threaded-exec-test.patch gdb-6.5-section-num-fixup-test.patch gdb-6.8-bz436037-reg-no-longer-active.patch -gdb-6.8-watchpoint-conditionals-test.patch gdb-6.8-bz466901-backtrace-full-prelinked.patch gdb-simultaneous-step-resume-breakpoint-test.patch gdb-core-open-vdso-warning.patch diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 91eaed9..5dcd0b8 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -1734,7 +1734,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force +@@ -1739,7 +1739,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force install: all @$(MAKE) $(FLAGS_TO_PASS) install-only @@ -25,7 +25,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -1783,7 +1783,25 @@ install-guile: +@@ -1788,7 +1788,25 @@ install-guile: install-python: $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb @@ -52,7 +52,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ -@@ -1806,6 +1824,18 @@ uninstall: force $(CONFIG_UNINSTALL) +@@ -1811,6 +1829,18 @@ uninstall: force $(CONFIG_UNINSTALL) fi @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do diff --git a/gdb-6.3-ppc64displaysymbol-20041124.patch b/gdb-6.3-ppc64displaysymbol-20041124.patch deleted file mode 100644 index a09b0fe..0000000 --- a/gdb-6.3-ppc64displaysymbol-20041124.patch +++ /dev/null @@ -1,32 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Cagney -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-ppc64displaysymbol-20041124.patch - -;; Include the pc's section when doing a symbol lookup so that the -;; correct symbol is found. -;;=push: Write new testcase. - -2004-11-24 Andrew Cagney - - * printcmd.c (build_address_symbolic): Find a section for the - address. - -diff --git a/gdb/printcmd.c b/gdb/printcmd.c ---- a/gdb/printcmd.c -+++ b/gdb/printcmd.c -@@ -587,6 +587,14 @@ build_address_symbolic (struct gdbarch *gdbarch, - addr = overlay_mapped_address (addr, section); - } - } -+ /* To ensure that the symbol returned belongs to the correct setion -+ (and that the last [random] symbol from the previous section -+ isn't returned) try to find the section containing PC. First try -+ the overlay code (which by default returns NULL); and second try -+ the normal section code (which almost always succeeds). */ -+ section = find_pc_overlay (addr); -+ if (section == NULL) -+ section = find_pc_section (addr); - - /* First try to find the address in the symbol table, then - in the minsyms. Take the closest one. */ diff --git a/gdb-6.3-ppc64syscall-20040622.patch b/gdb-6.3-ppc64syscall-20040622.patch deleted file mode 100644 index e6319be..0000000 --- a/gdb-6.3-ppc64syscall-20040622.patch +++ /dev/null @@ -1,118 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Cagney -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-ppc64syscall-20040622.patch - -;; Better parse 64-bit PPC system call prologues. -;;=push: Write new testcase. - -2004-06-22 Andrew Cagney - - * rs6000-tdep.c (struct rs6000_framedata): Add field "func_start". - (skip_prologue): Delete local variable "orig_pc", use - "func_start". Add local variable "num_skip_linux_syscall_insn", - use to skip over first half of a GNU/Linux syscall and update - "func_start". - -diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c ---- a/gdb/rs6000-tdep.c -+++ b/gdb/rs6000-tdep.c -@@ -134,6 +134,7 @@ static const char *powerpc_vector_abi_string = "auto"; - - struct rs6000_framedata - { -+ CORE_ADDR func_start; /* True function start. */ - int offset; /* total size of frame --- the distance - by which we decrement sp to allocate - the frame */ -@@ -1426,7 +1427,6 @@ static CORE_ADDR - skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, - struct rs6000_framedata *fdata) - { -- CORE_ADDR orig_pc = pc; - CORE_ADDR last_prologue_pc = pc; - CORE_ADDR li_found_pc = 0; - gdb_byte buf[4]; -@@ -1445,12 +1445,14 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, - int minimal_toc_loaded = 0; - int prev_insn_was_prologue_insn = 1; - int num_skip_non_prologue_insns = 0; -+ int num_skip_ppc64_gnu_linux_syscall_insn = 0; - int r0_contains_arg = 0; - const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (gdbarch); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - - memset (fdata, 0, sizeof (struct rs6000_framedata)); -+ fdata->func_start = pc; - fdata->saved_gpr = -1; - fdata->saved_fpr = -1; - fdata->saved_vr = -1; -@@ -1484,6 +1486,55 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, - break; - op = extract_unsigned_integer (buf, 4, byte_order); - -+ /* A PPC64 GNU/Linux system call function is split into two -+ sub-functions: a non-threaded fast-path (__NAME_nocancel) -+ which does not use a frame; and a threaded slow-path -+ (Lpseudo_cancel) that does create a frame. Ref: -+ nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h -+ -+ *INDENT-OFF* -+ NAME: -+ SINGLE_THREAD_P -+ bne- .Lpseudo_cancel -+ __NAME_nocancel: -+ li r0,162 -+ sc -+ bnslr+ -+ b 0x7fe014ef64 <.__syscall_error> -+ Lpseudo_cancel: -+ stdu r1,-128(r1) -+ ... -+ *INDENT-ON* -+ -+ Unfortunatly, because the latter case uses a local label (not -+ in the symbol table) a PC in "Lpseudo_cancel" appears to be -+ in "__NAME_nocancel". The following code recognizes this, -+ adjusting FUNC_START to point to where "Lpseudo_cancel" -+ should be, and parsing the prologue sequence as if -+ "Lpseudo_cancel" was the entry point. */ -+ -+ if (((op & 0xffff0000) == 0x38000000 /* li r0,N */ -+ && pc == fdata->func_start + 0 -+ && num_skip_ppc64_gnu_linux_syscall_insn == 0) -+ || (op == 0x44000002 /* sc */ -+ && pc == fdata->func_start + 4 -+ && num_skip_ppc64_gnu_linux_syscall_insn == 1) -+ || (op == 0x4ca30020 /* bnslr+ */ -+ && pc == fdata->func_start + 8 -+ && num_skip_ppc64_gnu_linux_syscall_insn == 2)) -+ { -+ num_skip_ppc64_gnu_linux_syscall_insn++; -+ continue; -+ } -+ else if ((op & 0xfc000003) == 0x48000000 /* b __syscall_error */ -+ && pc == fdata->func_start + 12 -+ && num_skip_ppc64_gnu_linux_syscall_insn == 3) -+ { -+ num_skip_ppc64_gnu_linux_syscall_insn = -1; -+ fdata->func_start = pc; -+ continue; -+ } -+ - if ((op & 0xfc1fffff) == 0x7c0802a6) - { /* mflr Rx */ - /* Since shared library / PIC code, which needs to get its -@@ -1673,9 +1724,9 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, - we have no line table information or the line info tells - us that the subroutine call is not part of the line - associated with the prologue. */ -- if ((pc - orig_pc) > 8) -+ if ((pc - fdata->func_start) > 8) - { -- struct symtab_and_line prologue_sal = find_pc_line (orig_pc, 0); -+ struct symtab_and_line prologue_sal = find_pc_line (fdata->func_start, 0); - struct symtab_and_line this_sal = find_pc_line (pc, 0); - - if ((prologue_sal.line == 0) diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch index fbeb88c..3a1fe0c 100644 --- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch @@ -44,7 +44,7 @@ glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug: diff --git a/gdb/printcmd.c b/gdb/printcmd.c --- a/gdb/printcmd.c +++ b/gdb/printcmd.c -@@ -1190,6 +1190,10 @@ print_command_1 (const char *exp, int voidprint) +@@ -1182,6 +1182,10 @@ print_command_1 (const char *exp, int voidprint) if (exp && *exp) { diff --git a/gdb-6.5-bz216711-clone-is-outermost.patch b/gdb-6.5-bz216711-clone-is-outermost.patch index f11df0a..81cb290 100644 --- a/gdb-6.5-bz216711-clone-is-outermost.patch +++ b/gdb-6.5-bz216711-clone-is-outermost.patch @@ -127,7 +127,7 @@ diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c -@@ -2595,6 +2595,7 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame, +@@ -2600,6 +2600,7 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame, { struct amd64_frame_cache *cache = amd64_frame_cache (this_frame, this_cache); @@ -135,7 +135,7 @@ diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c if (!cache->base_p) return UNWIND_UNAVAILABLE; -@@ -2603,6 +2604,10 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame, +@@ -2608,6 +2609,10 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame, if (cache->base == 0) return UNWIND_OUTERMOST; @@ -146,7 +146,7 @@ diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c return UNWIND_NO_REASON; } -@@ -2737,6 +2742,7 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame, +@@ -2742,6 +2747,7 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame, { struct amd64_frame_cache *cache = amd64_sigtramp_frame_cache (this_frame, this_cache); @@ -154,7 +154,7 @@ diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c if (!cache->base_p) (*this_id) = frame_id_build_unavailable_stack (get_frame_pc (this_frame)); -@@ -2745,6 +2751,11 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame, +@@ -2750,6 +2756,11 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame, /* This marks the outermost frame. */ return; } diff --git a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch index 20577ed..1cc4eec 100644 --- a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +++ b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch @@ -11,7 +11,7 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379 diff --git a/gdb/symtab.c b/gdb/symtab.c --- a/gdb/symtab.c +++ b/gdb/symtab.c -@@ -3166,6 +3166,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) +@@ -3167,6 +3167,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) SYMBOL_LINKAGE_NAME (msymbol)); */ ; /* fall through */ diff --git a/gdb-6.6-buildid-locate-core-as-arg.patch b/gdb-6.6-buildid-locate-core-as-arg.patch index 5876a47..f1bd504 100644 --- a/gdb-6.6-buildid-locate-core-as-arg.patch +++ b/gdb-6.6-buildid-locate-core-as-arg.patch @@ -155,7 +155,7 @@ diff --git a/gdb/main.c b/gdb/main.c static void captured_main_1 (struct captured_main_args *context) { -@@ -884,6 +913,8 @@ captured_main_1 (struct captured_main_args *context) +@@ -888,6 +917,8 @@ captured_main_1 (struct captured_main_args *context) { symarg = argv[optind]; execarg = argv[optind]; @@ -164,7 +164,7 @@ diff --git a/gdb/main.c b/gdb/main.c optind++; } -@@ -1034,12 +1065,25 @@ captured_main_1 (struct captured_main_args *context) +@@ -1038,12 +1069,25 @@ captured_main_1 (struct captured_main_args *context) && symarg != NULL && strcmp (execarg, symarg) == 0) { diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch index 612cdc0..3a1ad85 100644 --- a/gdb-6.6-buildid-locate-rpm-scl.patch +++ b/gdb-6.6-buildid-locate-rpm-scl.patch @@ -99,7 +99,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -3468,6 +3468,16 @@ read_gdb_index_from_buffer (struct objfile *objfile, +@@ -3469,6 +3469,16 @@ read_gdb_index_from_buffer (struct objfile *objfile, "set use-deprecated-index-sections on". */ if (version < 6 && !deprecated_ok) { @@ -116,7 +116,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c static int warning_printed = 0; if (!warning_printed) { -@@ -3479,6 +3489,10 @@ to use the section anyway."), +@@ -3480,6 +3490,10 @@ to use the section anyway."), warning_printed = 1; } return 0; diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 28c0637..45621df 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -977,7 +977,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -19835,6 +19835,27 @@ information files. +@@ -19937,6 +19937,27 @@ information files. @end table @@ -1008,7 +1008,7 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c --- a/gdb/dwarf-index-cache.c +++ b/gdb/dwarf-index-cache.c -@@ -140,7 +140,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile) +@@ -93,7 +93,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile) if (!enabled ()) return; @@ -1020,7 +1020,7 @@ diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -2694,7 +2694,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile) +@@ -2695,7 +2695,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile) } if (dwz_bfd == NULL) @@ -1029,7 +1029,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (dwz_bfd == NULL) error (_("could not find '.gnu_debugaltlink' file for %s"), -@@ -6198,7 +6198,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) +@@ -6199,7 +6199,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) static gdb::array_view get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) { @@ -1038,7 +1038,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (build_id == nullptr) return {}; -@@ -6211,7 +6211,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) +@@ -6212,7 +6212,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) static gdb::array_view get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz) { @@ -1089,7 +1089,7 @@ diff --git a/gdb/objfiles.h b/gdb/objfiles.h diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c --- a/gdb/python/py-objfile.c +++ b/gdb/python/py-objfile.c -@@ -132,7 +132,7 @@ objfpy_get_build_id (PyObject *self, void *closure) +@@ -133,7 +133,7 @@ objfpy_get_build_id (PyObject *self, void *closure) TRY { @@ -1098,7 +1098,7 @@ diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c } CATCH (except, RETURN_MASK_ALL) { -@@ -549,7 +549,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id) +@@ -550,7 +550,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id) /* Don't return separate debug files. */ if (objfile->separate_debug_objfile_backlink != NULL) continue; @@ -1238,7 +1238,7 @@ diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp -@@ -1695,6 +1695,16 @@ proc default_gdb_start { } { +@@ -1706,6 +1706,16 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } } diff --git a/gdb-6.6-scheduler_locking-step-is-default.patch b/gdb-6.6-scheduler_locking-step-is-default.patch index ebc4aa6..350c81f 100644 --- a/gdb-6.6-scheduler_locking-step-is-default.patch +++ b/gdb-6.6-scheduler_locking-step-is-default.patch @@ -9,7 +9,7 @@ Subject: gdb-6.6-scheduler_locking-step-is-default.patch diff --git a/gdb/infrun.c b/gdb/infrun.c --- a/gdb/infrun.c +++ b/gdb/infrun.c -@@ -2193,7 +2193,7 @@ static const char *const scheduler_enums[] = { +@@ -2195,7 +2195,7 @@ static const char *const scheduler_enums[] = { schedlock_replay, NULL }; diff --git a/gdb-6.8-watchpoint-conditionals-test.patch b/gdb-6.8-watchpoint-conditionals-test.patch deleted file mode 100644 index 5096a67..0000000 --- a/gdb-6.8-watchpoint-conditionals-test.patch +++ /dev/null @@ -1,90 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.8-watchpoint-conditionals-test.patch - -;; Test the watchpoints conditionals works. -;;=fedoratest - -For: -http://sourceware.org/ml/gdb-patches/2008-04/msg00379.html -http://sourceware.org/ml/gdb-cvs/2008-04/msg00104.html - -diff --git a/gdb/testsuite/gdb.base/watchpoint-cond.c b/gdb/testsuite/gdb.base/watchpoint-cond.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/watchpoint-cond.c -@@ -0,0 +1,31 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 Free Software Foundation, Inc. -+ -+ 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 3 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 . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@prep.ai.mit.edu */ -+ -+int -+main (int argc, char **argv) -+{ -+ static int i = 0; /* `static' to start initialized. */ -+ int j = 2; -+ -+ for (j = 0; j < 30; j++) -+ i = 30 - j; -+ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/watchpoint-cond.exp b/gdb/testsuite/gdb.base/watchpoint-cond.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/watchpoint-cond.exp -@@ -0,0 +1,37 @@ -+# Copyright 2008 Free Software Foundation, Inc. -+ -+# 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 3 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 . -+ -+set testfile watchpoint-cond -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+# Get things started. -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+if { [runto_main] < 0 } { -+ untested watchpoint-cond -+ return -1 -+} -+ -+gdb_test "watch i if i < 20" "atchpoint \[0-9\]+: i" -+gdb_test "cont" "atchpoint \[0-9\]+: i.*Old value = 20.*New value = 19.*" diff --git a/gdb-archer.patch b/gdb-archer.patch index 8c2a432..e904476 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -17,7 +17,7 @@ tromey/python diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -2094,6 +2094,12 @@ stamp-h: $(srcdir)/config.in config.status +@@ -2099,6 +2099,12 @@ stamp-h: $(srcdir)/config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -121,7 +121,7 @@ diff --git a/gdb/main.c b/gdb/main.c { int argc = context->argc; char **argv = context->argv; -@@ -694,10 +695,14 @@ captured_main_1 (struct captured_main_args *context) +@@ -698,10 +699,14 @@ captured_main_1 (struct captured_main_args *context) {"args", no_argument, &set_args, 1}, {"l", required_argument, 0, 'l'}, {"return-child-result", no_argument, &return_child_result, 1}, @@ -137,7 +137,7 @@ diff --git a/gdb/main.c b/gdb/main.c { int option_index; -@@ -715,6 +720,9 @@ captured_main_1 (struct captured_main_args *context) +@@ -719,6 +724,9 @@ captured_main_1 (struct captured_main_args *context) case 0: /* Long option that just sets a flag. */ break; @@ -147,7 +147,7 @@ diff --git a/gdb/main.c b/gdb/main.c case OPT_SE: symarg = optarg; execarg = optarg; -@@ -889,7 +897,31 @@ captured_main_1 (struct captured_main_args *context) +@@ -893,7 +901,31 @@ captured_main_1 (struct captured_main_args *context) /* Now that gdb_init has created the initial inferior, we're in position to set args for that inferior. */ @@ -180,7 +180,7 @@ diff --git a/gdb/main.c b/gdb/main.c { /* The remaining options are the command-line options for the inferior. The first one is the sym/exec file, and the rest -@@ -1190,7 +1222,8 @@ captured_main_1 (struct captured_main_args *context) +@@ -1194,7 +1226,8 @@ captured_main_1 (struct captured_main_args *context) /* Read in the old history after all the command files have been read. */ @@ -190,7 +190,7 @@ diff --git a/gdb/main.c b/gdb/main.c if (batch_flag) { -@@ -1206,24 +1239,37 @@ static void +@@ -1210,24 +1243,37 @@ static void captured_main (void *data) { struct captured_main_args *context = (struct captured_main_args *) data; @@ -241,7 +241,7 @@ diff --git a/gdb/main.c b/gdb/main.c } /* No exit -- exit is through quit_command. */ } -@@ -1266,6 +1312,12 @@ print_gdb_help (struct ui_file *stream) +@@ -1270,6 +1316,12 @@ print_gdb_help (struct ui_file *stream) fputs_unfiltered (_("\ This is the GNU debugger. Usage:\n\n\ gdb [options] [executable-file [core-file or process-id]]\n\ @@ -254,7 +254,7 @@ diff --git a/gdb/main.c b/gdb/main.c gdb [options] --args executable-file [inferior-arguments ...]\n\n\ "), stream); fputs_unfiltered (_("\ -@@ -1311,6 +1363,13 @@ Output and user interface control:\n\n\ +@@ -1315,6 +1367,13 @@ Output and user interface control:\n\n\ #endif fputs_unfiltered (_("\ --dbx DBX compatibility mode.\n\ diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch index 3a95fdb..27e984e 100644 --- a/gdb-attach-fail-reasons-5of5.patch +++ b/gdb-attach-fail-reasons-5of5.patch @@ -55,7 +55,7 @@ diff --git a/gdb/config.in b/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -@@ -393,6 +396,9 @@ +@@ -390,6 +393,9 @@ /* Define to 1 if you have the `scm_new_smob' function. */ #undef HAVE_SCM_NEW_SMOB diff --git a/gdb-bz1219747-attach-kills.patch b/gdb-bz1219747-attach-kills.patch index 44f339e..8c42a3b 100644 --- a/gdb-bz1219747-attach-kills.patch +++ b/gdb-bz1219747-attach-kills.patch @@ -80,7 +80,7 @@ gdb/testsuite/ChangeLog diff --git a/gdb/main.c b/gdb/main.c --- a/gdb/main.c +++ b/gdb/main.c -@@ -1120,7 +1120,10 @@ captured_main_1 (struct captured_main_args *context) +@@ -1124,7 +1124,10 @@ captured_main_1 (struct captured_main_args *context) { ret = catch_command_errors (attach_command, pid_or_core_arg, !batch_flag); diff --git a/gdb-bz533176-fortran-omp-step.patch b/gdb-bz533176-fortran-omp-step.patch index e2f9794..042bca5 100644 --- a/gdb-bz533176-fortran-omp-step.patch +++ b/gdb-bz533176-fortran-omp-step.patch @@ -30,7 +30,7 @@ debugging problem of GOMP outside of the scope of this Bug. diff --git a/gdb/infrun.c b/gdb/infrun.c --- a/gdb/infrun.c +++ b/gdb/infrun.c -@@ -6691,6 +6691,16 @@ process_event_stop_test (struct execution_control_state *ecs) +@@ -6693,6 +6693,16 @@ process_event_stop_test (struct execution_control_state *ecs) if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL) { @@ -47,7 +47,7 @@ diff --git a/gdb/infrun.c b/gdb/infrun.c /* We're doing a "next". Normal (forward) execution: set a breakpoint at the -@@ -6724,6 +6734,7 @@ process_event_stop_test (struct execution_control_state *ecs) +@@ -6726,6 +6736,7 @@ process_event_stop_test (struct execution_control_state *ecs) keep_going (ecs); return; diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch index 53f0cf8..3c8529d 100644 --- a/gdb-container-rh-pkg.patch +++ b/gdb-container-rh-pkg.patch @@ -9,7 +9,7 @@ Subject: gdb-container-rh-pkg.patch diff --git a/gdb/remote.c b/gdb/remote.c --- a/gdb/remote.c +++ b/gdb/remote.c -@@ -14008,7 +14008,17 @@ remote_target::pid_to_exec_file (int pid) +@@ -13999,7 +13999,17 @@ remote_target::pid_to_exec_file (int pid) char *annex = NULL; if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch index 7d1a7cf..4d8dc42 100644 --- a/gdb-glibc-strstr-workaround.patch +++ b/gdb-glibc-strstr-workaround.patch @@ -9,7 +9,7 @@ Subject: gdb-glibc-strstr-workaround.patch diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -21458,6 +21458,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, +@@ -21490,6 +21490,26 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* Cache this symbol's name and the name's demangled form (if any). */ SYMBOL_SET_LANGUAGE (sym, cu->language, &objfile->objfile_obstack); linkagename = dwarf2_physname (name, die, cu); diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch index d2d1f60..7cdd914 100644 --- a/gdb-gnat-dwarf-crash-3of3.patch +++ b/gdb-gnat-dwarf-crash-3of3.patch @@ -42,7 +42,7 @@ gdb/ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -10585,6 +10585,13 @@ private: +@@ -10581,6 +10581,13 @@ private: static void process_die (struct die_info *die, struct dwarf2_cu *cu) { diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index b25df5e..6d1a0af 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -557,7 +557,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *); static struct value *assign_aggregate (struct value *, struct value *, -@@ -692,7 +693,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) +@@ -703,7 +704,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) } static const gdb_byte * @@ -566,7 +566,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c { if (valaddr == NULL) return NULL; -@@ -701,7 +702,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) +@@ -712,7 +713,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) } static CORE_ADDR @@ -575,7 +575,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c { if (address == 0) return 0; -@@ -1743,7 +1744,7 @@ desc_bounds (struct value *arr) +@@ -1754,7 +1755,7 @@ desc_bounds (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the bounds data. */ @@ -584,7 +584,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c fat_pntr_bounds_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 1); -@@ -1809,7 +1810,7 @@ desc_data (struct value *arr) +@@ -1820,7 +1821,7 @@ desc_data (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the data. */ @@ -593,7 +593,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c fat_pntr_data_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 0); -@@ -1844,7 +1845,7 @@ desc_one_bound (struct value *bounds, int i, int which) +@@ -1855,7 +1856,7 @@ desc_one_bound (struct value *bounds, int i, int which) of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper bound, if WHICH is 1. The first bound is I=1. */ @@ -602,7 +602,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c desc_bound_bitpos (struct type *type, int i, int which) { return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); -@@ -2034,7 +2035,7 @@ ada_type_of_array (struct value *arr, int bounds) +@@ -2045,7 +2046,7 @@ ada_type_of_array (struct value *arr, int bounds) zero, and does not need to be recomputed. */ if (lo < hi) { @@ -611,7 +611,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8; -@@ -2194,7 +2195,7 @@ decode_packed_array_bitsize (struct type *type) +@@ -2205,7 +2206,7 @@ decode_packed_array_bitsize (struct type *type) the length is arbitrary. */ static struct type * @@ -620,7 +620,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c { struct type *new_elt_type; struct type *new_type; -@@ -2248,7 +2249,7 @@ decode_constrained_packed_array_type (struct type *type) +@@ -2259,7 +2260,7 @@ decode_constrained_packed_array_type (struct type *type) char *name; const char *tail; struct type *shadow_type; @@ -629,7 +629,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c if (!raw_name) raw_name = ada_type_name (desc_base_type (type)); -@@ -2319,7 +2320,8 @@ decode_constrained_packed_array (struct value *arr) +@@ -2330,7 +2331,8 @@ decode_constrained_packed_array (struct value *arr) array with no wrapper. In order to interpret the value through the (left-justified) packed array type we just built, we must first left-justify it. */ @@ -639,7 +639,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c ULONGEST mod; mod = ada_modulus (value_type (arr)) - 1; -@@ -2547,7 +2549,7 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size, +@@ -2558,7 +2560,7 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size, struct value * ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, @@ -648,7 +648,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *type) { struct value *v; -@@ -2617,7 +2619,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, +@@ -2628,7 +2630,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, if (obj != NULL) { @@ -657,7 +657,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c set_value_component_location (v, obj); set_value_bitpos (v, bit_offset + value_bitpos (obj)); -@@ -2663,7 +2665,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, +@@ -2674,7 +2676,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, not overlap. */ static void move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source, @@ -666,7 +666,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c { unsigned int accum, mask; int accum_bits, chunk_size; -@@ -2753,7 +2755,7 @@ ada_value_assign (struct value *toval, struct value *fromval) +@@ -2764,7 +2766,7 @@ ada_value_assign (struct value *toval, struct value *fromval) { int len = (value_bitpos (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; @@ -675,7 +675,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c gdb_byte *buffer = (gdb_byte *) alloca (len); struct value *val; CORE_ADDR to_addr = value_address (toval); -@@ -2804,7 +2806,7 @@ value_assign_to_component (struct value *container, struct value *component, +@@ -2815,7 +2817,7 @@ value_assign_to_component (struct value *container, struct value *component, (LONGEST) (value_address (component) - value_address (container)); int bit_offset_in_container = value_bitpos (component) - value_bitpos (container); @@ -684,7 +684,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c val = value_cast (value_type (component), val); -@@ -4502,7 +4504,7 @@ ensure_lval (struct value *val) +@@ -4513,7 +4515,7 @@ ensure_lval (struct value *val) if (VALUE_LVAL (val) == not_lval || VALUE_LVAL (val) == lval_internalvar) { @@ -693,7 +693,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c const CORE_ADDR addr = value_as_long (value_allocate_space_in_inferior (len)); -@@ -4586,7 +4588,7 @@ static CORE_ADDR +@@ -4597,7 +4599,7 @@ static CORE_ADDR value_pointer (struct value *value, struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); @@ -702,7 +702,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c gdb_byte *buf = (gdb_byte *) alloca (len); CORE_ADDR addr; -@@ -6694,7 +6696,7 @@ value_tag_from_contents_and_address (struct type *type, +@@ -6705,7 +6707,7 @@ value_tag_from_contents_and_address (struct type *type, const gdb_byte *valaddr, CORE_ADDR address) { @@ -711,7 +711,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *tag_type; if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, -@@ -7187,7 +7189,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) +@@ -7198,7 +7200,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) only in that it can handle packed values of arbitrary type. */ static struct value * @@ -720,7 +720,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *arg_type) { struct type *type; -@@ -7199,7 +7201,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, +@@ -7210,7 +7212,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) { @@ -729,7 +729,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); return ada_value_primitive_packed_val (arg1, value_contents (arg1), -@@ -7276,9 +7278,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, +@@ -7287,9 +7289,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, Returns 1 if found, 0 otherwise. */ static int @@ -741,7 +741,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c int *index_p) { int i; -@@ -7297,8 +7299,8 @@ find_struct_field (const char *name, struct type *type, int offset, +@@ -7308,8 +7310,8 @@ find_struct_field (const char *name, struct type *type, int offset, for (i = 0; i < TYPE_NFIELDS (type); i += 1) { @@ -752,7 +752,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c const char *t_field_name = TYPE_FIELD_NAME (type, i); if (t_field_name == NULL) -@@ -7400,7 +7402,7 @@ num_visible_fields (struct type *type) +@@ -7411,7 +7413,7 @@ num_visible_fields (struct type *type) long explanation in find_struct_field's function documentation. */ static struct value * @@ -761,7 +761,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *type) { int i; -@@ -7448,7 +7450,7 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, +@@ -7459,7 +7461,7 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, int j; struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -770,7 +770,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) { -@@ -7480,8 +7482,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, +@@ -7491,8 +7493,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, return NULL; } @@ -781,7 +781,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c /* Return field #INDEX in ARG, where the index is that returned by -@@ -7490,7 +7492,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, +@@ -7501,7 +7503,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, * If found, return value, else return NULL. */ static struct value * @@ -790,7 +790,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *type) { return ada_index_struct_field_1 (&index, arg, offset, type); -@@ -7502,7 +7504,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, +@@ -7513,7 +7515,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, * *INDEX_P. */ static struct value * @@ -799,7 +799,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *type) { int i; -@@ -7593,7 +7595,8 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err) +@@ -7604,7 +7606,8 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err) v = ada_search_struct_field (name, arg, 0, t); else { @@ -809,7 +809,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c struct type *field_type; CORE_ADDR address; -@@ -7942,8 +7945,8 @@ ada_coerce_ref (struct value *val0) +@@ -7953,8 +7956,8 @@ ada_coerce_ref (struct value *val0) /* Return OFF rounded upward if necessary to a multiple of ALIGNMENT (a power of 2). */ @@ -820,7 +820,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c { return (off + alignment - 1) & ~(alignment - 1); } -@@ -8333,10 +8336,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, +@@ -8344,10 +8347,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, struct value *mark = value_mark (); struct value *dval; struct type *rtype; @@ -833,7 +833,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c int f; /* Compute the number of fields in this record type that are going -@@ -8413,7 +8415,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, +@@ -8424,7 +8426,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, that follow this one. */ if (ada_is_aligner_type (field_type)) { @@ -842,7 +842,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c field_valaddr = cond_offset_host (field_valaddr, field_offset); field_address = cond_offset_target (field_address, field_offset); -@@ -8549,11 +8551,11 @@ ada_template_to_fixed_record_type_1 (struct type *type, +@@ -8560,11 +8562,11 @@ ada_template_to_fixed_record_type_1 (struct type *type, if (TYPE_LENGTH (type) <= 0) { if (TYPE_NAME (rtype)) @@ -858,7 +858,7 @@ diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c } else { -@@ -9017,7 +9019,8 @@ to_fixed_array_type (struct type *type0, struct value *dval, +@@ -9028,7 +9030,8 @@ to_fixed_array_type (struct type *type0, struct value *dval, type was a regular (non-packed) array type. As a result, the bitsize of the array elements needs to be set again, and the array length needs to be recomputed based on that bitsize. */ @@ -1072,7 +1072,7 @@ diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c -@@ -727,7 +727,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -732,7 +732,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, gdb_byte *readbuf, const gdb_byte *writebuf) { enum amd64_reg_class theclass[2]; @@ -1081,7 +1081,7 @@ diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM }; static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM }; int integer_reg = 0; -@@ -844,10 +844,10 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -849,10 +849,10 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, gdb_assert (regnum != -1); if (readbuf) @@ -1634,7 +1634,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -2032,11 +2032,11 @@ dwarf2_complex_location_expr_complaint (void) +@@ -2033,11 +2033,11 @@ dwarf2_complex_location_expr_complaint (void) } static void @@ -1650,7 +1650,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } static void -@@ -15092,8 +15092,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, +@@ -15104,8 +15104,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, object, and then subtract off the number of bits of the field itself. The result is the bit offset of the LSB of the field. */ @@ -1707,7 +1707,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c struct type **arg_types; pc = (*pos)++; -@@ -1735,7 +1736,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1734,7 +1735,7 @@ evaluate_subexp_standard (struct type *expect_type, struct type *range_type = TYPE_INDEX_TYPE (type); struct type *element_type = TYPE_TARGET_TYPE (type); struct value *array = allocate_value (expect_type); @@ -1802,7 +1802,7 @@ diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c diff --git a/gdb/findvar.c b/gdb/findvar.c --- a/gdb/findvar.c +++ b/gdb/findvar.c -@@ -823,7 +823,7 @@ struct value * +@@ -821,7 +821,7 @@ struct value * default_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_id frame_id) { @@ -1811,7 +1811,7 @@ diff --git a/gdb/findvar.c b/gdb/findvar.c struct value *value = allocate_value (type); struct frame_info *frame; -@@ -867,7 +867,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) +@@ -865,7 +865,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) LONGEST offset = 0; LONGEST reg_offset = value_offset (value); int regnum = VALUE_REGNUM (value); @@ -1820,7 +1820,7 @@ diff --git a/gdb/findvar.c b/gdb/findvar.c gdb_assert (VALUE_LVAL (value) == lval_register); -@@ -882,7 +882,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) +@@ -880,7 +880,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) while (len > 0) { struct value *regval = get_frame_register_value (frame, regnum); @@ -2134,7 +2134,7 @@ diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c diff --git a/gdb/language.c b/gdb/language.c --- a/gdb/language.c +++ b/gdb/language.c -@@ -766,7 +766,7 @@ unk_lang_printchar (int c, struct type *type, struct ui_file *stream) +@@ -765,7 +765,7 @@ unk_lang_printchar (int c, struct type *type, struct ui_file *stream) static void unk_lang_printstr (struct ui_file *stream, struct type *type, @@ -2143,7 +2143,7 @@ diff --git a/gdb/language.c b/gdb/language.c const char *encoding, int force_ellipses, const struct value_print_options *options) { -@@ -785,7 +785,7 @@ unk_lang_print_type (struct type *type, const char *varstring, +@@ -784,7 +784,7 @@ unk_lang_print_type (struct type *type, const char *varstring, static void unk_lang_val_print (struct type *type, @@ -2577,7 +2577,7 @@ diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c -@@ -1300,7 +1300,7 @@ ppc_linux_nat_target::can_use_hw_breakpoint (enum bptype type, int cnt, int ot) +@@ -1716,7 +1716,7 @@ ppc_linux_nat_target::can_use_hw_breakpoint (enum bptype type, int cnt, int ot) } int @@ -2589,7 +2589,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c -@@ -1705,7 +1705,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, +@@ -2265,7 +2265,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, const struct floatformat ** ppc_floatformat_for_type (struct gdbarch *gdbarch, @@ -2622,7 +2622,7 @@ diff --git a/gdb/printcmd.c b/gdb/printcmd.c diff --git a/gdb/procfs.c b/gdb/procfs.c --- a/gdb/procfs.c +++ b/gdb/procfs.c -@@ -3367,7 +3367,7 @@ procfs_target::remove_watchpoint (CORE_ADDR addr, int len, +@@ -3368,7 +3368,7 @@ procfs_target::remove_watchpoint (CORE_ADDR addr, int len, } int @@ -2634,7 +2634,7 @@ diff --git a/gdb/procfs.c b/gdb/procfs.c diff --git a/gdb/regcache.c b/gdb/regcache.c --- a/gdb/regcache.c +++ b/gdb/regcache.c -@@ -795,7 +795,7 @@ regcache::cooked_write (int regnum, const gdb_byte *buf) +@@ -792,7 +792,7 @@ regcache::cooked_write (int regnum, const gdb_byte *buf) /* See regcache.h. */ enum register_status @@ -2643,7 +2643,7 @@ diff --git a/gdb/regcache.c b/gdb/regcache.c gdb_byte *out, bool is_raw) { int reg_size = register_size (arch (), regnum); -@@ -862,7 +862,7 @@ reg_buffer::raw_collect_part (int regnum, int offset, int len, +@@ -859,7 +859,7 @@ reg_buffer::raw_collect_part (int regnum, int offset, int len, /* See regcache.h. */ enum register_status @@ -2652,7 +2652,7 @@ diff --git a/gdb/regcache.c b/gdb/regcache.c const gdb_byte *in, bool is_raw) { int reg_size = register_size (arch (), regnum); -@@ -933,7 +933,7 @@ reg_buffer::raw_supply_part (int regnum, int offset, int len, +@@ -930,7 +930,7 @@ reg_buffer::raw_supply_part (int regnum, int offset, int len, } enum register_status @@ -2661,7 +2661,7 @@ diff --git a/gdb/regcache.c b/gdb/regcache.c gdb_byte *buf) { assert_regnum (regnum); -@@ -943,7 +943,7 @@ readable_regcache::raw_read_part (int regnum, int offset, int len, +@@ -940,7 +940,7 @@ readable_regcache::raw_read_part (int regnum, int offset, int len, /* See regcache.h. */ void @@ -2670,7 +2670,7 @@ diff --git a/gdb/regcache.c b/gdb/regcache.c const gdb_byte *buf) { assert_regnum (regnum); -@@ -953,7 +953,7 @@ regcache::raw_write_part (int regnum, int offset, int len, +@@ -950,7 +950,7 @@ regcache::raw_write_part (int regnum, int offset, int len, /* See regcache.h. */ enum register_status @@ -2679,7 +2679,7 @@ diff --git a/gdb/regcache.c b/gdb/regcache.c gdb_byte *buf) { gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers); -@@ -963,7 +963,7 @@ readable_regcache::cooked_read_part (int regnum, int offset, int len, +@@ -960,7 +960,7 @@ readable_regcache::cooked_read_part (int regnum, int offset, int len, /* See regcache.h. */ void @@ -2825,7 +2825,7 @@ diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c diff --git a/gdb/stack.c b/gdb/stack.c --- a/gdb/stack.c +++ b/gdb/stack.c -@@ -192,7 +192,7 @@ print_stack_frame (struct frame_info *frame, int print_level, +@@ -194,7 +194,7 @@ print_stack_frame (struct frame_info *frame, int print_level, argument (not just the first nameless argument). */ static void @@ -2834,7 +2834,7 @@ diff --git a/gdb/stack.c b/gdb/stack.c int first, struct ui_file *stream) { struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -542,7 +542,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, +@@ -544,7 +544,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, /* Offset of next stack argument beyond the one we have seen that is at the highest offset, or -1 if we haven't come to a stack argument yet. */ @@ -2843,7 +2843,7 @@ diff --git a/gdb/stack.c b/gdb/stack.c /* Number of ints of arguments that we have printed so far. */ int args_printed = 0; /* True if we should print arguments, false otherwise. */ -@@ -571,8 +571,8 @@ print_frame_args (struct symbol *func, struct frame_info *frame, +@@ -573,8 +573,8 @@ print_frame_args (struct symbol *func, struct frame_info *frame, case LOC_ARG: case LOC_REF_ARG: { @@ -2854,7 +2854,7 @@ diff --git a/gdb/stack.c b/gdb/stack.c /* Compute address of next argument by adding the size of this argument and rounding to an int boundary. */ -@@ -707,7 +707,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, +@@ -709,7 +709,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, enough about the stack to find them. */ if (num != -1) { @@ -2946,7 +2946,7 @@ diff --git a/gdb/target.c b/gdb/target.c static void default_rcmd (struct target_ops *, const char *, struct ui_file *); -@@ -3184,7 +3184,7 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename) +@@ -3190,7 +3190,7 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename) static int default_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -3237,7 +3237,7 @@ diff --git a/gdb/valprint.c b/gdb/valprint.c struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options, -@@ -1773,7 +1773,7 @@ print_decimal_chars (struct ui_file *stream, const gdb_byte *valaddr, +@@ -1774,7 +1774,7 @@ print_decimal_chars (struct ui_file *stream, const gdb_byte *valaddr, void print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr, @@ -3246,7 +3246,7 @@ diff --git a/gdb/valprint.c b/gdb/valprint.c bool zero_pad) { const gdb_byte *p; -@@ -1926,17 +1926,17 @@ val_print_array_elements (struct type *type, +@@ -1927,17 +1927,17 @@ val_print_array_elements (struct type *type, int recurse, struct value *val, const struct value_print_options *options, @@ -3269,7 +3269,7 @@ diff --git a/gdb/valprint.c b/gdb/valprint.c LONGEST low_bound, high_bound; LONGEST low_pos, high_pos; -@@ -2026,7 +2026,7 @@ val_print_array_elements (struct type *type, +@@ -2027,7 +2027,7 @@ val_print_array_elements (struct type *type, address, stream, recurse + 1, val, options, current_language); annotate_elt_rep (reps); @@ -3278,7 +3278,7 @@ diff --git a/gdb/valprint.c b/gdb/valprint.c annotate_elt_rep_end (); i = rep1 - 1; -@@ -2668,7 +2668,7 @@ print_converted_chars_to_obstack (struct obstack *obstack, +@@ -2669,7 +2669,7 @@ print_converted_chars_to_obstack (struct obstack *obstack, void generic_printstr (struct ui_file *stream, struct type *type, diff --git a/gdb-rhbz795424-bitpos-21of25.patch b/gdb-rhbz795424-bitpos-21of25.patch index a293b6d..f1ebbc5 100644 --- a/gdb-rhbz795424-bitpos-21of25.patch +++ b/gdb-rhbz795424-bitpos-21of25.patch @@ -90,7 +90,7 @@ diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c diff --git a/gdb/defs.h b/gdb/defs.h --- a/gdb/defs.h +++ b/gdb/defs.h -@@ -668,4 +668,6 @@ DEF_ENUM_FLAGS_TYPE (enum user_selected_what_flag, user_selected_what); +@@ -669,4 +669,6 @@ DEF_ENUM_FLAGS_TYPE (enum user_selected_what_flag, user_selected_what); #include "utils.h" diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch index 2f81843..a6e2a93 100644 --- a/gdb-rhbz795424-bitpos-22of25.patch +++ b/gdb-rhbz795424-bitpos-22of25.patch @@ -278,7 +278,7 @@ diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c -@@ -282,7 +282,7 @@ struct ppc_linux_nat_target final : public linux_nat_target +@@ -284,7 +284,7 @@ struct ppc_linux_nat_target final : public linux_nat_target int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override; @@ -287,7 +287,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, struct expression *) override; -@@ -300,9 +300,9 @@ struct ppc_linux_nat_target final : public linux_nat_target +@@ -302,9 +302,9 @@ struct ppc_linux_nat_target final : public linux_nat_target bool stopped_data_address (CORE_ADDR *) override; @@ -299,7 +299,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c override; int masked_watch_num_registers (CORE_ADDR, CORE_ADDR) override; -@@ -1649,11 +1649,11 @@ can_use_watchpoint_cond_accel (void) +@@ -2065,11 +2065,11 @@ can_use_watchpoint_cond_accel (void) CONDITION_VALUE will hold the value which should be put in the DVC register. */ static void @@ -314,7 +314,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c CORE_ADDR addr_end_data, addr_end_dvc; /* The DVC register compares bytes within fixed-length windows which -@@ -1741,7 +1741,7 @@ num_memory_accesses (const std::vector &chain) +@@ -2157,7 +2157,7 @@ num_memory_accesses (const std::vector &chain) of the constant. */ static int check_condition (CORE_ADDR watch_addr, struct expression *cond, @@ -323,7 +323,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c { int pc = 1, num_accesses_left, num_accesses_right; struct value *left_val, *right_val; -@@ -1792,7 +1792,8 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond, +@@ -2208,7 +2208,8 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond, the condition expression, thus only triggering the watchpoint when it is true. */ bool @@ -333,7 +333,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c int rw, struct expression *cond) { -@@ -1810,7 +1811,7 @@ ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr, int len, +@@ -2226,7 +2227,7 @@ ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr, int len, static void create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr, @@ -342,7 +342,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c struct expression *cond, int insert) { if (len == 1 -@@ -2076,7 +2077,7 @@ ppc_linux_nat_target::stopped_by_watchpoint () +@@ -2492,7 +2493,7 @@ ppc_linux_nat_target::stopped_by_watchpoint () bool ppc_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr, CORE_ADDR start, @@ -354,7 +354,7 @@ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c diff --git a/gdb/procfs.c b/gdb/procfs.c --- a/gdb/procfs.c +++ b/gdb/procfs.c -@@ -1540,7 +1540,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr) +@@ -1541,7 +1541,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr) } static int @@ -363,7 +363,7 @@ diff --git a/gdb/procfs.c b/gdb/procfs.c { struct { procfs_ctl_t cmd; -@@ -3231,7 +3231,7 @@ procfs_target::pid_to_exec_file (int pid) +@@ -3232,7 +3232,7 @@ procfs_target::pid_to_exec_file (int pid) /* Insert a watchpoint. */ static int @@ -526,7 +526,7 @@ diff --git a/gdb/target.c b/gdb/target.c static int default_region_ok_for_hw_watchpoint (struct target_ops *, CORE_ADDR, LONGEST); -@@ -3192,7 +3192,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self, +@@ -3198,7 +3198,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self, static int default_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, diff --git a/gdb-rhbz795424-bitpos-23of25.patch b/gdb-rhbz795424-bitpos-23of25.patch index a2c1166..f689a17 100644 --- a/gdb-rhbz795424-bitpos-23of25.patch +++ b/gdb-rhbz795424-bitpos-23of25.patch @@ -192,7 +192,7 @@ diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c -@@ -878,8 +878,8 @@ amd64_push_arguments (struct regcache *regcache, int nargs, +@@ -883,8 +883,8 @@ amd64_push_arguments (struct regcache *regcache, int nargs, }; struct value **stack_args = XALLOCAVEC (struct value *, nargs); int num_stack_args = 0; @@ -203,7 +203,7 @@ diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c int integer_reg = 0; int sse_reg = 0; int i; -@@ -891,7 +891,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, +@@ -896,7 +896,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); @@ -212,7 +212,7 @@ diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c enum amd64_reg_class theclass[2]; int needed_integer_regs = 0; int needed_sse_regs = 0; -@@ -955,7 +955,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, +@@ -960,7 +960,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, gdb_assert (regnum != -1); memset (buf, 0, sizeof buf); @@ -236,7 +236,7 @@ diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c -@@ -3468,7 +3468,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc_base_type b) +@@ -3472,7 +3472,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc_base_type b) array). Vector types are not currently supported, matching the generic AAPCS support. */ @@ -245,7 +245,7 @@ diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c arm_vfp_cprc_sub_candidate (struct type *t, enum arm_vfp_cprc_base_type *base_type) { -@@ -3551,7 +3551,7 @@ arm_vfp_cprc_sub_candidate (struct type *t, +@@ -3555,7 +3555,7 @@ arm_vfp_cprc_sub_candidate (struct type *t, } else { @@ -254,7 +254,7 @@ diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c unsigned unitlen; count = arm_vfp_cprc_sub_candidate (TYPE_TARGET_TYPE (t), -@@ -3574,12 +3574,12 @@ arm_vfp_cprc_sub_candidate (struct type *t, +@@ -3578,12 +3578,12 @@ arm_vfp_cprc_sub_candidate (struct type *t, case TYPE_CODE_STRUCT: { @@ -269,7 +269,7 @@ diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c if (!field_is_static (&TYPE_FIELD (t, i))) sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i), -@@ -3603,13 +3603,15 @@ arm_vfp_cprc_sub_candidate (struct type *t, +@@ -3607,13 +3607,15 @@ arm_vfp_cprc_sub_candidate (struct type *t, case TYPE_CODE_UNION: { @@ -288,7 +288,7 @@ diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c if (sub_count == -1) return -1; count = (count > sub_count ? count : sub_count); -@@ -3645,7 +3647,7 @@ arm_vfp_call_candidate (struct type *t, enum arm_vfp_cprc_base_type *base_type, +@@ -3649,7 +3651,7 @@ arm_vfp_call_candidate (struct type *t, enum arm_vfp_cprc_base_type *base_type, int *count) { enum arm_vfp_cprc_base_type b = VFP_CPRC_UNKNOWN; @@ -297,7 +297,7 @@ diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c if (c <= 0 || c > 4) return 0; *base_type = b; -@@ -3726,7 +3728,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -3730,7 +3732,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { @@ -905,7 +905,7 @@ diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c --- a/gdb/rs6000-aix-tdep.c +++ b/gdb/rs6000-aix-tdep.c -@@ -177,9 +177,9 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -290,9 +290,9 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int ii; @@ -917,7 +917,7 @@ diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c gdb_byte tmp_buffer[50]; int f_argno = 0; /* current floating point argno */ int wordsize = gdbarch_tdep (gdbarch)->wordsize; -@@ -307,7 +307,7 @@ ran_out_of_registers_for_arguments: +@@ -420,7 +420,7 @@ ran_out_of_registers_for_arguments: if ((argno < nargs) || argbytes) { @@ -1171,7 +1171,7 @@ diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c -@@ -1625,8 +1625,7 @@ xtensa_store_return_value (struct type *type, +@@ -1615,8 +1615,7 @@ xtensa_store_return_value (struct type *type, if (len > (callsize > 8 ? 8 : 16)) internal_error (__FILE__, __LINE__, @@ -1181,7 +1181,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c areg = arreg_number (gdbarch, gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb); -@@ -1699,18 +1698,19 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1689,18 +1688,19 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -1204,7 +1204,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c int regno; /* regno if in register. */ } u; }; -@@ -1733,9 +1733,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1723,9 +1723,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); @@ -1218,7 +1218,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c switch (TYPE_CODE (arg_type)) { case TYPE_CODE_INT: -@@ -1804,8 +1805,8 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1794,8 +1795,8 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long); break; } @@ -1228,7 +1228,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c /* Align size and onstack_size. */ size = (size + info->align - 1) & ~(info->align - 1); -@@ -1850,7 +1851,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1840,7 +1841,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, if (info->onstack) { @@ -1237,7 +1237,7 @@ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c CORE_ADDR offset = sp + info->u.offset; /* Odd-sized structs are aligned to the lower side of a memory -@@ -1866,7 +1867,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1856,7 +1857,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, } else { diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch index e2cb702..3b0c20d 100644 --- a/gdb-vla-intel-fortran-strides.patch +++ b/gdb-vla-intel-fortran-strides.patch @@ -143,7 +143,7 @@ diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -17720,7 +17720,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17752,7 +17752,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type, *orig_base_type; struct type *range_type; struct attribute *attr; @@ -152,7 +152,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c int low_default_is_valid; int high_bound_is_count = 0; const char *name; -@@ -17740,7 +17740,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17772,7 +17772,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) low.kind = PROP_CONST; high.kind = PROP_CONST; @@ -162,7 +162,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow omitting DW_AT_lower_bound. */ -@@ -17773,6 +17775,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17805,6 +17807,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) break; } @@ -177,7 +177,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) attr_to_dynamic_prop (attr, die, cu, &low); -@@ -17865,7 +17875,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17897,7 +17907,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask)) high.data.const_val |= negative_mask; @@ -553,7 +553,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c struct value * evaluate_subexp_standard (struct type *expect_type, struct expression *exp, int *pos, -@@ -1946,33 +2228,8 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1945,33 +2227,8 @@ evaluate_subexp_standard (struct type *expect_type, switch (code) { case TYPE_CODE_ARRAY: @@ -588,7 +588,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c case TYPE_CODE_PTR: case TYPE_CODE_FUNC: -@@ -2369,49 +2626,6 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2368,49 +2625,6 @@ evaluate_subexp_standard (struct type *expect_type, } return (arg1); @@ -638,7 +638,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c case BINOP_LOGICAL_AND: arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); if (noside == EVAL_SKIP) -@@ -3331,6 +3545,9 @@ calc_f77_array_dims (struct type *array_type) +@@ -3330,6 +3544,9 @@ calc_f77_array_dims (struct type *array_type) int ndimen = 1; struct type *tmp_type; diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch index c5a3885..6797334 100644 --- a/gdb-vla-intel-fortran-vla-strings.patch +++ b/gdb-vla-intel-fortran-vla-strings.patch @@ -33,7 +33,7 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings diff --git a/gdb/NEWS b/gdb/NEWS --- a/gdb/NEWS +++ b/gdb/NEWS -@@ -239,6 +239,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* +@@ -265,6 +265,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* *** Changes in GDB 8.1 @@ -77,7 +77,7 @@ diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -1800,7 +1800,8 @@ static void read_signatured_type (struct signatured_type *); +@@ -1801,7 +1801,8 @@ static void read_signatured_type (struct signatured_type *); static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, struct dwarf2_cu *cu, @@ -87,7 +87,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c /* memory allocation interface */ -@@ -13748,7 +13749,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -13757,7 +13758,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) { newobj->static_link = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop); @@ -96,7 +96,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } cu->list_in_scope = cu->builder->get_local_symbols (); -@@ -16483,7 +16484,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -16495,7 +16496,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) byte_stride_prop = (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop)); @@ -106,7 +106,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (!stride_ok) { complaint (_("unable to read array DW_AT_byte_stride " -@@ -17244,29 +17246,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17256,29 +17258,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -208,7 +208,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -17614,7 +17677,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17646,7 +17709,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, @@ -218,7 +218,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c { struct dwarf2_property_baton *baton; struct obstack *obstack -@@ -17625,14 +17689,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17657,14 +17721,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, if (attr_form_is_block (attr)) { @@ -256,7 +256,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } else if (attr_form_is_ref (attr)) { -@@ -17665,8 +17748,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17697,8 +17780,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, baton = XOBNEW (obstack, struct dwarf2_property_baton); baton->referenced_type = die_type (target_die, target_cu); baton->locexpr.per_cu = cu->per_cu; @@ -287,7 +287,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c prop->data.baton = baton; prop->kind = PROP_LOCEXPR; gdb_assert (prop->data.baton != NULL); -@@ -17777,7 +17880,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17809,7 +17912,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_byte_stride, cu); if (attr) @@ -296,7 +296,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c complaint (_("Missing DW_AT_byte_stride " "- DIE at 0x%s [in module %s]"), sect_offset_str (die->sect_off), -@@ -17785,7 +17888,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17817,7 +17920,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) @@ -305,7 +305,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c else if (!low_default_is_valid) complaint (_("Missing DW_AT_lower_bound " "- DIE at %s [in module %s]"), -@@ -17794,10 +17897,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17826,10 +17929,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct attribute *attr_ub, *attr_count; attr = attr_ub = dwarf2_attr (die, DW_AT_upper_bound, cu); @@ -318,7 +318,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c { /* If bounds are constant do the final calculation here. */ if (low.kind == PROP_CONST && high.kind == PROP_CONST) -@@ -25353,7 +25456,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25386,7 +25489,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_allocated, cu); if (attr_form_is_block (attr)) { @@ -327,7 +327,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ALLOCATED, prop, type); } else if (attr != NULL) -@@ -25367,7 +25470,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25400,7 +25503,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_associated, cu); if (attr_form_is_block (attr)) { @@ -336,7 +336,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type); } else if (attr != NULL) -@@ -25379,7 +25482,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25412,7 +25515,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) /* Read DW_AT_data_location and set in type. */ attr = dwarf2_attr (die, DW_AT_data_location, cu); diff --git a/gdb.spec b/gdb.spec index d7021c1..977c426 100644 --- a/gdb.spec +++ b/gdb.spec @@ -18,7 +18,7 @@ Name: %{?scl_prefix}gdb # Freeze it when GDB gets branched -%global snapsrc 20181016 +%global snapsrc 20181114 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20161115 %global tarname gdb-%{version} @@ -26,7 +26,7 @@ Version: 8.2.50.%{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: 7%{?dist} +Release: 8%{?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 @@ -1028,6 +1028,12 @@ fi %endif %changelog +* Wed Nov 14 2018 Sergio Durigan Junior - 8.2.50.20181114-8.fc30 +- Rebase to FSF GDB 8.2.50.20181114 (8.3pre). +- Drop gdb-6.3-ppc64syscall-20040622.patch. +- Drop gdb-6.3-ppc64displaysymbol-20041124.patch. +- Drop gdb-6.8-watchpoint-conditionals-test.patch. + * Thu Oct 18 2018 Sergio Durigan Junior - 8.2.50.20181016-7.fc30 - Use "--enable-unit-tests" flag when compiling GDB. diff --git a/sources b/sources index 33305d6..109fe02 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (gdb-libstdc++-v3-python-8.1.1-20180626.tar.xz) = a8b1c54dd348cfeb37da73f968742896be3dd13a4215f8d8519870c2abea915f5176c3fa6989ddd10f20020a16f0fab20cbae68ee8d58a82234d8778023520f8 SHA512 (v2.0.tar.gz) = ec63151e842c81cc73ea11ba560b63e005cefbe19d98de24ae5c8caa4de7c9c1d71d1ec5b6214a347592eac675b75a3d2b26d4691ca86f91020ebfea8e912939 -SHA512 (gdb-8.2.50.20181016.tar.xz) = ebf7abc93e08121b4a5e40f860e99251ca138b7b79976d92e834c7f13856dbe736fb545f3617dc29e8b73174fe87e69e8f0f93940cab60d938d65107da941a54 +SHA512 (gdb-8.2.50.20181114.tar.xz) = e8af2d2889aad7c74ede7f6b0dd57de38b9a7a9acaf0433a48338b079388ae3aa84e0697d0fecc022113a07d0873d87e19a43f8d22177118f19b386c3fdbd30c From dba70321b8a1d20d30f3004812191bcd151230d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 15 Nov 2018 12:53:54 +0100 Subject: [PATCH 35/35] https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2 --- gdb.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb.spec b/gdb.spec index 977c426..1741a4f 100644 --- a/gdb.spec +++ b/gdb.spec @@ -1,3 +1,7 @@ +# This package depends on automagic byte compilation +# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2 +%global _python_bytecompile_extra 1 + # rpmbuild parameters: # --with testsuite: Run the testsuite (biarch if possible). Default is without. # --with buildisa: Use %%{?_isa} for BuildRequires