diff --git a/gdb-6.3-attach-see-vdso-test.patch b/gdb-6.3-attach-see-vdso-test.patch index ac002f2..68e83b4 100644 --- a/gdb-6.3-attach-see-vdso-test.patch +++ b/gdb-6.3-attach-see-vdso-test.patch @@ -3,20 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-attach-see-vdso-test.patch -FileName: gdb-6.3-attach-see-vdso-test.patch - ;; Test kernel VDSO decoding while attaching to an i386 process. ;;=fedoratest ---- - gdb/testsuite/gdb.base/attach-see-vdso.c | 25 +++++++++++ - gdb/testsuite/gdb.base/attach-see-vdso.exp | 72 ++++++++++++++++++++++++++++++ - 2 files changed, 97 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/attach-see-vdso.c - create mode 100644 gdb/testsuite/gdb.base/attach-see-vdso.exp diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.c b/gdb/testsuite/gdb.base/attach-see-vdso.c new file mode 100644 -index 0000000000..cf3c7207a5 --- /dev/null +++ b/gdb/testsuite/gdb.base/attach-see-vdso.c @@ -0,0 +1,25 @@ @@ -47,7 +38,6 @@ index 0000000000..cf3c7207a5 +} diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base/attach-see-vdso.exp new file mode 100644 -index 0000000000..e8a538097e --- /dev/null +++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp @@ -0,0 +1,72 @@ @@ -123,6 +113,3 @@ index 0000000000..e8a538097e +# work. + +remote_exec build "kill -9 ${testpid}" --- -2.14.3 - diff --git a/gdb-6.3-bz140532-ppc-unwinding-test.patch b/gdb-6.3-bz140532-ppc-unwinding-test.patch index 84a46c5..25c77e7 100644 --- a/gdb-6.3-bz140532-ppc-unwinding-test.patch +++ b/gdb-6.3-bz140532-ppc-unwinding-test.patch @@ -3,25 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-bz140532-ppc-unwinding-test.patch -FileName: gdb-6.3-bz140532-ppc-unwinding-test.patch - ;; Update PPC unwinding patches to their upstream variants (BZ 140532). ;;=fedoratest ---- - .../gdb.arch/powerpc-bcl-prologue-asm32.S | 78 +++++++++++++++++ - .../gdb.arch/powerpc-bcl-prologue-asm64.S | 98 ++++++++++++++++++++++ - gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c | 29 +++++++ - gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp | 72 ++++++++++++++++ - gdb/testsuite/gdb.arch/powerpc-prologue.exp | 5 +- - 5 files changed, 280 insertions(+), 2 deletions(-) - create mode 100644 gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S - create mode 100644 gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S - create mode 100644 gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c - create mode 100644 gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S new file mode 100644 -index 0000000000..1e4301af89 --- /dev/null +++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S @@ -0,0 +1,78 @@ @@ -105,7 +91,6 @@ index 0000000000..1e4301af89 +*/ diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S new file mode 100644 -index 0000000000..1af5c19a16 --- /dev/null +++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S @@ -0,0 +1,98 @@ @@ -209,7 +194,6 @@ index 0000000000..1af5c19a16 +*/ diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c new file mode 100644 -index 0000000000..6b5bb08d0f --- /dev/null +++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c @@ -0,0 +1,29 @@ @@ -244,7 +228,6 @@ index 0000000000..6b5bb08d0f +} diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp new file mode 100644 -index 0000000000..5f50c4ef43 --- /dev/null +++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp @@ -0,0 +1,72 @@ @@ -321,7 +304,6 @@ index 0000000000..5f50c4ef43 + } +} diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-prologue.exp -index 5251dfa9c3..f3933e2295 100644 --- a/gdb/testsuite/gdb.arch/powerpc-prologue.exp +++ b/gdb/testsuite/gdb.arch/powerpc-prologue.exp @@ -16,8 +16,9 @@ @@ -336,6 +318,3 @@ index 5251dfa9c3..f3933e2295 100644 verbose "Skipping PowerPC prologue tests." return } --- -2.14.3 - diff --git a/gdb-6.3-bz202689-exec-from-pthread-test.patch b/gdb-6.3-bz202689-exec-from-pthread-test.patch index 8f316ec..a283f9f 100644 --- a/gdb-6.3-bz202689-exec-from-pthread-test.patch +++ b/gdb-6.3-bz202689-exec-from-pthread-test.patch @@ -3,24 +3,15 @@ From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-bz202689-exec-from-pthread-test.patch -FileName: gdb-6.3-bz202689-exec-from-pthread-test.patch - ;; Testcase for exec() from threaded program (BZ 202689). ;;=fedoratest 2007-01-17 Jan Kratochvil * gdb.threads/threaded-exec.exp, gdb.threads/threaded-exec.c: New files. ---- - gdb/testsuite/gdb.threads/threaded-exec.c | 46 +++++++++++++++++++++++++++++ - gdb/testsuite/gdb.threads/threaded-exec.exp | 41 +++++++++++++++++++++++++ - 2 files changed, 87 insertions(+) - create mode 100644 gdb/testsuite/gdb.threads/threaded-exec.c - create mode 100644 gdb/testsuite/gdb.threads/threaded-exec.exp diff --git a/gdb/testsuite/gdb.threads/threaded-exec.c b/gdb/testsuite/gdb.threads/threaded-exec.c new file mode 100644 -index 0000000000..522b24671d --- /dev/null +++ b/gdb/testsuite/gdb.threads/threaded-exec.c @@ -0,0 +1,46 @@ @@ -72,7 +63,6 @@ index 0000000000..522b24671d +} diff --git a/gdb/testsuite/gdb.threads/threaded-exec.exp b/gdb/testsuite/gdb.threads/threaded-exec.exp new file mode 100644 -index 0000000000..77c8a7dc85 --- /dev/null +++ b/gdb/testsuite/gdb.threads/threaded-exec.exp @@ -0,0 +1,41 @@ @@ -117,6 +107,3 @@ index 0000000000..77c8a7dc85 + pass "Program exited" + } +} --- -2.14.3 - diff --git a/gdb-6.3-focus-cmd-prev-test.patch b/gdb-6.3-focus-cmd-prev-test.patch index 0400d7f..8deaad6 100644 --- a/gdb-6.3-focus-cmd-prev-test.patch +++ b/gdb-6.3-focus-cmd-prev-test.patch @@ -3,18 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-focus-cmd-prev-test.patch -FileName: gdb-6.3-focus-cmd-prev-test.patch - ;; Test a crash on `focus cmd', `focus prev' commands. ;;=fedoratest ---- - gdb/testsuite/gdb.base/focus-cmd-prev.exp | 40 +++++++++++++++++++++++++++++++ - 1 file changed, 40 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/focus-cmd-prev.exp diff --git a/gdb/testsuite/gdb.base/focus-cmd-prev.exp b/gdb/testsuite/gdb.base/focus-cmd-prev.exp new file mode 100644 -index 0000000000..d5a653f684 --- /dev/null +++ b/gdb/testsuite/gdb.base/focus-cmd-prev.exp @@ -0,0 +1,40 @@ @@ -58,6 +51,3 @@ index 0000000000..d5a653f684 + pass $test + } +} --- -2.14.3 - diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index b338cfb..91e3c9f 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -3,8 +3,6 @@ From: Andrew Cagney Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-gstack-20050411.patch -FileName: gdb-6.3-gstack-20050411.patch - ;; Add a wrapper script to GDB that implements pstack using the ;; --readnever option. ;;=push @@ -14,21 +12,11 @@ FileName: gdb-6.3-gstack-20050411.patch * Makefile.in (uninstall-gstack, install-gstack): New rules, add to install and uninstall. * gstack.sh, gstack.1: New files. ---- - gdb/Makefile.in | 34 ++++++++++++++++++-- - gdb/gstack.sh | 43 +++++++++++++++++++++++++ - gdb/testsuite/gdb.base/gstack.c | 43 +++++++++++++++++++++++++ - gdb/testsuite/gdb.base/gstack.exp | 66 +++++++++++++++++++++++++++++++++++++++ - 4 files changed, 184 insertions(+), 2 deletions(-) - create mode 100644 gdb/gstack.sh - create mode 100644 gdb/testsuite/gdb.base/gstack.c - create mode 100644 gdb/testsuite/gdb.base/gstack.exp diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index 17b71c6e7c..e77d6a5c03 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -1744,7 +1744,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force +@@ -1735,7 +1735,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force install: all @$(MAKE) $(FLAGS_TO_PASS) install-only @@ -85,7 +73,6 @@ index 17b71c6e7c..e77d6a5c03 100644 $(COMPILE) -DTEST_CPNAMES cp-name-parser.c diff --git a/gdb/gstack.sh b/gdb/gstack.sh new file mode 100644 -index 0000000000..f7f07248f7 --- /dev/null +++ b/gdb/gstack.sh @@ -0,0 +1,43 @@ @@ -134,7 +121,6 @@ index 0000000000..f7f07248f7 + -e '/^Thread/p' diff --git a/gdb/testsuite/gdb.base/gstack.c b/gdb/testsuite/gdb.base/gstack.c new file mode 100644 -index 0000000000..dc10813f04 --- /dev/null +++ b/gdb/testsuite/gdb.base/gstack.c @@ -0,0 +1,43 @@ @@ -183,7 +169,6 @@ index 0000000000..dc10813f04 +} diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp new file mode 100644 -index 0000000000..1186ec57bc --- /dev/null +++ b/gdb/testsuite/gdb.base/gstack.exp @@ -0,0 +1,66 @@ @@ -253,6 +238,3 @@ index 0000000000..1186ec57bc +gdb_exit + +remote_exec host "kill -9 $pid" --- -2.14.3 - diff --git a/gdb-6.3-inferior-notification-20050721.patch b/gdb-6.3-inferior-notification-20050721.patch index e19f643..90949a4 100644 --- a/gdb-6.3-inferior-notification-20050721.patch +++ b/gdb-6.3-inferior-notification-20050721.patch @@ -3,8 +3,6 @@ From: Jeff Johnston Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-inferior-notification-20050721.patch -FileName: gdb-6.3-inferior-notification-20050721.patch - ;; Notify observers that the inferior has been created ;;=fedoratest @@ -18,18 +16,9 @@ FileName: gdb-6.3-inferior-notification-20050721.patch 2007-12-26 Jan Kratochvil * gdb.base/attach-32.exp: Fix forgotten $GDBFLAGS as set. ---- - gdb/testsuite/gdb.base/attach-32.c | 20 +++ - gdb/testsuite/gdb.base/attach-32.exp | 245 +++++++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.base/attach-32b.c | 24 ++++ - 3 files changed, 289 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/attach-32.c - create mode 100644 gdb/testsuite/gdb.base/attach-32.exp - create mode 100644 gdb/testsuite/gdb.base/attach-32b.c diff --git a/gdb/testsuite/gdb.base/attach-32.c b/gdb/testsuite/gdb.base/attach-32.c new file mode 100644 -index 0000000000..0041b4732d --- /dev/null +++ b/gdb/testsuite/gdb.base/attach-32.c @@ -0,0 +1,20 @@ @@ -55,7 +44,6 @@ index 0000000000..0041b4732d +} diff --git a/gdb/testsuite/gdb.base/attach-32.exp b/gdb/testsuite/gdb.base/attach-32.exp new file mode 100644 -index 0000000000..67ded02ccf --- /dev/null +++ b/gdb/testsuite/gdb.base/attach-32.exp @@ -0,0 +1,245 @@ @@ -306,7 +294,6 @@ index 0000000000..67ded02ccf +return 0 diff --git a/gdb/testsuite/gdb.base/attach-32b.c b/gdb/testsuite/gdb.base/attach-32b.c new file mode 100644 -index 0000000000..a78037ed38 --- /dev/null +++ b/gdb/testsuite/gdb.base/attach-32b.c @@ -0,0 +1,24 @@ @@ -334,6 +321,3 @@ index 0000000000..a78037ed38 + } + return (0); +} --- -2.14.3 - diff --git a/gdb-6.3-inheritancetest-20050726.patch b/gdb-6.3-inheritancetest-20050726.patch index 953f86a..cb9f7bb 100644 --- a/gdb-6.3-inheritancetest-20050726.patch +++ b/gdb-6.3-inheritancetest-20050726.patch @@ -3,8 +3,6 @@ From: Jeff Johnston Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-inheritancetest-20050726.patch -FileName: gdb-6.3-inheritancetest-20050726.patch - ;; Verify printing of inherited members test ;;=fedoratest @@ -14,20 +12,9 @@ FileName: gdb-6.3-inheritancetest-20050726.patch * gdb.cp/b146835.cc: Ditto. * gdb.cp/b146835b.cc: Ditto. * gdb.cp/b146835.h: Ditto. ---- - gdb/testsuite/gdb.cp/b146835.cc | 32 +++++++++++++++++++++++++++ - gdb/testsuite/gdb.cp/b146835.exp | 47 ++++++++++++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.cp/b146835.h | 36 ++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.cp/b146835b.cc | 11 ++++++++++ - 4 files changed, 126 insertions(+) - create mode 100644 gdb/testsuite/gdb.cp/b146835.cc - create mode 100644 gdb/testsuite/gdb.cp/b146835.exp - create mode 100644 gdb/testsuite/gdb.cp/b146835.h - create mode 100644 gdb/testsuite/gdb.cp/b146835b.cc diff --git a/gdb/testsuite/gdb.cp/b146835.cc b/gdb/testsuite/gdb.cp/b146835.cc new file mode 100644 -index 0000000000..4161d523f5 --- /dev/null +++ b/gdb/testsuite/gdb.cp/b146835.cc @@ -0,0 +1,32 @@ @@ -65,7 +52,6 @@ index 0000000000..4161d523f5 + diff --git a/gdb/testsuite/gdb.cp/b146835.exp b/gdb/testsuite/gdb.cp/b146835.exp new file mode 100644 -index 0000000000..d03815bcff --- /dev/null +++ b/gdb/testsuite/gdb.cp/b146835.exp @@ -0,0 +1,47 @@ @@ -118,7 +104,6 @@ index 0000000000..d03815bcff +gdb_test "p d" " = \\(D \\*\\) *0x0" "Verify inherited member d accessible" diff --git a/gdb/testsuite/gdb.cp/b146835.h b/gdb/testsuite/gdb.cp/b146835.h new file mode 100644 -index 0000000000..48df7a2935 --- /dev/null +++ b/gdb/testsuite/gdb.cp/b146835.h @@ -0,0 +1,36 @@ @@ -160,7 +145,6 @@ index 0000000000..48df7a2935 +}; diff --git a/gdb/testsuite/gdb.cp/b146835b.cc b/gdb/testsuite/gdb.cp/b146835b.cc new file mode 100644 -index 0000000000..1853c1fa38 --- /dev/null +++ b/gdb/testsuite/gdb.cp/b146835b.cc @@ -0,0 +1,11 @@ @@ -175,6 +159,3 @@ index 0000000000..1853c1fa38 +void A::funcD (class E *e, class D *d) {} +void A::funcE (E *e, D *d) {} +void A::funcF (unsigned long x, D *d) {} --- -2.14.3 - diff --git a/gdb-6.3-mapping-zero-inode-test.patch b/gdb-6.3-mapping-zero-inode-test.patch index 0bc0382..9243fef 100644 --- a/gdb-6.3-mapping-zero-inode-test.patch +++ b/gdb-6.3-mapping-zero-inode-test.patch @@ -3,20 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-mapping-zero-inode-test.patch -FileName: gdb-6.3-mapping-zero-inode-test.patch - ;; Test GCORE for shmid 0 shared memory mappings. ;;=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible. ---- - gdb/testsuite/gdb.base/gcore-shmid0.c | 128 ++++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.base/gcore-shmid0.exp | 101 +++++++++++++++++++++++++ - 2 files changed, 229 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/gcore-shmid0.c - create mode 100644 gdb/testsuite/gdb.base/gcore-shmid0.exp diff --git a/gdb/testsuite/gdb.base/gcore-shmid0.c b/gdb/testsuite/gdb.base/gcore-shmid0.c new file mode 100644 -index 0000000000..bb9709a75c --- /dev/null +++ b/gdb/testsuite/gdb.base/gcore-shmid0.c @@ -0,0 +1,128 @@ @@ -150,7 +141,6 @@ index 0000000000..bb9709a75c +} diff --git a/gdb/testsuite/gdb.base/gcore-shmid0.exp b/gdb/testsuite/gdb.base/gcore-shmid0.exp new file mode 100644 -index 0000000000..b1fec682aa --- /dev/null +++ b/gdb/testsuite/gdb.base/gcore-shmid0.exp @@ -0,0 +1,101 @@ @@ -255,6 +245,3 @@ index 0000000000..b1fec682aa + fail $test + } +} --- -2.14.3 - diff --git a/gdb-6.3-ppc64displaysymbol-20041124.patch b/gdb-6.3-ppc64displaysymbol-20041124.patch index cd3d34b..cad389a 100644 --- a/gdb-6.3-ppc64displaysymbol-20041124.patch +++ b/gdb-6.3-ppc64displaysymbol-20041124.patch @@ -3,8 +3,6 @@ From: Andrew Cagney Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-ppc64displaysymbol-20041124.patch -FileName: 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. @@ -13,15 +11,11 @@ FileName: gdb-6.3-ppc64displaysymbol-20041124.patch * printcmd.c (build_address_symbolic): Find a section for the address. ---- - gdb/printcmd.c | 8 ++++++++ - 1 file changed, 8 insertions(+) diff --git a/gdb/printcmd.c b/gdb/printcmd.c -index 6256f35baa..c52e39f7fc 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c -@@ -602,6 +602,14 @@ build_address_symbolic (struct gdbarch *gdbarch, +@@ -587,6 +587,14 @@ build_address_symbolic (struct gdbarch *gdbarch, addr = overlay_mapped_address (addr, section); } } @@ -36,6 +30,3 @@ index 6256f35baa..c52e39f7fc 100644 /* First try to find the address in the symbol table, then in the minsyms. Take the closest one. */ --- -2.14.3 - diff --git a/gdb-6.3-ppc64syscall-20040622.patch b/gdb-6.3-ppc64syscall-20040622.patch index 9d95a4d..35ced5e 100644 --- a/gdb-6.3-ppc64syscall-20040622.patch +++ b/gdb-6.3-ppc64syscall-20040622.patch @@ -3,8 +3,6 @@ From: Andrew Cagney Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-ppc64syscall-20040622.patch -FileName: gdb-6.3-ppc64syscall-20040622.patch - ;; Better parse 64-bit PPC system call prologues. ;;=push: Write new testcase. @@ -15,12 +13,8 @@ FileName: gdb-6.3-ppc64syscall-20040622.patch "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". ---- - gdb/rs6000-tdep.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c -index e5a265dbcb..23d0db3b8f 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -134,6 +134,7 @@ static const char *powerpc_vector_abi_string = "auto"; @@ -31,7 +25,7 @@ index e5a265dbcb..23d0db3b8f 100644 int offset; /* total size of frame --- the distance by which we decrement sp to allocate the frame */ -@@ -1577,7 +1578,6 @@ static CORE_ADDR +@@ -1426,7 +1427,6 @@ static CORE_ADDR skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) { @@ -39,7 +33,7 @@ index e5a265dbcb..23d0db3b8f 100644 CORE_ADDR last_prologue_pc = pc; CORE_ADDR li_found_pc = 0; gdb_byte buf[4]; -@@ -1595,12 +1595,14 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, +@@ -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; @@ -54,7 +48,7 @@ index e5a265dbcb..23d0db3b8f 100644 fdata->saved_gpr = -1; fdata->saved_fpr = -1; fdata->saved_vr = -1; -@@ -1634,6 +1636,55 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, +@@ -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); @@ -110,7 +104,7 @@ index e5a265dbcb..23d0db3b8f 100644 if ((op & 0xfc1fffff) == 0x7c0802a6) { /* mflr Rx */ /* Since shared library / PIC code, which needs to get its -@@ -1825,9 +1876,9 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, +@@ -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. */ @@ -122,6 +116,3 @@ index e5a265dbcb..23d0db3b8f 100644 struct symtab_and_line this_sal = find_pc_line (pc, 0); if ((prologue_sal.line == 0) --- -2.14.3 - diff --git a/gdb-6.3-readnever-20050907.patch b/gdb-6.3-readnever-20050907.patch index f08a15f..ec7b4b9 100644 --- a/gdb-6.3-readnever-20050907.patch +++ b/gdb-6.3-readnever-20050907.patch @@ -3,8 +3,6 @@ From: Andrew Cagney Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-readnever-20050907.patch -FileName: gdb-6.3-readnever-20050907.patch - ;; Add readnever option ;;=push @@ -22,23 +20,16 @@ FileName: gdb-6.3-readnever-20050907.patch * gdb.texinfo (File Options): Document --readnever. Pushed upstream: https://sourceware.org/ml/gdb-cvs/2017-12/msg00007.html ---- - gdb/gcore.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/gcore.in b/gdb/gcore.in -index b7f57cd341..c7e0dec574 100644 --- a/gdb/gcore.in +++ b/gdb/gcore.in -@@ -97,7 +97,7 @@ for pid in $* +@@ -97,7 +97,7 @@ for pid in "$@" do # ` Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb.gdb/selftest.exp: Add matching on specific Red Hat only version - string - -FileName: gdb-6.3-rh-testversion-20041202.patch +Subject: gdb-6.3-rh-testversion-20041202.patch ;; Match the Fedora's version info. ;;=fedora @@ -13,12 +10,8 @@ FileName: gdb-6.3-rh-testversion-20041202.patch * gdb.gdb/selftest.exp: Add matching on specific Red Hat only version string. ---- - gdb/testsuite/gdb.gdb/selftest.exp | 3 +++ - 1 file changed, 3 insertions(+) diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp -index 20f34983ef..4108e088a9 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp @@ -53,6 +53,9 @@ proc test_with_self { } { @@ -31,6 +24,3 @@ index 20f34983ef..4108e088a9 100644 } # start the "xgdb" process --- -2.14.3 - diff --git a/gdb-6.3-test-dtorfix-20050121.patch b/gdb-6.3-test-dtorfix-20050121.patch index 1e5f91d..f9324d6 100644 --- a/gdb-6.3-test-dtorfix-20050121.patch +++ b/gdb-6.3-test-dtorfix-20050121.patch @@ -3,20 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-test-dtorfix-20050121.patch -FileName: gdb-6.3-test-dtorfix-20050121.patch - ;; Test support of multiple destructors just like multiple constructors ;;=fedoratest ---- - gdb/testsuite/gdb.cp/constructortest.cc | 99 +++++++++++++++++++++++ - gdb/testsuite/gdb.cp/constructortest.exp | 130 +++++++++++++++++++++++++++++++ - 2 files changed, 229 insertions(+) - create mode 100644 gdb/testsuite/gdb.cp/constructortest.cc - create mode 100644 gdb/testsuite/gdb.cp/constructortest.exp diff --git a/gdb/testsuite/gdb.cp/constructortest.cc b/gdb/testsuite/gdb.cp/constructortest.cc new file mode 100644 -index 0000000000..9ac8793e50 --- /dev/null +++ b/gdb/testsuite/gdb.cp/constructortest.cc @@ -0,0 +1,99 @@ @@ -121,7 +112,6 @@ index 0000000000..9ac8793e50 +} diff --git a/gdb/testsuite/gdb.cp/constructortest.exp b/gdb/testsuite/gdb.cp/constructortest.exp new file mode 100644 -index 0000000000..341f6c99ad --- /dev/null +++ b/gdb/testsuite/gdb.cp/constructortest.exp @@ -0,0 +1,130 @@ @@ -255,6 +245,3 @@ index 0000000000..341f6c99ad +} + +gdb_continue_to_breakpoint "First line ~C" --- -2.14.3 - diff --git a/gdb-6.3-test-movedir-20050125.patch b/gdb-6.3-test-movedir-20050125.patch index 4d3d59a..06602b2 100644 --- a/gdb-6.3-test-movedir-20050125.patch +++ b/gdb-6.3-test-movedir-20050125.patch @@ -3,8 +3,6 @@ From: Elena Zannoni Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-test-movedir-20050125.patch -FileName: gdb-6.3-test-movedir-20050125.patch - ;; Fix to support executable moving ;;=fedoratest @@ -13,18 +11,9 @@ FileName: gdb-6.3-test-movedir-20050125.patch * gdb.base/move-dir.exp: New test. * gdb.base/move-dir.c: Ditto. * gdb.base/move-dir.h: Ditto. ---- - gdb/testsuite/gdb.base/move-dir.c | 10 +++++++ - gdb/testsuite/gdb.base/move-dir.exp | 57 +++++++++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.base/move-dir.h | 7 +++++ - 3 files changed, 74 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/move-dir.c - create mode 100644 gdb/testsuite/gdb.base/move-dir.exp - create mode 100644 gdb/testsuite/gdb.base/move-dir.h diff --git a/gdb/testsuite/gdb.base/move-dir.c b/gdb/testsuite/gdb.base/move-dir.c new file mode 100644 -index 0000000000..89b65b4b6a --- /dev/null +++ b/gdb/testsuite/gdb.base/move-dir.c @@ -0,0 +1,10 @@ @@ -40,7 +29,6 @@ index 0000000000..89b65b4b6a + diff --git a/gdb/testsuite/gdb.base/move-dir.exp b/gdb/testsuite/gdb.base/move-dir.exp new file mode 100644 -index 0000000000..f189ea77b9 --- /dev/null +++ b/gdb/testsuite/gdb.base/move-dir.exp @@ -0,0 +1,57 @@ @@ -103,7 +91,6 @@ index 0000000000..f189ea77b9 +return 0 diff --git a/gdb/testsuite/gdb.base/move-dir.h b/gdb/testsuite/gdb.base/move-dir.h new file mode 100644 -index 0000000000..4a99725a00 --- /dev/null +++ b/gdb/testsuite/gdb.base/move-dir.h @@ -0,0 +1,7 @@ @@ -114,6 +101,3 @@ index 0000000000..4a99725a00 + printf ("%s\n", ostring);; +} + --- -2.14.3 - diff --git a/gdb-6.3-test-pie-20050107.patch b/gdb-6.3-test-pie-20050107.patch index 7ec7754..09b6726 100644 --- a/gdb-6.3-test-pie-20050107.patch +++ b/gdb-6.3-test-pie-20050107.patch @@ -3,32 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-test-pie-20050107.patch -FileName: gdb-6.3-test-pie-20050107.patch - ;; VSYSCALL and PIE ;;=fedoratest ---- - gdb/testsuite/gdb.pie/attach.c | 20 + - gdb/testsuite/gdb.pie/attach.exp | 416 ++++++++++++++++ - gdb/testsuite/gdb.pie/attach2.c | 24 + - gdb/testsuite/gdb.pie/break.c | 146 ++++++ - gdb/testsuite/gdb.pie/break.exp | 954 +++++++++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.pie/break1.c | 44 ++ - gdb/testsuite/gdb.pie/corefile.exp | 233 +++++++++ - gdb/testsuite/gdb.pie/coremaker.c | 142 ++++++ - 8 files changed, 1979 insertions(+) - create mode 100644 gdb/testsuite/gdb.pie/attach.c - create mode 100644 gdb/testsuite/gdb.pie/attach.exp - create mode 100644 gdb/testsuite/gdb.pie/attach2.c - create mode 100644 gdb/testsuite/gdb.pie/break.c - create mode 100644 gdb/testsuite/gdb.pie/break.exp - create mode 100644 gdb/testsuite/gdb.pie/break1.c - create mode 100644 gdb/testsuite/gdb.pie/corefile.exp - create mode 100644 gdb/testsuite/gdb.pie/coremaker.c diff --git a/gdb/testsuite/gdb.pie/attach.c b/gdb/testsuite/gdb.pie/attach.c new file mode 100644 -index 0000000000..0041b4732d --- /dev/null +++ b/gdb/testsuite/gdb.pie/attach.c @@ -0,0 +1,20 @@ @@ -54,7 +33,6 @@ index 0000000000..0041b4732d +} diff --git a/gdb/testsuite/gdb.pie/attach.exp b/gdb/testsuite/gdb.pie/attach.exp new file mode 100644 -index 0000000000..648c92608c --- /dev/null +++ b/gdb/testsuite/gdb.pie/attach.exp @@ -0,0 +1,416 @@ @@ -476,7 +454,6 @@ index 0000000000..648c92608c +return 0 diff --git a/gdb/testsuite/gdb.pie/attach2.c b/gdb/testsuite/gdb.pie/attach2.c new file mode 100644 -index 0000000000..a78037ed38 --- /dev/null +++ b/gdb/testsuite/gdb.pie/attach2.c @@ -0,0 +1,24 @@ @@ -506,7 +483,6 @@ index 0000000000..a78037ed38 +} diff --git a/gdb/testsuite/gdb.pie/break.c b/gdb/testsuite/gdb.pie/break.c new file mode 100644 -index 0000000000..bf398fcca9 --- /dev/null +++ b/gdb/testsuite/gdb.pie/break.c @@ -0,0 +1,146 @@ @@ -658,7 +634,6 @@ index 0000000000..bf398fcca9 +} diff --git a/gdb/testsuite/gdb.pie/break.exp b/gdb/testsuite/gdb.pie/break.exp new file mode 100644 -index 0000000000..97b87397c2 --- /dev/null +++ b/gdb/testsuite/gdb.pie/break.exp @@ -0,0 +1,954 @@ @@ -1618,7 +1593,6 @@ index 0000000000..97b87397c2 +} diff --git a/gdb/testsuite/gdb.pie/break1.c b/gdb/testsuite/gdb.pie/break1.c new file mode 100644 -index 0000000000..2ed8b2a4a0 --- /dev/null +++ b/gdb/testsuite/gdb.pie/break1.c @@ -0,0 +1,44 @@ @@ -1668,7 +1642,6 @@ index 0000000000..2ed8b2a4a0 +#endif diff --git a/gdb/testsuite/gdb.pie/corefile.exp b/gdb/testsuite/gdb.pie/corefile.exp new file mode 100644 -index 0000000000..ca4b01be3e --- /dev/null +++ b/gdb/testsuite/gdb.pie/corefile.exp @@ -0,0 +1,233 @@ @@ -1907,7 +1880,6 @@ index 0000000000..ca4b01be3e +gdb_test "core" "No core file now." diff --git a/gdb/testsuite/gdb.pie/coremaker.c b/gdb/testsuite/gdb.pie/coremaker.c new file mode 100644 -index 0000000000..a7fbd94141 --- /dev/null +++ b/gdb/testsuite/gdb.pie/coremaker.c @@ -0,0 +1,142 @@ @@ -2053,6 +2025,3 @@ index 0000000000..a7fbd94141 + return 0; +} + --- -2.14.3 - diff --git a/gdb-6.3-test-self-20050110.patch b/gdb-6.3-test-self-20050110.patch index ab89cac..bfec58c 100644 --- a/gdb-6.3-test-self-20050110.patch +++ b/gdb-6.3-test-self-20050110.patch @@ -3,8 +3,6 @@ From: Elena Zannoni Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-test-self-20050110.patch -FileName: gdb-6.3-test-self-20050110.patch - ;; Get selftest working with sep-debug-info ;;=fedoratest @@ -15,15 +13,11 @@ FileName: gdb-6.3-test-self-20050110.patch * gdb.gdb/complaints.exp: Ditto. * gdb.gdb/xfullpath.exp: Ditto. * gdb.gdb/observer.exp: Ditto. ---- - gdb/testsuite/lib/selftest-support.exp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp -index 89e2e3f4ef..ea027a6f7d 100644 --- a/gdb/testsuite/lib/selftest-support.exp +++ b/gdb/testsuite/lib/selftest-support.exp -@@ -156,18 +156,18 @@ proc do_self_tests {function body} { +@@ -151,18 +151,18 @@ proc do_self_tests {function body} { } # Remove any old copy lying around. @@ -46,6 +40,3 @@ index 89e2e3f4ef..ea027a6f7d 100644 if {$result < 0} then { warning "Couldn't test self" --- -2.14.3 - diff --git a/gdb-6.3-threaded-watchpoints2-20050225.patch b/gdb-6.3-threaded-watchpoints2-20050225.patch index 40c2663..8e5c1a1 100644 --- a/gdb-6.3-threaded-watchpoints2-20050225.patch +++ b/gdb-6.3-threaded-watchpoints2-20050225.patch @@ -3,8 +3,6 @@ From: Jeff Johnston Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-threaded-watchpoints2-20050225.patch -FileName: gdb-6.3-threaded-watchpoints2-20050225.patch - ;; Test sibling threads to set threaded watchpoints for x86 and x86-64 ;;=fedoratest @@ -51,16 +49,9 @@ FileName: gdb-6.3-threaded-watchpoints2-20050225.patch testcase of the same name. ] FIXME: The testcase does not expects multiple watchpoints hits per one stop. ---- - gdb/testsuite/gdb.threads/watchthreads-threaded.c | 66 +++++++++++ - .../gdb.threads/watchthreads-threaded.exp | 126 +++++++++++++++++++++ - 2 files changed, 192 insertions(+) - create mode 100644 gdb/testsuite/gdb.threads/watchthreads-threaded.c - create mode 100644 gdb/testsuite/gdb.threads/watchthreads-threaded.exp diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.c b/gdb/testsuite/gdb.threads/watchthreads-threaded.c new file mode 100644 -index 0000000000..1402640ccf --- /dev/null +++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.c @@ -0,0 +1,66 @@ @@ -132,7 +123,6 @@ index 0000000000..1402640ccf + diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.exp b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp new file mode 100644 -index 0000000000..e9cdd59771 --- /dev/null +++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp @@ -0,0 +1,126 @@ @@ -262,6 +252,3 @@ index 0000000000..e9cdd59771 +} else { + fail $message +} --- -2.14.3 - diff --git a/gdb-6.5-BEA-testsuite.patch b/gdb-6.5-BEA-testsuite.patch index 36fdc93..2d3a08c 100644 --- a/gdb-6.5-BEA-testsuite.patch +++ b/gdb-6.5-BEA-testsuite.patch @@ -3,24 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-BEA-testsuite.patch -FileName: gdb-6.5-BEA-testsuite.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. ---- - gdb/testsuite/gdb.threads/threadcrash.c | 301 ++++++++++++++++++++++++ - gdb/testsuite/gdb.threads/threadcrash.exp | 37 +++ - gdb/testsuite/gdb.threads/threadcrash.sh | 324 ++++++++++++++++++++++++++ - gdb/testsuite/gdb.threads/threadcrash.sh-orig | 248 ++++++++++++++++++++ - 4 files changed, 910 insertions(+) - create mode 100644 gdb/testsuite/gdb.threads/threadcrash.c - create mode 100644 gdb/testsuite/gdb.threads/threadcrash.exp - create mode 100644 gdb/testsuite/gdb.threads/threadcrash.sh - create mode 100644 gdb/testsuite/gdb.threads/threadcrash.sh-orig diff --git a/gdb/testsuite/gdb.threads/threadcrash.c b/gdb/testsuite/gdb.threads/threadcrash.c new file mode 100644 -index 0000000000..80c599d0fb --- /dev/null +++ b/gdb/testsuite/gdb.threads/threadcrash.c @@ -0,0 +1,301 @@ @@ -327,7 +314,6 @@ index 0000000000..80c599d0fb +} diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp new file mode 100644 -index 0000000000..af6b919f58 --- /dev/null +++ b/gdb/testsuite/gdb.threads/threadcrash.exp @@ -0,0 +1,37 @@ @@ -370,7 +356,6 @@ index 0000000000..af6b919f58 +return 0 diff --git a/gdb/testsuite/gdb.threads/threadcrash.sh b/gdb/testsuite/gdb.threads/threadcrash.sh new file mode 100644 -index 0000000000..7f7e6520d6 --- /dev/null +++ b/gdb/testsuite/gdb.threads/threadcrash.sh @@ -0,0 +1,324 @@ @@ -700,7 +685,6 @@ index 0000000000..7f7e6520d6 +exit $FAILURES diff --git a/gdb/testsuite/gdb.threads/threadcrash.sh-orig b/gdb/testsuite/gdb.threads/threadcrash.sh-orig new file mode 100644 -index 0000000000..eb602036c2 --- /dev/null +++ b/gdb/testsuite/gdb.threads/threadcrash.sh-orig @@ -0,0 +1,248 @@ @@ -952,6 +936,3 @@ index 0000000000..eb602036c2 +rm -rf $WORKDIR + +exit $FAILURES --- -2.14.3 - diff --git a/gdb-6.5-bz109921-DW_AT_decl_file-test.patch b/gdb-6.5-bz109921-DW_AT_decl_file-test.patch index 8d0382c..463b9cf 100644 --- a/gdb-6.5-bz109921-DW_AT_decl_file-test.patch +++ b/gdb-6.5-bz109921-DW_AT_decl_file-test.patch @@ -3,8 +3,6 @@ From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz109921-DW_AT_decl_file-test.patch -FileName: gdb-6.5-bz109921-DW_AT_decl_file-test.patch - ;; Find symbols properly at their original (included) file (BZ 109921). ;;=fedoratest @@ -25,18 +23,9 @@ http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html * gdb.dwarf2/dw2-included.exp, gdb.dwarf2/dw2-included.c, gdb.dwarf2/dw2-included.h: New files. ---- - gdb/testsuite/gdb.dwarf2/dw2-included.c | 26 +++++++++++++++++ - gdb/testsuite/gdb.dwarf2/dw2-included.exp | 47 +++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.dwarf2/dw2-included.h | 20 +++++++++++++ - 3 files changed, 93 insertions(+) - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-included.c - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-included.exp - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-included.h diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.c b/gdb/testsuite/gdb.dwarf2/dw2-included.c new file mode 100644 -index 0000000000..28e54fb932 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-included.c @@ -0,0 +1,26 @@ @@ -68,7 +57,6 @@ index 0000000000..28e54fb932 +} diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.exp b/gdb/testsuite/gdb.dwarf2/dw2-included.exp new file mode 100644 -index 0000000000..9aaf8e9772 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-included.exp @@ -0,0 +1,47 @@ @@ -118,10 +106,9 @@ index 0000000000..9aaf8e9772 +gdb_test "list integer" "int integer;\r" +gdb_test "ptype integer" "type = int\r" +# Path varies depending on the build location. -+gdb_test "info variables integer" "\r\nFile \[^\r\n\]*/gdb.dwarf2/dw2-included.h:\r\nint integer;\r" ++gdb_test "info variables integer" "\r\nFile \[^\r\n\]*/gdb.dwarf2/dw2-included.h:\r\n${decimal}:.*int integer;\r" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.h b/gdb/testsuite/gdb.dwarf2/dw2-included.h new file mode 100644 -index 0000000000..f31348ab4f --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-included.h @@ -0,0 +1,20 @@ @@ -145,6 +132,3 @@ index 0000000000..f31348ab4f + USA. */ + +int integer; --- -2.14.3 - 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 33b2d1a..6626a45 100644 --- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch @@ -3,8 +3,6 @@ From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch -FileName: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch - ;; Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337). ;;=push+jan: It should be replaced by Infinity project. @@ -42,23 +40,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1166549 glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug: <81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location <81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location ---- - gdb/printcmd.c | 4 ++ - gdb/testsuite/gdb.dwarf2/dw2-errno.c | 28 +++++++++++++ - gdb/testsuite/gdb.dwarf2/dw2-errno.exp | 60 ++++++++++++++++++++++++++++ - gdb/testsuite/gdb.dwarf2/dw2-errno2.c | 28 +++++++++++++ - gdb/testsuite/gdb.dwarf2/dw2-errno2.exp | 71 +++++++++++++++++++++++++++++++++ - 5 files changed, 191 insertions(+) - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno.c - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno.exp - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno2.c - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno2.exp diff --git a/gdb/printcmd.c b/gdb/printcmd.c -index c52e39f7fc..ad80b1bebf 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c -@@ -1210,6 +1210,10 @@ print_command_1 (const char *exp, int voidprint) +@@ -1190,6 +1190,10 @@ print_command_1 (const char *exp, int voidprint) if (exp && *exp) { @@ -71,7 +57,6 @@ index c52e39f7fc..ad80b1bebf 100644 } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.c b/gdb/testsuite/gdb.dwarf2/dw2-errno.c new file mode 100644 -index 0000000000..7bd10d0978 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.c @@ -0,0 +1,28 @@ @@ -105,7 +90,6 @@ index 0000000000..7bd10d0978 +} diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp new file mode 100644 -index 0000000000..1f13cc1323 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp @@ -0,0 +1,60 @@ @@ -171,7 +155,6 @@ index 0000000000..1f13cc1323 +# Just how to find the current libc filename? diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.c b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c new file mode 100644 -index 0000000000..7bd10d0978 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c @@ -0,0 +1,28 @@ @@ -205,7 +188,6 @@ index 0000000000..7bd10d0978 +} diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp new file mode 100644 -index 0000000000..0f6e66870b --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp @@ -0,0 +1,71 @@ @@ -280,6 +262,3 @@ index 0000000000..0f6e66870b + +# TODO: Test the error on resolving ERRNO with only libc loaded. +# Just how to find the current libc filename? --- -2.14.3 - diff --git a/gdb-6.5-bz203661-emit-relocs.patch b/gdb-6.5-bz203661-emit-relocs.patch index 6ca0441..7b2b030 100644 --- a/gdb-6.5-bz203661-emit-relocs.patch +++ b/gdb-6.5-bz203661-emit-relocs.patch @@ -3,19 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz203661-emit-relocs.patch -FileName: 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. ---- - gdb/symfile.c | 6 ++++++ - 1 file changed, 6 insertions(+) diff --git a/gdb/symfile.c b/gdb/symfile.c -index f7f75b05d3..7cda615e74 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c -@@ -3629,6 +3629,12 @@ default_symfile_relocate (struct objfile *objfile, asection *sectp, +@@ -3584,6 +3584,12 @@ default_symfile_relocate (struct objfile *objfile, asection *sectp, DWO file. */ bfd *abfd = sectp->owner; @@ -28,6 +22,3 @@ index f7f75b05d3..7cda615e74 100644 /* We're only interested in sections with relocation information. */ if ((sectp->flags & SEC_RELOC) == 0) --- -2.14.3 - diff --git a/gdb-6.5-bz216711-clone-is-outermost.patch b/gdb-6.5-bz216711-clone-is-outermost.patch index 19c2bf6..fb0d7fe 100644 --- a/gdb-6.5-bz216711-clone-is-outermost.patch +++ b/gdb-6.5-bz216711-clone-is-outermost.patch @@ -3,8 +3,6 @@ From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz216711-clone-is-outermost.patch -FileName: gdb-6.5-bz216711-clone-is-outermost.patch - ;; Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711). ;;=fedora @@ -32,19 +30,8 @@ instead. 2007-10-16 Jan Kratochvil Port to GDB-6.7. ---- - gdb/amd64-linux-tdep.c | 76 +++++++++++++++++++++++++++++ - gdb/amd64-tdep.c | 11 +++++ - gdb/i386-tdep.c | 3 ++ - gdb/i386-tdep.h | 3 ++ - gdb/testsuite/gdb.threads/bt-clone-stop.c | 39 +++++++++++++++ - gdb/testsuite/gdb.threads/bt-clone-stop.exp | 61 +++++++++++++++++++++++ - 6 files changed, 193 insertions(+) - create mode 100644 gdb/testsuite/gdb.threads/bt-clone-stop.c - create mode 100644 gdb/testsuite/gdb.threads/bt-clone-stop.exp diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c -index 2bd3d31b75..2623bae42d 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -291,6 +291,80 @@ amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum, @@ -128,7 +115,7 @@ index 2bd3d31b75..2623bae42d 100644 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; @@ -138,7 +125,6 @@ index 2bd3d31b75..2623bae42d 100644 set_gdbarch_write_pc (gdbarch, amd64_linux_write_pc); diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c -index 7b2851f0a6..7c70792b3f 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -2595,6 +2595,7 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame, @@ -181,10 +167,9 @@ index 7b2851f0a6..7c70792b3f 100644 (*this_id) = frame_id_build (cache->base + 16, get_frame_pc (this_frame)); } diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c -index 9ce329eb20..d1b461b538 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c -@@ -8401,6 +8401,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) +@@ -8406,6 +8406,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->xsave_xcr0_offset = -1; @@ -193,9 +178,8 @@ index 9ce329eb20..d1b461b538 100644 + tdep->record_regmap = i386_record_regmap; - set_gdbarch_long_long_align_bit (gdbarch, 32); + set_gdbarch_type_align (gdbarch, i386_type_align); diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h -index a71c103a88..5ee336b8cb 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -251,6 +251,9 @@ struct gdbarch_tdep @@ -210,7 +194,6 @@ index a71c103a88..5ee336b8cb 100644 /* Floating-point registers. */ diff --git a/gdb/testsuite/gdb.threads/bt-clone-stop.c b/gdb/testsuite/gdb.threads/bt-clone-stop.c new file mode 100644 -index 0000000000..2ac93f8664 --- /dev/null +++ b/gdb/testsuite/gdb.threads/bt-clone-stop.c @@ -0,0 +1,39 @@ @@ -255,7 +238,6 @@ index 0000000000..2ac93f8664 +} diff --git a/gdb/testsuite/gdb.threads/bt-clone-stop.exp b/gdb/testsuite/gdb.threads/bt-clone-stop.exp new file mode 100644 -index 0000000000..02728e05b9 --- /dev/null +++ b/gdb/testsuite/gdb.threads/bt-clone-stop.exp @@ -0,0 +1,61 @@ @@ -320,6 +302,3 @@ index 0000000000..02728e05b9 + pass "0x0 entry not found" + } +} --- -2.14.3 - diff --git a/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch b/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch index 6f752de..807e82e 100644 --- a/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +++ b/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch @@ -3,22 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch -FileName: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch - ;; Test sideeffects of skipping ppc .so libs trampolines (BZ 218379). ;;=fedoratest https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379 ---- - gdb/testsuite/gdb.base/step-over-trampoline.c | 28 +++++++++++++ - gdb/testsuite/gdb.base/step-over-trampoline.exp | 54 +++++++++++++++++++++++++ - 2 files changed, 82 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/step-over-trampoline.c - create mode 100644 gdb/testsuite/gdb.base/step-over-trampoline.exp diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.c b/gdb/testsuite/gdb.base/step-over-trampoline.c new file mode 100644 -index 0000000000..a012da1031 --- /dev/null +++ b/gdb/testsuite/gdb.base/step-over-trampoline.c @@ -0,0 +1,28 @@ @@ -52,7 +43,6 @@ index 0000000000..a012da1031 +} diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.exp b/gdb/testsuite/gdb.base/step-over-trampoline.exp new file mode 100644 -index 0000000000..a183e36263 --- /dev/null +++ b/gdb/testsuite/gdb.base/step-over-trampoline.exp @@ -0,0 +1,54 @@ @@ -110,6 +100,3 @@ index 0000000000..a183e36263 + fail "stepped into trampoline" + } +} --- -2.14.3 - 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 ef00fe6..66bee15 100644 --- a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +++ b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch @@ -3,21 +3,15 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch -FileName: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch - ;; Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379). ;;=fedora https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379 ---- - gdb/symtab.c | 7 +++++++ - 1 file changed, 7 insertions(+) diff --git a/gdb/symtab.c b/gdb/symtab.c -index 81f4fc9ec5..a7e8431cfe 100644 --- 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) +@@ -3165,6 +3165,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) SYMBOL_LINKAGE_NAME (msymbol)); */ ; /* fall through */ @@ -31,6 +25,3 @@ index 81f4fc9ec5..a7e8431cfe 100644 else return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0); } --- -2.14.3 - diff --git a/gdb-6.5-bz243845-stale-testing-zombie-test.patch b/gdb-6.5-bz243845-stale-testing-zombie-test.patch index baf2353..1a93b6d 100644 --- a/gdb-6.5-bz243845-stale-testing-zombie-test.patch +++ b/gdb-6.5-bz243845-stale-testing-zombie-test.patch @@ -3,18 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-bz243845-stale-testing-zombie-test.patch -FileName: gdb-6.5-bz243845-stale-testing-zombie-test.patch - ;; Test leftover zombie process (BZ 243845). ;;=fedoratest ---- - gdb/testsuite/gdb.base/tracefork-zombie.exp | 75 +++++++++++++++++++++++++++++ - 1 file changed, 75 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/tracefork-zombie.exp diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.base/tracefork-zombie.exp new file mode 100644 -index 0000000000..5807040840 --- /dev/null +++ b/gdb/testsuite/gdb.base/tracefork-zombie.exp @@ -0,0 +1,75 @@ @@ -93,6 +86,3 @@ index 0000000000..5807040840 +} else { + fail $test +} --- -2.14.3 - diff --git a/gdb-6.5-gcore-buffer-limit-test.patch b/gdb-6.5-gcore-buffer-limit-test.patch index 4cf4c51..00a1300 100644 --- a/gdb-6.5-gcore-buffer-limit-test.patch +++ b/gdb-6.5-gcore-buffer-limit-test.patch @@ -3,20 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-gcore-buffer-limit-test.patch -FileName: gdb-6.5-gcore-buffer-limit-test.patch - ;; Test gcore memory and time requirements for large inferiors. ;;=fedoratest ---- - gdb/testsuite/gdb.base/gcore-excessive-memory.c | 37 +++++++++ - gdb/testsuite/gdb.base/gcore-excessive-memory.exp | 94 +++++++++++++++++++++++ - 2 files changed, 131 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/gcore-excessive-memory.c - create mode 100644 gdb/testsuite/gdb.base/gcore-excessive-memory.exp diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.c b/gdb/testsuite/gdb.base/gcore-excessive-memory.c new file mode 100644 -index 0000000000..56b4d3a63a --- /dev/null +++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.c @@ -0,0 +1,37 @@ @@ -59,7 +50,6 @@ index 0000000000..56b4d3a63a +} diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.exp b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp new file mode 100644 -index 0000000000..4e71b5534e --- /dev/null +++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp @@ -0,0 +1,94 @@ @@ -157,6 +147,3 @@ index 0000000000..4e71b5534e + +# Cleanup. +exec kill -9 $pid_of_bin --- -2.14.3 - diff --git a/gdb-6.5-ia64-libunwind-leak-test.patch b/gdb-6.5-ia64-libunwind-leak-test.patch index 41315e6..5ae1607 100644 --- a/gdb-6.5-ia64-libunwind-leak-test.patch +++ b/gdb-6.5-ia64-libunwind-leak-test.patch @@ -3,20 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-ia64-libunwind-leak-test.patch -FileName: gdb-6.5-ia64-libunwind-leak-test.patch - ;; Test ia64 memory leaks of the code using libunwind. ;;=fedoratest ---- - gdb/testsuite/gdb.base/unwind-leak.c | 29 ++++++++++++ - gdb/testsuite/gdb.base/unwind-leak.exp | 83 ++++++++++++++++++++++++++++++++++ - 2 files changed, 112 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/unwind-leak.c - create mode 100644 gdb/testsuite/gdb.base/unwind-leak.exp diff --git a/gdb/testsuite/gdb.base/unwind-leak.c b/gdb/testsuite/gdb.base/unwind-leak.c new file mode 100644 -index 0000000000..58e34fb264 --- /dev/null +++ b/gdb/testsuite/gdb.base/unwind-leak.c @@ -0,0 +1,29 @@ @@ -51,7 +42,6 @@ index 0000000000..58e34fb264 +} diff --git a/gdb/testsuite/gdb.base/unwind-leak.exp b/gdb/testsuite/gdb.base/unwind-leak.exp new file mode 100644 -index 0000000000..098962a57c --- /dev/null +++ b/gdb/testsuite/gdb.base/unwind-leak.exp @@ -0,0 +1,83 @@ @@ -138,6 +128,3 @@ index 0000000000..098962a57c + fail $test + } +} --- -2.14.3 - diff --git a/gdb-6.5-last-address-space-byte-test.patch b/gdb-6.5-last-address-space-byte-test.patch index 297b381..42e3bf4 100644 --- a/gdb-6.5-last-address-space-byte-test.patch +++ b/gdb-6.5-last-address-space-byte-test.patch @@ -3,18 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-last-address-space-byte-test.patch -FileName: gdb-6.5-last-address-space-byte-test.patch - ;; Testcase for deadlocking on last address space byte; for corrupted backtraces. ;;=fedoratest ---- - .../gdb.base/largecore-last-address-lock.exp | 49 ++++++++++++++++++++++ - 1 file changed, 49 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/largecore-last-address-lock.exp diff --git a/gdb/testsuite/gdb.base/largecore-last-address-lock.exp b/gdb/testsuite/gdb.base/largecore-last-address-lock.exp new file mode 100644 -index 0000000000..8a597e9b15 --- /dev/null +++ b/gdb/testsuite/gdb.base/largecore-last-address-lock.exp @@ -0,0 +1,49 @@ @@ -67,6 +60,3 @@ index 0000000000..8a597e9b15 + "Read the last address space byte" + +set timeout ${timeoutold} --- -2.14.3 - diff --git a/gdb-6.5-missed-trap-on-step-test.patch b/gdb-6.5-missed-trap-on-step-test.patch index bd111aa..558c411 100644 --- a/gdb-6.5-missed-trap-on-step-test.patch +++ b/gdb-6.5-missed-trap-on-step-test.patch @@ -3,23 +3,14 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-missed-trap-on-step-test.patch -FileName: gdb-6.5-missed-trap-on-step-test.patch - ;; Test hiding unexpected breakpoints on intentional step commands. ;;=fedoratest Fix has been committed to: gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch ---- - gdb/testsuite/gdb.base/watchpoint-during-step.c | 30 ++++++++++++++++ - gdb/testsuite/gdb.base/watchpoint-during-step.exp | 44 +++++++++++++++++++++++ - 2 files changed, 74 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/watchpoint-during-step.c - create mode 100644 gdb/testsuite/gdb.base/watchpoint-during-step.exp diff --git a/gdb/testsuite/gdb.base/watchpoint-during-step.c b/gdb/testsuite/gdb.base/watchpoint-during-step.c new file mode 100644 -index 0000000000..107eae45a0 --- /dev/null +++ b/gdb/testsuite/gdb.base/watchpoint-during-step.c @@ -0,0 +1,30 @@ @@ -55,7 +46,6 @@ index 0000000000..107eae45a0 +} diff --git a/gdb/testsuite/gdb.base/watchpoint-during-step.exp b/gdb/testsuite/gdb.base/watchpoint-during-step.exp new file mode 100644 -index 0000000000..12ba99f1a9 --- /dev/null +++ b/gdb/testsuite/gdb.base/watchpoint-during-step.exp @@ -0,0 +1,44 @@ @@ -103,6 +93,3 @@ index 0000000000..12ba99f1a9 +# we step from as in this case it is a valid upstream KFAIL gdb/38 + +gdb_test "step" ".*Old value = 2.*New value = 3.*" "Catch the watchpoint" --- -2.14.3 - diff --git a/gdb-6.5-readline-long-line-crash-test.patch b/gdb-6.5-readline-long-line-crash-test.patch index 501c591..c702d7f 100644 --- a/gdb-6.5-readline-long-line-crash-test.patch +++ b/gdb-6.5-readline-long-line-crash-test.patch @@ -3,20 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-readline-long-line-crash-test.patch -FileName: gdb-6.5-readline-long-line-crash-test.patch - ;; Fix readline segfault on excessively long hand-typed lines. ;;=fedoratest https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196 ---- - gdb/testsuite/gdb.base/readline-overflow.exp | 126 +++++++++++++++++++++++++++ - 1 file changed, 126 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/readline-overflow.exp diff --git a/gdb/testsuite/gdb.base/readline-overflow.exp b/gdb/testsuite/gdb.base/readline-overflow.exp new file mode 100644 -index 0000000000..5e46816d21 --- /dev/null +++ b/gdb/testsuite/gdb.base/readline-overflow.exp @@ -0,0 +1,126 @@ @@ -146,6 +139,3 @@ index 0000000000..5e46816d21 +} +set timeout $oldtimeout1 + --- -2.14.3 - diff --git a/gdb-6.5-section-num-fixup-test.patch b/gdb-6.5-section-num-fixup-test.patch index e27f826..198c3e4 100644 --- a/gdb-6.5-section-num-fixup-test.patch +++ b/gdb-6.5-section-num-fixup-test.patch @@ -3,22 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-section-num-fixup-test.patch -FileName: gdb-6.5-section-num-fixup-test.patch - ;; Test a crash on libraries missing the .text section. ;;=fedoratest ---- - gdb/testsuite/gdb.base/datalib-lib.c | 22 +++++++++++++++ - gdb/testsuite/gdb.base/datalib-main.c | 26 ++++++++++++++++++ - gdb/testsuite/gdb.base/datalib.exp | 51 +++++++++++++++++++++++++++++++++++ - 3 files changed, 99 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/datalib-lib.c - create mode 100644 gdb/testsuite/gdb.base/datalib-main.c - create mode 100644 gdb/testsuite/gdb.base/datalib.exp diff --git a/gdb/testsuite/gdb.base/datalib-lib.c b/gdb/testsuite/gdb.base/datalib-lib.c new file mode 100644 -index 0000000000..dd39e23746 --- /dev/null +++ b/gdb/testsuite/gdb.base/datalib-lib.c @@ -0,0 +1,22 @@ @@ -46,7 +35,6 @@ index 0000000000..dd39e23746 +int var; diff --git a/gdb/testsuite/gdb.base/datalib-main.c b/gdb/testsuite/gdb.base/datalib-main.c new file mode 100644 -index 0000000000..4e0b80d2d6 --- /dev/null +++ b/gdb/testsuite/gdb.base/datalib-main.c @@ -0,0 +1,26 @@ @@ -78,7 +66,6 @@ index 0000000000..4e0b80d2d6 +} diff --git a/gdb/testsuite/gdb.base/datalib.exp b/gdb/testsuite/gdb.base/datalib.exp new file mode 100644 -index 0000000000..385716d901 --- /dev/null +++ b/gdb/testsuite/gdb.base/datalib.exp @@ -0,0 +1,51 @@ @@ -133,6 +120,3 @@ index 0000000000..385716d901 +gdb_test "start" \ + "main \\(\\) at .*${srcfilemain}.*" \ + "start" --- -2.14.3 - diff --git a/gdb-6.5-sharedlibrary-path.patch b/gdb-6.5-sharedlibrary-path.patch index b7b5347..51f168d 100644 --- a/gdb-6.5-sharedlibrary-path.patch +++ b/gdb-6.5-sharedlibrary-path.patch @@ -3,8 +3,6 @@ From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.5-sharedlibrary-path.patch -FileName: gdb-6.5-sharedlibrary-path.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. @@ -30,18 +28,9 @@ The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'. 2008-02-27 Jan Kratochvil Port to gdb-6.7.50.20080227. ---- - gdb/testsuite/gdb.threads/tls-sepdebug-main.c | 25 +++++++ - gdb/testsuite/gdb.threads/tls-sepdebug-shared.c | 22 +++++++ - gdb/testsuite/gdb.threads/tls-sepdebug.exp | 87 +++++++++++++++++++++++++ - 3 files changed, 134 insertions(+) - create mode 100644 gdb/testsuite/gdb.threads/tls-sepdebug-main.c - create mode 100644 gdb/testsuite/gdb.threads/tls-sepdebug-shared.c - create mode 100644 gdb/testsuite/gdb.threads/tls-sepdebug.exp diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-main.c b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c new file mode 100644 -index 0000000000..ea5d0174d6 --- /dev/null +++ b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c @@ -0,0 +1,25 @@ @@ -72,7 +61,6 @@ index 0000000000..ea5d0174d6 +} diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c b/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c new file mode 100644 -index 0000000000..61b49251ba --- /dev/null +++ b/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c @@ -0,0 +1,22 @@ @@ -100,7 +88,6 @@ index 0000000000..61b49251ba +__thread int var = 42; diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug.exp b/gdb/testsuite/gdb.threads/tls-sepdebug.exp new file mode 100644 -index 0000000000..00773f78f2 --- /dev/null +++ b/gdb/testsuite/gdb.threads/tls-sepdebug.exp @@ -0,0 +1,87 @@ @@ -191,6 +178,3 @@ index 0000000000..00773f78f2 + "\\\$1 = \[0-9\].*" \ + "print TLS variable from a shared library with $name-directory separate debug info file" +} --- -2.14.3 - diff --git a/gdb-6.6-buildid-locate-core-as-arg.patch b/gdb-6.6-buildid-locate-core-as-arg.patch index 68f2c39..e77034e 100644 --- a/gdb-6.6-buildid-locate-core-as-arg.patch +++ b/gdb-6.6-buildid-locate-core-as-arg.patch @@ -1,9 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: print a more useful error message for "gdb core" - -FileName: gdb-6.6-buildid-locate-core-as-arg.patch +Subject: gdb-6.6-buildid-locate-core-as-arg.patch ;;=push+jan @@ -62,14 +60,8 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html * exec.c (exec_file_attach): Print a more useful error message if the user did "gdb core". ---- - gdb/common/common-exceptions.h | 3 +++ - gdb/exec.c | 22 +++++++++++++++--- - gdb/main.c | 53 +++++++++++++++++++++++++++++++++++++++--- - 3 files changed, 72 insertions(+), 6 deletions(-) diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h -index 15c85e28ab..9fe2375bce 100644 --- a/gdb/common/common-exceptions.h +++ b/gdb/common/common-exceptions.h @@ -104,6 +104,9 @@ enum errors { @@ -83,18 +75,17 @@ index 15c85e28ab..9fe2375bce 100644 NR_ERRORS }; diff --git a/gdb/exec.c b/gdb/exec.c -index c8c32ecc27..b329e2b834 100644 --- a/gdb/exec.c +++ b/gdb/exec.c -@@ -35,6 +35,7 @@ - #include "progspace.h" +@@ -36,6 +36,7 @@ #include "gdb_bfd.h" #include "gcore.h" + #include "source.h" +#include "exceptions.h" #include #include "readline/readline.h" -@@ -346,12 +347,27 @@ exec_file_attach (const char *filename, int from_tty) +@@ -357,12 +358,27 @@ exec_file_attach (const char *filename, int from_tty) if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching)) { @@ -126,10 +117,9 @@ index c8c32ecc27..b329e2b834 100644 if (build_section_table (exec_bfd, §ions, §ions_end)) diff --git a/gdb/main.c b/gdb/main.c -index 3c98787edb..17d35f4a8a 100644 --- a/gdb/main.c +++ b/gdb/main.c -@@ -446,6 +446,37 @@ struct cmdarg +@@ -447,6 +447,37 @@ struct cmdarg char *string; }; @@ -167,7 +157,7 @@ index 3c98787edb..17d35f4a8a 100644 static void captured_main_1 (struct captured_main_args *context) { -@@ -882,6 +913,8 @@ captured_main_1 (struct captured_main_args *context) +@@ -883,6 +914,8 @@ captured_main_1 (struct captured_main_args *context) { symarg = argv[optind]; execarg = argv[optind]; @@ -176,7 +166,7 @@ index 3c98787edb..17d35f4a8a 100644 optind++; } -@@ -1032,11 +1065,25 @@ captured_main_1 (struct captured_main_args *context) +@@ -1033,11 +1066,25 @@ captured_main_1 (struct captured_main_args *context) && symarg != NULL && strcmp (execarg, symarg) == 0) { @@ -205,6 +195,3 @@ index 3c98787edb..17d35f4a8a 100644 catch_command_errors (symbol_file_add_main_adapter, symarg, !batch_flag); } --- -2.14.3 - 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 7cb71f7..7bc4830 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 @@ -4,8 +4,6 @@ Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch -FileName: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch - ;; Fix 'gdb gives highly misleading error when debuginfo pkg is present, ;; but not corresponding binary pkg' (RH BZ 981154). ;;=push+jan @@ -26,17 +24,11 @@ Comments by Sergio Durigan Junior : and had a little thinko there. The variable 'filename' needs to be set to NULL after it is free'd, otherwise the code below thinks that it is still valid and doesn't print the necessary warning ("Try: yum install ..."). ---- - gdb/build-id.c | 5 +- - .../rhbz981154-misleading-yum-install-warning.exp | 97 ++++++++++++++++++++++ - 2 files changed, 101 insertions(+), 1 deletion(-) - create mode 100644 gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp diff --git a/gdb/build-id.c b/gdb/build-id.c -index 409a5b8c54..e2c1e81266 100644 --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -592,7 +592,10 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id, +@@ -581,7 +581,10 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id, do_cleanups (inner); if (abfd == NULL) @@ -50,7 +42,6 @@ index 409a5b8c54..e2c1e81266 100644 break; diff --git a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp new file mode 100644 -index 0000000000..bb70c5cf44 --- /dev/null +++ b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp @@ -0,0 +1,97 @@ @@ -151,6 +142,3 @@ index 0000000000..bb70c5cf44 + +# Leaving the link there will cause breakage in the next run. +remote_exec build "rm -f [standard_output_file ${build_id_without_debug}]" --- -2.14.3 - diff --git a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch index 7841277..0ac802f 100644 --- a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +++ b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch @@ -3,20 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch -FileName: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch - ;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). ;;=push+jan ---- - gdb/build-id.c | 13 +++++++++++++ - gdb/proc-service.list | 3 +++ - 2 files changed, 16 insertions(+) diff --git a/gdb/build-id.c b/gdb/build-id.c -index d60cf622dc..409a5b8c54 100644 --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -678,6 +678,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) +@@ -652,6 +652,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) #include #endif @@ -37,7 +30,6 @@ index d60cf622dc..409a5b8c54 100644 and avoid their duplicities during a single inferior run. */ diff --git a/gdb/proc-service.list b/gdb/proc-service.list -index 53f7ed8b1e..323f5e83c2 100644 --- a/gdb/proc-service.list +++ b/gdb/proc-service.list @@ -37,4 +37,7 @@ @@ -48,6 +40,3 @@ index 53f7ed8b1e..323f5e83c2 100644 + /* gdb-6.6-buildid-locate-rpm.patch */ + rpmsqEnable; }; --- -2.14.3 - diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch index 1a99000..6abc33a 100644 --- a/gdb-6.6-buildid-locate-rpm-scl.patch +++ b/gdb-6.6-buildid-locate-rpm-scl.patch @@ -3,23 +3,16 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-buildid-locate-rpm-scl.patch -FileName: gdb-6.6-buildid-locate-rpm-scl.patch - ;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585). ;;=push+jan warning: Skipping deprecated .gdb_index section https://bugzilla.redhat.com/show_bug.cgi?id=953585 ---- - gdb/build-id.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ - gdb/dwarf2read.c | 14 ++++++++++++++ - 2 files changed, 68 insertions(+) diff --git a/gdb/build-id.c b/gdb/build-id.c -index e2c1e81266..1b75530f91 100644 --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -715,7 +715,11 @@ static int missing_rpm_list_entries; +@@ -689,7 +689,11 @@ static int missing_rpm_list_entries; /* Returns the count of newly added rpms. */ static int @@ -31,7 +24,7 @@ index e2c1e81266..1b75530f91 100644 { static int rpm_init_done = 0; rpmts ts; -@@ -822,7 +826,11 @@ missing_rpm_enlist (const char *filename) +@@ -796,7 +800,11 @@ missing_rpm_enlist (const char *filename) mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0); if (mi != NULL) { @@ -43,7 +36,7 @@ index e2c1e81266..1b75530f91 100644 { Header h; char *debuginfo, **slot, *s, *s2; -@@ -940,6 +948,37 @@ missing_rpm_enlist (const char *filename) +@@ -914,6 +922,37 @@ missing_rpm_enlist (const char *filename) xfree (debuginfo); count++; } @@ -81,7 +74,7 @@ index e2c1e81266..1b75530f91 100644 rpmdbFreeIterator_p (mi); } -@@ -950,6 +989,21 @@ missing_rpm_enlist (const char *filename) +@@ -924,6 +963,21 @@ missing_rpm_enlist (const char *filename) } static int @@ -104,10 +97,9 @@ index e2c1e81266..1b75530f91 100644 { return strcoll (*ap, *bp); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 2c972d5e74..64329af71e 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -3725,6 +3725,16 @@ read_index_from_section (struct objfile *objfile, +@@ -3469,6 +3469,16 @@ read_gdb_index_from_section (struct objfile *objfile, "set use-deprecated-index-sections on". */ if (version < 6 && !deprecated_ok) { @@ -124,7 +116,7 @@ index 2c972d5e74..64329af71e 100644 static int warning_printed = 0; if (!warning_printed) { -@@ -3736,6 +3746,10 @@ to use the section anyway."), +@@ -3480,6 +3490,10 @@ to use the section anyway."), warning_printed = 1; } return 0; @@ -135,6 +127,3 @@ index 2c972d5e74..64329af71e 100644 } /* Version 7 indices generated by gold refer to the CU for a symbol instead of the TU (for symbols coming from TUs), --- -2.14.3 - diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index 3dddbc1..398e1aa 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -3,25 +3,12 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-buildid-locate-rpm.patch -FileName: gdb-6.6-buildid-locate-rpm.patch - ;;=push+jan ---- - gdb/aclocal.m4 | 215 +++++++++++++++++++++++ - gdb/build-id.c | 407 +++++++++++++++++++++++++++++++++++++++++++- - gdb/config.in | 6 + - gdb/configure | 508 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ - gdb/configure.ac | 193 +++++++++++++++++++++ - gdb/corelow.c | 2 +- - gdb/event-top.c | 8 +- - gdb/symfile.h | 2 + - 8 files changed, 1331 insertions(+), 10 deletions(-) diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 -index e0d38ea267..da5ac313e3 100644 --- a/gdb/aclocal.m4 +++ b/gdb/aclocal.m4 -@@ -12,6 +12,221 @@ +@@ -11,7 +11,223 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @@ -239,12 +226,13 @@ index e0d38ea267..da5ac313e3 100644 + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])# PKG_CHECK_VAR ++ + m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) + # AM_AUX_DIR_EXPAND -*- Autoconf -*- - # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. + # Copyright (C) 2001-2017 Free Software Foundation, Inc. diff --git a/gdb/build-id.c b/gdb/build-id.c -index 5740628386..d60cf622dc 100644 --- a/gdb/build-id.c +++ b/gdb/build-id.c @@ -35,6 +35,8 @@ @@ -256,7 +244,7 @@ index 5740628386..d60cf622dc 100644 #define BUILD_ID_VERBOSE_NONE 0 #define BUILD_ID_VERBOSE_FILENAMES 1 -@@ -666,8 +668,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) +@@ -640,8 +642,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) return result; } @@ -624,7 +612,7 @@ index 5740628386..d60cf622dc 100644 avoidance. */ struct missing_filepair -@@ -721,11 +1081,17 @@ missing_filepair_change (void) +@@ -695,11 +1055,17 @@ missing_filepair_change (void) /* All their memory came just from missing_filepair_OBSTACK. */ missing_filepair_hash = NULL; } @@ -642,7 +630,7 @@ index 5740628386..d60cf622dc 100644 missing_filepair_change (); } -@@ -792,14 +1158,39 @@ debug_print_missing (const char *binary, const char *debug) +@@ -766,14 +1132,39 @@ debug_print_missing (const char *binary, const char *debug) *slot = missing_filepair; @@ -690,7 +678,6 @@ index 5740628386..d60cf622dc 100644 /* See build-id.h. */ diff --git a/gdb/config.in b/gdb/config.in -index 1d11a97080..edd7028f76 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -33,6 +33,9 @@ @@ -703,7 +690,7 @@ index 1d11a97080..edd7028f76 100644 /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS -@@ -264,6 +267,9 @@ +@@ -270,6 +273,9 @@ /* Define if Python 2.7 is being used. */ #undef HAVE_LIBPYTHON2_7 @@ -714,10 +701,9 @@ index 1d11a97080..edd7028f76 100644 #undef HAVE_LIBUNWIND_IA64_H diff --git a/gdb/configure b/gdb/configure -index 092893d757..1cecdbc3b5 100755 --- a/gdb/configure +++ b/gdb/configure -@@ -716,6 +716,11 @@ PKGVERSION +@@ -749,6 +749,11 @@ CODESIGN_CERT HAVE_NATIVE_GCORE_TARGET TARGET_OBS subdirs @@ -729,7 +715,7 @@ index 092893d757..1cecdbc3b5 100755 GDB_DATADIR DEBUGDIR MAKEINFO_EXTRA_FLAGS -@@ -820,6 +825,7 @@ with_gdb_datadir +@@ -853,6 +858,7 @@ with_gdb_datadir with_relocated_sources with_auto_load_dir with_auto_load_safe_path @@ -737,7 +723,7 @@ index 092893d757..1cecdbc3b5 100755 enable_targets enable_64_bit_bfd enable_gdbcli -@@ -878,6 +884,11 @@ CCC +@@ -912,6 +918,11 @@ CCC CPP MAKEINFO MAKEINFOFLAGS @@ -749,7 +735,7 @@ index 092893d757..1cecdbc3b5 100755 YACC YFLAGS XMKMF' -@@ -1548,6 +1559,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 @@ -758,7 +744,7 @@ index 092893d757..1cecdbc3b5 100755 --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets --with-curses use the curses library instead of the termcap library -@@ -1605,6 +1618,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. @@ -769,10 +755,10 @@ index 092893d757..1cecdbc3b5 100755 + path overriding pkg-config's built-in search path + RPM_CFLAGS C compiler flags for RPM, overriding pkg-config + RPM_LIBS linker flags for RPM, overriding pkg-config - YACC The `Yet Another C Compiler' implementation to use. Defaults to - the first program found out of: `bison -y', `byacc', `yacc'. - YFLAGS The list of arguments that will be passed by default to $YACC. -@@ -6486,6 +6506,494 @@ _ACEOF + 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 $as_echo "$with_auto_load_safe_path" >&6; } @@ -1268,10 +1254,9 @@ index 092893d757..1cecdbc3b5 100755 subdirs="$subdirs testsuite" diff --git a/gdb/configure.ac b/gdb/configure.ac -index d4133ea71e..e232c1adcb 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -167,6 +167,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, +@@ -166,6 +166,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, [Directories safe to hold auto-loaded files.]) AC_MSG_RESULT([$with_auto_load_safe_path]) @@ -1472,10 +1457,9 @@ index d4133ea71e..e232c1adcb 100644 # Check whether to support alternative target configurations diff --git a/gdb/corelow.c b/gdb/corelow.c -index c5b642db81..6e027c12e2 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c -@@ -309,7 +309,7 @@ build_id_locate_exec (int from_tty) +@@ -366,7 +366,7 @@ build_id_locate_exec (int from_tty) symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; } else @@ -1485,7 +1469,6 @@ index c5b642db81..6e027c12e2 100644 do_cleanups (back_to); diff --git a/gdb/event-top.c b/gdb/event-top.c -index 0c1528e5eb..0d668f35e0 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -40,6 +40,7 @@ @@ -1518,10 +1501,9 @@ index 0c1528e5eb..0d668f35e0 100644 } diff --git a/gdb/symfile.h b/gdb/symfile.h -index 0d51f46d78..82c76431e1 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -546,6 +546,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data, +@@ -540,6 +540,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); @@ -1530,6 +1512,3 @@ index 0d51f46d78..82c76431e1 100644 /* From dwarf2read.c */ --- -2.14.3 - diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch index a8de69c..d4a91c3 100644 --- a/gdb-6.6-buildid-locate-solib-missing-ids.patch +++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-buildid-locate-solib-missing-ids.patch -FileName: gdb-6.6-buildid-locate-solib-missing-ids.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). @@ -12,33 +10,23 @@ FileName: gdb-6.6-buildid-locate-solib-missing-ids.patch gdb returns an incorrect back trace when applying a debuginfo https://bugzilla.redhat.com/show_bug.cgi?id=1339862 ---- - gdb/solib-svr4.c | 35 ++++--- - .../gcore-buildid-exec-but-not-solib-lib.c | 21 +++++ - .../gcore-buildid-exec-but-not-solib-main.c | 25 +++++ - .../gdb.base/gcore-buildid-exec-but-not-solib.exp | 105 +++++++++++++++++++++ - 4 files changed, 167 insertions(+), 19 deletions(-) - create mode 100644 gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c - create mode 100644 gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c - create mode 100644 gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c -index a3399ad8f7..d7eeb6350d 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c -@@ -1387,14 +1387,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1358,14 +1358,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, } { - struct bfd_build_id *build_id; + struct bfd_build_id *build_id = NULL; - strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); + strncpy (newobj->so_original_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1); newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; /* May get overwritten below. */ strcpy (newobj->so_name, newobj->so_original_name); -- build_id = build_id_addr_get (newobj->lm_info->l_ld); +- build_id = build_id_addr_get (((lm_info_svr4 *) newobj->lm_info)->l_ld); + /* In the case the main executable was found according to its build-id + (from a core file) prevent loading a different build of a library + with accidentally the same SO_NAME. @@ -56,7 +44,7 @@ index a3399ad8f7..d7eeb6350d 100644 if (build_id != NULL) { char *name, *build_id_filename; -@@ -1409,23 +1422,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1380,23 +1393,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, xfree (name); } else @@ -83,7 +71,6 @@ index a3399ad8f7..d7eeb6350d 100644 xfree (build_id); diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c new file mode 100644 -index 0000000000..d74b690c73 --- /dev/null +++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c @@ -0,0 +1,21 @@ @@ -110,7 +97,6 @@ index 0000000000..d74b690c73 +} diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c new file mode 100644 -index 0000000000..46b9dfe161 --- /dev/null +++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c @@ -0,0 +1,25 @@ @@ -141,7 +127,6 @@ index 0000000000..46b9dfe161 +} diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp new file mode 100644 -index 0000000000..0c46489f31 --- /dev/null +++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp @@ -0,0 +1,105 @@ @@ -250,6 +235,3 @@ index 0000000000..0c46489f31 + +gdb_test "bt" +gdb_test "info shared" --- -2.14.3 - diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 4696422..d994c85 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -3,30 +3,10 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-buildid-locate.patch -FileName: gdb-6.6-buildid-locate.patch - ;; New locating of the matching binaries from the pure core file (build-id). ;;=push+jan ---- - gdb/build-id.c | 753 +++++++++++++++++++++++- - gdb/build-id.h | 15 +- - gdb/coffread.c | 2 +- - gdb/corelow.c | 67 +++ - gdb/doc/gdb.texinfo | 21 + - gdb/dwarf2read.c | 2 +- - gdb/elfread.c | 7 +- - gdb/objfiles.h | 4 + - gdb/python/py-objfile.c | 4 +- - gdb/solib-svr4.c | 50 +- - gdb/symfile.h | 4 + - gdb/testsuite/gdb.base/corefile.exp | 30 + - gdb/testsuite/gdb.base/new-ui-pending-input.exp | 1 + - gdb/testsuite/lib/gdb.exp | 10 + - gdb/testsuite/lib/mi-support.exp | 10 + - 15 files changed, 940 insertions(+), 40 deletions(-) diff --git a/gdb/build-id.c b/gdb/build-id.c -index 945da4f3cf..5740628386 100644 --- a/gdb/build-id.c +++ b/gdb/build-id.c @@ -26,11 +26,67 @@ @@ -36,7 +16,7 @@ index 945da4f3cf..5740628386 100644 +#include "libbfd.h" +#include "gdbcore.h" +#include "gdbcmd.h" -+#include "observer.h" ++#include "observable.h" +#include "elf/external.h" +#include "elf/internal.h" +#include "elf/common.h" @@ -456,7 +436,7 @@ index 945da4f3cf..5740628386 100644 if (found == NULL) warning (_("File \"%s\" has no build-id, file skipped"), -@@ -65,23 +463,54 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) +@@ -65,11 +463,50 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) return retval; } @@ -501,84 +481,80 @@ index 945da4f3cf..5740628386 100644 +build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id, + char **link_return, int add_debug_suffix) { -- char *link, *debugdir; -+ char *link, *debugdir, *link_all = NULL; - VEC (char_ptr) *debugdir_vec; - struct cleanup *back_to; - int ix; ++ char *debugdir; ++ std::string link, link_all; ++ struct cleanup *back_to; ++ int ix; gdb_bfd_ref_ptr abfd; -- int alloc_len; - - /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */ -- alloc_len = (strlen (debug_file_directory) -- + (sizeof "/.build-id/" - 1) + 1 -- + 2 * build_id_len + (sizeof ".debug" - 1) + 1); -- link = (char *) alloca (alloc_len); -+ link = (char *) xmalloc (strlen (debug_file_directory) + 2 * build_id_len + 50); /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will - cause "/.build-id/..." lookups. */ -@@ -94,9 +523,12 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) - size_t debugdir_len = strlen (debugdir); +@@ -82,63 +519,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; -- char *s; - char *filename = NULL; - struct cleanup *inner; ++ char *filename = NULL; ++ struct cleanup *inner; + unsigned seqno; + struct stat statbuf_trash; -+ /* Initialize it just to avoid a GCC false warning. */ -+ char *s, *link0 = NULL, *link0_resolved; ++ std::string link0; - memcpy (link, debugdir, debugdir_len); - s = &link[debugdir_len]; -@@ -110,52 +542,299 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) - *s++ = '/'; +- std::string link = debugdir.get (); ++ link = debugdir.get (); + link += "/.build-id/"; + + if (size > 0) + { + size--; +- string_appendf (link, "%02x/", (unsigned) *data++); ++ string_appendf (link, "%02x", (unsigned) *data++); + } +- ++ if (size > 0) ++ link += "/"; while (size-- > 0) - s += sprintf (s, "%02x", (unsigned) *data++); -- strcpy (s, ".debug"); + string_appendf (link, "%02x", (unsigned) *data++); +- link += ".debug"; +- if (separate_debug_file_debug) - printf_unfiltered (_(" Trying %s\n"), link); + printf_unfiltered (_(" Trying %s\n"), link.c_str ()); - /* lrealpath() is expensive even for the usually non-existent files. */ -- if (access (link, F_OK) == 0) -- filename = lrealpath (link); +- gdb::unique_xmalloc_ptr filename; +- if (access (link.c_str (), F_OK) == 0) +- filename.reset (lrealpath (link.c_str ())); +- +- if (filename == NULL) +- continue; + for (seqno = 0;; seqno++) + { -+ char *s2; -+ + if (seqno) + { + /* There can be multiple build-id symlinks pointing to real files + with the same build-id (such as hard links). Some of the real + files may not be installed. */ + -+ s2 = s + sprintf (s, ".%u", seqno); ++ string_appendf (link, ".%u", seqno); + } -+ else -+ s2 = s; + + if (add_debug_suffix) -+ strcpy (s2, ".debug"); -+ else -+ *s2 = 0; ++ link += ".debug"; + + if (!seqno) + { + /* If none of the real files is found report as missing file + always the non-.%u-suffixed file. */ -+ link0 = xstrdup (link); ++ link0 = link; + } + + /* `access' automatically dereferences LINK. */ -+ if (lstat (link, &statbuf_trash) != 0) ++ if (lstat (link.c_str (), &statbuf_trash) != 0) + { + /* Stop increasing SEQNO. */ + break; + } + -+ filename = lrealpath (link); ++ filename = lrealpath (link.c_str ()); + if (filename == NULL) + continue; + @@ -598,65 +574,46 @@ index 945da4f3cf..5740628386 100644 + filename = NULL; + } -- if (filename == NULL) -- continue; +- /* We expect to be silent on the non-existing files. */ +- abfd = gdb_bfd_open (filename.get (), gnutarget, -1); + if (filename != NULL) + { + /* LINK_ALL is not used below in this non-NULL FILENAME case. */ -+ xfree (link0); + break; + } -- /* We expect to be silent on the non-existing files. */ -- inner = make_cleanup (xfree, filename); -- abfd = gdb_bfd_open (filename, gnutarget, -1); -- do_cleanups (inner); +- if (abfd == NULL) +- continue; + /* If the symlink has target request to install the target. + BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing. + https://bugzilla.redhat.com/show_bug.cgi?id=981154 */ -+ link0_resolved = link_resolve (link0, 0); -+ xfree (link0); - -- if (abfd == NULL) -- continue; -+ if (link_all == NULL) -+ link_all = link0_resolved; -+ else -+ { -+ size_t len_orig = strlen (link_all); ++ std::string link0_resolved (link_resolve (link0.c_str (), 0)); - if (build_id_verify (abfd.get(), build_id_len, build_id)) - break; -+ link_all = (char *) xrealloc (link_all, -+ len_orig + 1 + strlen (link0_resolved) + 1); - -- abfd.release (); ++ if (link_all.empty ()) ++ link_all = link0_resolved; ++ else ++ { + /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with + its possible use as an argument for installation command. */ -+ link_all[len_orig] = ' '; -+ -+ strcpy (&link_all[len_orig + 1], link0_resolved); -+ xfree (link0_resolved); ++ link_all += " " + link0_resolved; + } + } -+ + +- abfd.release (); + if (link_return != NULL) + { + if (abfd != NULL) + { -+ *link_return = link; -+ link = NULL; ++ *link_return = xstrdup (link.c_str ()); + } + else + { -+ *link_return = link_all; -+ link_all = NULL; ++ *link_return = xstrdup (link_all.c_str ()); + } } -+ xfree (link); -+ xfree (link_all); - do_cleanups (back_to); return abfd; } @@ -813,7 +770,7 @@ index 945da4f3cf..5740628386 100644 + /* See build-id.h. */ - char * + std::string -find_separate_debug_file_by_buildid (struct objfile *objfile) +find_separate_debug_file_by_buildid (struct objfile *objfile, + gdb::unique_xmalloc_ptr *build_id_filename_return) @@ -850,9 +807,9 @@ index 945da4f3cf..5740628386 100644 /* Prevent looping on a stripped .debug file. */ if (abfd != NULL && filename_cmp (bfd_get_filename (abfd.get ()), -@@ -167,3 +846,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) - } - return NULL; +@@ -151,3 +821,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) + + return std::string (); } + +extern void _initialize_build_id (void); @@ -870,10 +827,9 @@ index 945da4f3cf..5740628386 100644 + show_build_id_verbose, + &setlist, &showlist); + -+ observer_attach_executable_changed (debug_print_executable_changed); ++ gdb::observers::executable_changed.attach (debug_print_executable_changed); +} diff --git a/gdb/build-id.h b/gdb/build-id.h -index 0f13c7d4cf..2d105dba88 100644 --- a/gdb/build-id.h +++ b/gdb/build-id.h @@ -22,9 +22,10 @@ @@ -889,7 +845,7 @@ index 0f13c7d4cf..2d105dba88 100644 /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value. Otherwise, issue a warning and return false. */ -@@ -38,13 +39,19 @@ extern int build_id_verify (bfd *abfd, +@@ -38,13 +39,18 @@ extern int build_id_verify (bfd *abfd, the caller. */ extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len, @@ -902,30 +858,29 @@ index 0f13c7d4cf..2d105dba88 100644 + char **link_return); /* Find the separate debug file for OBJFILE, by using the build-id - associated with OBJFILE's BFD. If successful, returns a malloc'd - file name for the separate debug file. The caller must free this. - Otherwise, returns NULL. */ + associated with OBJFILE's BFD. If successful, returns the file name for the + separate debug file, otherwise, return an empty string. */ --extern char *find_separate_debug_file_by_buildid (struct objfile *objfile); -+extern char *find_separate_debug_file_by_buildid (struct objfile *objfile, +-extern std::string find_separate_debug_file_by_buildid +- (struct objfile *objfile); ++extern std::string find_separate_debug_file_by_buildid (struct objfile *objfile, + gdb::unique_xmalloc_ptr *build_id_filename_return); #endif /* BUILD_ID_H */ diff --git a/gdb/coffread.c b/gdb/coffread.c -index fbbbb68f71..9698ec2191 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c -@@ -735,7 +735,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) +@@ -733,7 +733,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)) { - char *debugfile; +- std::string debugfile = find_separate_debug_file_by_buildid (objfile); ++ std::string debugfile = find_separate_debug_file_by_buildid (objfile, ++ NULL); -- debugfile = find_separate_debug_file_by_buildid (objfile); -+ debugfile = find_separate_debug_file_by_buildid (objfile, NULL); - - if (debugfile == NULL) + if (debugfile.empty ()) debugfile = find_separate_debug_file_by_debuglink (objfile); diff --git a/gdb/corelow.c b/gdb/corelow.c -index 3a5256cb17..c5b642db81 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -45,6 +45,10 @@ @@ -939,7 +894,7 @@ index 3a5256cb17..c5b642db81 100644 #ifndef O_LARGEFILE #define O_LARGEFILE 0 -@@ -264,6 +268,54 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg) +@@ -321,6 +325,54 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg) inferior_ptid = ptid; /* Yes, make it current. */ } @@ -957,7 +912,7 @@ index 3a5256cb17..c5b642db81 100644 + if (exec_bfd != NULL || symfile_objfile != NULL) + return; + -+ if (target_auxv_search (¤t_target, AT_ENTRY, &at_entry) <= 0) ++ if (target_auxv_search (current_top_target (), AT_ENTRY, &at_entry) <= 0) + return; + + build_id = build_id_addr_get (at_entry); @@ -991,11 +946,11 @@ index 3a5256cb17..c5b642db81 100644 + /* No automatic SOLIB_ADD as the libraries would get read twice. */ +} + - /* This routine opens and sets up the core file bfd. */ + /* Issue a message saying we have no core to debug, if FROM_TTY. */ static void -@@ -391,6 +443,14 @@ core_open (const char *arg, int from_tty) - switch_to_thread (thread->ptid); +@@ -464,6 +516,14 @@ core_target_open (const char *arg, int from_tty) + switch_to_thread (thread); } + /* Find the build_id identifiers. If it gets executed after @@ -1006,13 +961,13 @@ index 3a5256cb17..c5b642db81 100644 + if (build_id_core_loads != 0) + build_id_locate_exec (from_tty); + - post_create_inferior (&core_ops, from_tty); + post_create_inferior (target, from_tty); /* Now go through the target stack looking for threads since there -@@ -1040,4 +1100,11 @@ _initialize_corelow (void) - init_core_ops (); - - add_target_with_completer (&core_ops, filename_completer); +@@ -1072,4 +1132,11 @@ void + _initialize_corelow (void) + { + add_target (core_target_info, core_target_open, filename_completer); + + add_setshow_boolean_cmd ("build-id-core-loads", class_files, + &build_id_core_loads, _("\ @@ -1022,10 +977,9 @@ index 3a5256cb17..c5b642db81 100644 + &setlist, &showlist); } diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 8bdafb0ba4..2f2cbd3dea 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -19447,6 +19447,27 @@ information files. +@@ -19570,6 +19570,27 @@ information files. @end table @@ -1054,10 +1008,9 @@ index 8bdafb0ba4..2f2cbd3dea 100644 @cindex debug link sections A debug link is a special section of the executable file named diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 98e7d842f0..c8db955f2f 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -2907,7 +2907,7 @@ dwarf2_get_dwz_file (void) +@@ -2683,7 +2683,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile) } if (dwz_bfd == NULL) @@ -1067,22 +1020,21 @@ index 98e7d842f0..c8db955f2f 100644 if (dwz_bfd == NULL) error (_("could not find '.gnu_debugaltlink' file for %s"), diff --git a/gdb/elfread.c b/gdb/elfread.c -index 103b2144c3..fb32e03af5 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c -@@ -1259,8 +1259,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) +@@ -1290,7 +1290,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) && objfile->separate_debug_objfile == NULL && objfile->separate_debug_objfile_backlink == NULL) { +- std::string debugfile = find_separate_debug_file_by_buildid (objfile); + gdb::unique_xmalloc_ptr build_id_filename; - gdb::unique_xmalloc_ptr debugfile -- (find_separate_debug_file_by_buildid (objfile)); -+ (find_separate_debug_file_by_buildid (objfile, &build_id_filename)); ++ std::string debugfile ++ = find_separate_debug_file_by_buildid (objfile, &build_id_filename); - if (debugfile == NULL) - debugfile.reset (find_separate_debug_file_by_debuglink (objfile)); -@@ -1272,6 +1273,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) - symbol_file_add_separate (abfd.get (), debugfile.get (), + 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) + symbol_file_add_separate (abfd.get (), debugfile.c_str (), symfile_flags, objfile); } + /* Check if any separate debug info has been extracted out. */ @@ -1093,7 +1045,6 @@ index 103b2144c3..fb32e03af5 100644 } diff --git a/gdb/objfiles.h b/gdb/objfiles.h -index 28e66eca36..5ab0e33fb6 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -470,6 +470,10 @@ struct objfile @@ -1108,7 +1059,6 @@ index 28e66eca36..5ab0e33fb6 100644 extern struct gdbarch *get_objfile_arch (const struct objfile *); diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c -index c2b40ff535..112cbf6560 100644 --- a/gdb/python/py-objfile.c +++ b/gdb/python/py-objfile.c @@ -137,7 +137,7 @@ objfpy_get_build_id (PyObject *self, void *closure) @@ -1130,7 +1080,6 @@ index c2b40ff535..112cbf6560 100644 continue; if (objfpy_build_id_matches (obfd_build_id, build_id)) diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c -index 4973cc2f25..a3399ad8f7 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -45,6 +45,7 @@ @@ -1141,22 +1090,22 @@ index 4973cc2f25..a3399ad8f7 100644 static struct link_map_offsets *svr4_fetch_link_map_offsets (void); static int svr4_have_link_map_offsets (void); -@@ -1385,9 +1386,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1356,9 +1357,51 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, continue; } -- strncpy (newobj->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); +- strncpy (newobj->so_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1); - newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; - strcpy (newobj->so_original_name, newobj->so_name); + { + struct bfd_build_id *build_id; + -+ strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); ++ strncpy (newobj->so_original_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1); + newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; + /* May get overwritten below. */ + strcpy (newobj->so_name, newobj->so_original_name); + -+ build_id = build_id_addr_get (newobj->lm_info->l_ld); ++ build_id = build_id_addr_get (((lm_info_svr4 *) newobj->lm_info)->l_ld); + if (build_id != NULL) + { + char *name, *build_id_filename; @@ -1193,15 +1142,13 @@ index 4973cc2f25..a3399ad8f7 100644 + xfree (build_id); + } + } -+ - xfree (buffer); /* If this entry has no name, or its name matches the name + for the main executable, don't include it in the list. */ diff --git a/gdb/symfile.h b/gdb/symfile.h -index 7c3fd8240a..0d51f46d78 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -543,6 +543,10 @@ void expand_symtabs_matching +@@ -537,6 +537,10 @@ void expand_symtabs_matching void map_symbol_filenames (symbol_filename_ftype *fun, void *data, int need_fullname); @@ -1213,7 +1160,6 @@ index 7c3fd8240a..0d51f46d78 100644 /* Names for a dwarf2 debugging section. The field NORMAL is the normal diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp -index 63a7fa8e5b..8a4fab77df 100644 --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp @@ -311,3 +311,33 @@ gdb_test_multiple "core-file $corefile" $test { @@ -1251,7 +1197,6 @@ index 63a7fa8e5b..8a4fab77df 100644 + pass $wholetest +} diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb.base/new-ui-pending-input.exp -index a6dc14e3c9..54a10df155 100644 --- a/gdb/testsuite/gdb.base/new-ui-pending-input.exp +++ b/gdb/testsuite/gdb.base/new-ui-pending-input.exp @@ -62,6 +62,7 @@ proc test_command_line_new_ui_pending_input {} { @@ -1263,10 +1208,9 @@ index a6dc14e3c9..54a10df155 100644 append options " -ex \"b $bpline\"" append options " -ex \"run\"" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 7702d9c238..a165bf0938 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp -@@ -1694,6 +1694,16 @@ proc default_gdb_start { } { +@@ -1695,6 +1695,16 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } } @@ -1284,7 +1228,6 @@ index 7702d9c238..a165bf0938 100644 } diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp -index 2846da74e4..004c3e6c1c 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -309,6 +309,16 @@ proc default_mi_gdb_start { args } { @@ -1304,6 +1247,3 @@ index 2846da74e4..004c3e6c1c 100644 if { $separate_inferior_pty } { mi_create_inferior_pty --- -2.14.3 - diff --git a/gdb-6.6-bz229517-gcore-without-terminal.patch b/gdb-6.6-bz229517-gcore-without-terminal.patch index 8e61ae3..7eaed58 100644 --- a/gdb-6.6-bz229517-gcore-without-terminal.patch +++ b/gdb-6.6-bz229517-gcore-without-terminal.patch @@ -3,8 +3,6 @@ From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-bz229517-gcore-without-terminal.patch -FileName: gdb-6.6-bz229517-gcore-without-terminal.patch - ;; Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517). ;;=fedoratest @@ -15,16 +13,9 @@ FileName: gdb-6.6-bz229517-gcore-without-terminal.patch 2007-04-22 Jan Kratochvil * gdb.base/gcorebg.exp, gdb.base/gcorebg.c: New files. ---- - gdb/testsuite/gdb.base/gcorebg.c | 49 ++++++++++++++++ - gdb/testsuite/gdb.base/gcorebg.exp | 113 +++++++++++++++++++++++++++++++++++++ - 2 files changed, 162 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/gcorebg.c - create mode 100644 gdb/testsuite/gdb.base/gcorebg.exp diff --git a/gdb/testsuite/gdb.base/gcorebg.c b/gdb/testsuite/gdb.base/gcorebg.c new file mode 100644 -index 0000000000..427ebe9b4f --- /dev/null +++ b/gdb/testsuite/gdb.base/gcorebg.c @@ -0,0 +1,49 @@ @@ -79,7 +70,6 @@ index 0000000000..427ebe9b4f +} diff --git a/gdb/testsuite/gdb.base/gcorebg.exp b/gdb/testsuite/gdb.base/gcorebg.exp new file mode 100644 -index 0000000000..a5471ba5df --- /dev/null +++ b/gdb/testsuite/gdb.base/gcorebg.exp @@ -0,0 +1,113 @@ @@ -196,6 +186,3 @@ index 0000000000..a5471ba5df + +set env(PATH) $oldpath +remote_file target delete "./gdb" --- -2.14.3 - diff --git a/gdb-6.6-bz230000-power6-disassembly-test.patch b/gdb-6.6-bz230000-power6-disassembly-test.patch index c9d2503..757c747 100644 --- a/gdb-6.6-bz230000-power6-disassembly-test.patch +++ b/gdb-6.6-bz230000-power6-disassembly-test.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-bz230000-power6-disassembly-test.patch -FileName: gdb-6.6-bz230000-power6-disassembly-test.patch - ;; Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). ;;=fedoratest @@ -13,16 +11,9 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000 The original testcase https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000#c1 requires too recent GCC. ---- - gdb/testsuite/gdb.arch/powerpc-power6.exp | 54 +++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.arch/powerpc-power6.s | 16 +++++++++ - 2 files changed, 70 insertions(+) - create mode 100644 gdb/testsuite/gdb.arch/powerpc-power6.exp - create mode 100644 gdb/testsuite/gdb.arch/powerpc-power6.s diff --git a/gdb/testsuite/gdb.arch/powerpc-power6.exp b/gdb/testsuite/gdb.arch/powerpc-power6.exp new file mode 100644 -index 0000000000..082a4b7802 --- /dev/null +++ b/gdb/testsuite/gdb.arch/powerpc-power6.exp @@ -0,0 +1,54 @@ @@ -82,7 +73,6 @@ index 0000000000..082a4b7802 +gdb_test "disass func" ":\tdcmpuq *cr1,f2,f0\r\n.*" "Power6 disassembly dcmpuq" diff --git a/gdb/testsuite/gdb.arch/powerpc-power6.s b/gdb/testsuite/gdb.arch/powerpc-power6.s new file mode 100644 -index 0000000000..6694b237ab --- /dev/null +++ b/gdb/testsuite/gdb.arch/powerpc-power6.s @@ -0,0 +1,16 @@ @@ -102,6 +92,3 @@ index 0000000000..6694b237ab + .long 0xfc020444 /* ddivq f0,f2,f0 */ + .long 0xec820d04 /* dcmpu cr1,f2,f1 */ + .long 0xfc820504 /* dcmpuq cr1,f2,f0 */ --- -2.14.3 - diff --git a/gdb-6.6-bz235197-fork-detach-info.patch b/gdb-6.6-bz235197-fork-detach-info.patch deleted file mode 100644 index f44cf1d..0000000 --- a/gdb-6.6-bz235197-fork-detach-info.patch +++ /dev/null @@ -1,166 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.6-bz235197-fork-detach-info.patch - -FileName: gdb-6.6-bz235197-fork-detach-info.patch - -;; Notify user of a child forked process being detached (BZ 235197). -;;=push+jan: This is more about discussion if/what should be printed. - -2008-03-01 Jan Kratochvil - - Port to GDB-6.8pre. - Remove the `[' character from the GDB-6.8 default message. ---- - gdb/infrun.c | 2 +- - gdb/testsuite/gdb.base/catch-syscall.exp | 4 +-- - gdb/testsuite/gdb.base/fork-detach.c | 57 ++++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.base/fork-detach.exp | 36 ++++++++++++++++++++ - 4 files changed, 96 insertions(+), 3 deletions(-) - create mode 100644 gdb/testsuite/gdb.base/fork-detach.c - create mode 100644 gdb/testsuite/gdb.base/fork-detach.exp - -diff --git a/gdb/infrun.c b/gdb/infrun.c -index e1d11234e0..23439979b5 100644 ---- a/gdb/infrun.c -+++ b/gdb/infrun.c -@@ -461,7 +461,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ - remove_breakpoints_pid (ptid_get_pid (inferior_ptid)); - } - -- if (info_verbose || debug_infrun) -+ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_infrun) - { - /* Ensure that we have a process ptid. */ - ptid_t process_ptid = pid_to_ptid (ptid_get_pid (child_ptid)); -diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp -index 2a8bf27e5c..20fa041155 100644 ---- a/gdb/testsuite/gdb.base/catch-syscall.exp -+++ b/gdb/testsuite/gdb.base/catch-syscall.exp -@@ -179,7 +179,7 @@ proc check_for_program_end {} { - # Deleting the catchpoints - delete_breakpoints - -- gdb_continue_to_end -+ gdb_continue_to_end "" continue 1 - } - - proc test_catch_syscall_without_args {} { -@@ -250,7 +250,7 @@ proc test_catch_syscall_with_wrong_args {} { - # If it doesn't, everything is right (since we don't have - # a syscall named "mlock" in it). Otherwise, this is a failure. - set thistest "catch syscall with unused syscall ($syscall_name)" -- gdb_continue_to_end $thistest -+ gdb_continue_to_end $thistest continue 1 - } - } - -diff --git a/gdb/testsuite/gdb.base/fork-detach.c b/gdb/testsuite/gdb.base/fork-detach.c -new file mode 100644 -index 0000000000..0ba8f465f3 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/fork-detach.c -@@ -0,0 +1,57 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 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 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@prep.ai.mit.edu */ -+ -+#include -+#include -+#include -+#include -+#include -+ -+static void func (void) -+{ -+} -+ -+int main (void) -+{ -+ pid_t child; -+ -+ child = fork (); -+ switch (child) -+ { -+ case -1: -+ abort (); -+ case 0: -+ func (); -+ break; -+ default: -+ { -+/* We do not test the switching to the other fork by GDB `fork 1'. */ -+#if 0 -+ pid_t got; -+ -+ got = waitpid (child, NULL, 0); -+ assert (got == child); -+#endif -+ break; -+ } -+ } -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/fork-detach.exp b/gdb/testsuite/gdb.base/fork-detach.exp -new file mode 100644 -index 0000000000..1f1fcef6c4 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/fork-detach.exp -@@ -0,0 +1,36 @@ -+# Copyright 2007 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 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+set testfile fork-detach -+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} -+ -+gdb_run_cmd -+# `Starting program: .*' prefix is available since gdb-6.7. -+gdb_test "" \ -+ "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \ -+ "Info message caught" --- -2.14.3 - diff --git a/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch b/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch index fd7e45d..0c44ef2 100644 --- a/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +++ b/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch @@ -3,8 +3,6 @@ From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch -FileName: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch - ;; Support for stepping over PPC atomic instruction sequences (BZ 237572). ;;=fedoratest @@ -12,16 +10,9 @@ FileName: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch * gdb.threads/atomic-seq-threaded.c, gdb.threads/atomic-seq-threaded.exp: New files. ---- - gdb/testsuite/gdb.threads/atomic-seq-threaded.c | 171 ++++++++++++++++++++++ - gdb/testsuite/gdb.threads/atomic-seq-threaded.exp | 84 +++++++++++ - 2 files changed, 255 insertions(+) - create mode 100644 gdb/testsuite/gdb.threads/atomic-seq-threaded.c - create mode 100644 gdb/testsuite/gdb.threads/atomic-seq-threaded.exp diff --git a/gdb/testsuite/gdb.threads/atomic-seq-threaded.c b/gdb/testsuite/gdb.threads/atomic-seq-threaded.c new file mode 100644 -index 0000000000..04f998bfa6 --- /dev/null +++ b/gdb/testsuite/gdb.threads/atomic-seq-threaded.c @@ -0,0 +1,171 @@ @@ -198,7 +189,6 @@ index 0000000000..04f998bfa6 +} diff --git a/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp b/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp new file mode 100644 -index 0000000000..eb49db506e --- /dev/null +++ b/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp @@ -0,0 +1,84 @@ @@ -286,6 +276,3 @@ index 0000000000..eb49db506e +gdb_test "c" \ + ".*Program exited normally\\..*" \ + "run till program exit" --- -2.14.3 - diff --git a/gdb-6.6-scheduler_locking-step-is-default.patch b/gdb-6.6-scheduler_locking-step-is-default.patch index 57de329..dabe639 100644 --- a/gdb-6.6-scheduler_locking-step-is-default.patch +++ b/gdb-6.6-scheduler_locking-step-is-default.patch @@ -3,23 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-scheduler_locking-step-is-default.patch -FileName: gdb-6.6-scheduler_locking-step-is-default.patch - ;; Make upstream `set scheduler-locking step' as default. ;;=push+jan: How much is scheduler-locking relevant after non-stop? ---- - gdb/infrun.c | 2 +- - gdb/testsuite/gdb.mi/mi-cli.exp | 2 +- - gdb/testsuite/gdb.mi/mi-console.exp | 3 +++ - gdb/testsuite/gdb.mi/mi-logging.exp | 4 ++-- - gdb/testsuite/gdb.opt/inline-cmds.exp | 2 +- - 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c -index 23439979b5..1d0f731954 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c -@@ -2202,7 +2202,7 @@ static const char *const scheduler_enums[] = { +@@ -2193,7 +2193,7 @@ static const char *const scheduler_enums[] = { schedlock_replay, NULL }; @@ -29,7 +19,6 @@ index 23439979b5..1d0f731954 100644 show_scheduler_mode (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) diff --git a/gdb/testsuite/gdb.mi/mi-cli.exp b/gdb/testsuite/gdb.mi/mi-cli.exp -index 6ce6439eb7..4f405b5fc1 100644 --- a/gdb/testsuite/gdb.mi/mi-cli.exp +++ b/gdb/testsuite/gdb.mi/mi-cli.exp @@ -199,7 +199,7 @@ mi_expect_stop "breakpoint-hit" "main" "" ".*basics.c" \ @@ -42,7 +31,6 @@ index 6ce6439eb7..4f405b5fc1 100644 # Test that the new current source line is output to the console diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp -index ec4b006018..05cf7fb889 100644 --- a/gdb/testsuite/gdb.mi/mi-console.exp +++ b/gdb/testsuite/gdb.mi/mi-console.exp @@ -60,6 +60,9 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb @@ -56,7 +44,6 @@ index ec4b006018..05cf7fb889 100644 # we are semihosted (e.g., the sim or a remote target that supports # the File I/O remote protocol extension), we see the target I/O diff --git a/gdb/testsuite/gdb.mi/mi-logging.exp b/gdb/testsuite/gdb.mi/mi-logging.exp -index b09cde2d37..e51d46edb5 100644 --- a/gdb/testsuite/gdb.mi/mi-logging.exp +++ b/gdb/testsuite/gdb.mi/mi-logging.exp @@ -53,7 +53,7 @@ close $chan @@ -78,7 +65,6 @@ index b09cde2d37..e51d46edb5 100644 } else { fail "redirect log file contents" diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inline-cmds.exp -index 5227d63f5d..782f31c080 100644 --- a/gdb/testsuite/gdb.opt/inline-cmds.exp +++ b/gdb/testsuite/gdb.opt/inline-cmds.exp @@ -331,7 +331,7 @@ proc mi_cli_step {cli_output_re message} { @@ -90,6 +76,3 @@ index 5227d63f5d..782f31c080 100644 pass $message } timeout { --- -2.14.3 - diff --git a/gdb-6.6-testsuite-timeouts.patch b/gdb-6.6-testsuite-timeouts.patch index f3c492c..180e20f 100644 --- a/gdb-6.6-testsuite-timeouts.patch +++ b/gdb-6.6-testsuite-timeouts.patch @@ -3,17 +3,10 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.6-testsuite-timeouts.patch -FileName: gdb-6.6-testsuite-timeouts.patch - ;; Avoid too long timeouts on failing cases of "annota1.exp annota3.exp". ;;=fedoratest ---- - gdb/testsuite/gdb.base/annota1.exp | 2 ++ - gdb/testsuite/gdb.base/annota3.exp | 2 ++ - 2 files changed, 4 insertions(+) diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp -index 4b34aa84f2..40e08a4db2 100644 --- a/gdb/testsuite/gdb.base/annota1.exp +++ b/gdb/testsuite/gdb.base/annota1.exp @@ -39,6 +39,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb @@ -26,7 +19,6 @@ index 4b34aa84f2..40e08a4db2 100644 # to continue" prompts. gdb_test_no_output "set height 0" diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp -index a899be69ea..af472af8a5 100644 --- a/gdb/testsuite/gdb.base/annota3.exp +++ b/gdb/testsuite/gdb.base/annota3.exp @@ -38,6 +38,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb @@ -38,6 +30,3 @@ index a899be69ea..af472af8a5 100644 # The commands we test here produce many lines of output; disable "press # to continue" prompts. gdb_test_no_output "set height 0" --- -2.14.3 - diff --git a/gdb-6.7-charsign-test.patch b/gdb-6.7-charsign-test.patch index 64da3b2..84f4fff 100644 --- a/gdb-6.7-charsign-test.patch +++ b/gdb-6.7-charsign-test.patch @@ -3,8 +3,6 @@ From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.7-charsign-test.patch -FileName: gdb-6.7-charsign-test.patch - ;; Fix displaying of numeric char arrays as strings (BZ 224128). ;;=fedoratest: But it is failing anyway, one should check the behavior more. @@ -19,16 +17,9 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128 Port to GDB-6.7 - only the testcase left, patch has been reverted, char-vectors restricted. ---- - gdb/testsuite/gdb.base/charsign.c | 37 ++++++++++++++++++++++ - gdb/testsuite/gdb.base/charsign.exp | 63 +++++++++++++++++++++++++++++++++++++ - 2 files changed, 100 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/charsign.c - create mode 100644 gdb/testsuite/gdb.base/charsign.exp diff --git a/gdb/testsuite/gdb.base/charsign.c b/gdb/testsuite/gdb.base/charsign.c new file mode 100644 -index 0000000000..41d175ff9d --- /dev/null +++ b/gdb/testsuite/gdb.base/charsign.c @@ -0,0 +1,37 @@ @@ -71,7 +62,6 @@ index 0000000000..41d175ff9d +char_u u_typed[]="A"; diff --git a/gdb/testsuite/gdb.base/charsign.exp b/gdb/testsuite/gdb.base/charsign.exp new file mode 100644 -index 0000000000..b5fa580490 --- /dev/null +++ b/gdb/testsuite/gdb.base/charsign.exp @@ -0,0 +1,63 @@ @@ -138,6 +128,3 @@ index 0000000000..b5fa580490 +do_test {} +do_test {-fsigned-char} +do_test {-funsigned-char} --- -2.14.3 - diff --git a/gdb-6.7-ppc-clobbered-registers-O2-test.patch b/gdb-6.7-ppc-clobbered-registers-O2-test.patch index 94fe4db..99143d4 100644 --- a/gdb-6.7-ppc-clobbered-registers-O2-test.patch +++ b/gdb-6.7-ppc-clobbered-registers-O2-test.patch @@ -3,8 +3,6 @@ From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.7-ppc-clobbered-registers-O2-test.patch -FileName: gdb-6.7-ppc-clobbered-registers-O2-test.patch - ;; Test PPC hiding of call-volatile parameter register. ;;=fedoratest @@ -22,16 +20,9 @@ http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html * rs6000-tdep.c (ppc_dwarf2_frame_init_reg): New function. * (rs6000_gdbarch_init): Install ppc_dwarf2_frame_init_reg as default dwarf2_frame_set_init_reg function. ---- - .../gdb.arch/ppc-clobbered-registers-O2.c | 21 +++++++++ - .../gdb.arch/ppc-clobbered-registers-O2.exp | 54 ++++++++++++++++++++++ - 2 files changed, 75 insertions(+) - create mode 100644 gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c - create mode 100644 gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp diff --git a/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c new file mode 100644 -index 0000000000..698ff8a0b5 --- /dev/null +++ b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c @@ -0,0 +1,21 @@ @@ -58,7 +49,6 @@ index 0000000000..698ff8a0b5 +} diff --git a/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp new file mode 100644 -index 0000000000..c9ebd0e522 --- /dev/null +++ b/gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp @@ -0,0 +1,54 @@ @@ -116,6 +106,3 @@ index 0000000000..c9ebd0e522 + +gdb_test backtrace ".*operand0=.*operand1=.*" \ + "Check value of call clobbered registers" --- -2.14.3 - diff --git a/gdb-6.7-testsuite-stable-results.patch b/gdb-6.7-testsuite-stable-results.patch index 9be0f85..841806b 100644 --- a/gdb-6.7-testsuite-stable-results.patch +++ b/gdb-6.7-testsuite-stable-results.patch @@ -3,8 +3,6 @@ From: Jan Kratochvil Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.7-testsuite-stable-results.patch -FileName: gdb-6.7-testsuite-stable-results.patch - ;; Testsuite fixes for more stable/comparable results. ;;=fedoratest @@ -26,13 +24,8 @@ random FAIL: gdb.base/auxv.exp: matching auxv data from live and gcore gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp: frames-invalid can happen asynchronously. ---- - gdb/testsuite/gdb.base/fileio.c | 22 ++++++++++++++++++++++ - gdb/testsuite/gdb.base/fileio.exp | 13 ++++++------- - 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c -index 7f482a34d3..1caadbae84 100644 --- a/gdb/testsuite/gdb.base/fileio.c +++ b/gdb/testsuite/gdb.base/fileio.c @@ -560,6 +560,28 @@ strerrno (int err) @@ -65,7 +58,6 @@ index 7f482a34d3..1caadbae84 100644 test_open (); test_write (); diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp -index bc409c26aa..e1e5e2e5d0 100644 --- a/gdb/testsuite/gdb.base/fileio.exp +++ b/gdb/testsuite/gdb.base/fileio.exp @@ -24,9 +24,9 @@ if [target_info exists gdb,nofileio] { @@ -110,6 +102,3 @@ index bc409c26aa..e1e5e2e5d0 100644 set timeout $oldtimeout return 0 --- -2.14.3 - diff --git a/gdb-6.8-attach-signalled-detach-stopped.patch b/gdb-6.8-attach-signalled-detach-stopped.patch deleted file mode 100644 index af9a0af..0000000 --- a/gdb-6.8-attach-signalled-detach-stopped.patch +++ /dev/null @@ -1,199 +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-attach-signalled-detach-stopped.patch - -FileName: gdb-6.8-attach-signalled-detach-stopped.patch - -;; [RHEL5,RHEL6] Fix attaching to stopped processes. -;; [RHEL5] Workaround kernel for detaching SIGSTOPped processes (BZ 809382). -;;=fedora ---- - gdb/infrun.c | 7 ++++ - gdb/linux-nat.c | 45 +++++++++++++++++++++ - gdb/testsuite/gdb.threads/attach-stopped.exp | 60 +++++++++++++++++++++++++++- - 3 files changed, 111 insertions(+), 1 deletion(-) - -diff --git a/gdb/infrun.c b/gdb/infrun.c -index b468d02fd6..16561dd119 100644 ---- a/gdb/infrun.c -+++ b/gdb/infrun.c -@@ -606,6 +606,13 @@ holding the child stopped. Try \"set detach-on-fork\" or \ - target_pid_to_str (process_ptid)); - } - -+#ifdef NEED_DETACH_SIGSTOP -+ /* We should check PID_WAS_STOPPED and detach it stopped accordingly. -+ In this point of code it cannot be 1 as we would not get FORK -+ executed without CONTINUE first which resets PID_WAS_STOPPED. -+ We would have to first TARGET_STOP and WAITPID it as with running -+ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */ -+#endif - target_detach (NULL, 0); - } - -diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c -index 1570a2bcb6..a101fbbe33 100644 ---- a/gdb/linux-nat.c -+++ b/gdb/linux-nat.c -@@ -194,6 +194,11 @@ enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN; - static struct target_ops *linux_ops; - static struct target_ops linux_ops_saved; - -+#ifdef NEED_DETACH_SIGSTOP -+/* PID of the inferior stopped by SIGSTOP before attaching (or zero). */ -+static pid_t pid_was_stopped; -+ -+#endif - /* The method to call, if any, when a new thread is attached. */ - static void (*linux_nat_new_thread) (struct lwp_info *); - -@@ -1065,6 +1070,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"); -+#ifdef NEED_DETACH_SIGSTOP -+ pid_was_stopped = ptid_get_pid (ptid); -+#endif - - /* The process is definitely stopped. It is in a job control - stop, unless the kernel predates the TASK_STOPPED / -@@ -1420,6 +1428,25 @@ get_detach_signal (struct lwp_info *lp) - return gdb_signal_to_host (signo); - } - -+#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) -+ { -+ int err; -+ -+ errno = 0; -+ err = kill_lwp (ptid_get_lwp (lp->ptid), SIGSTOP); -+ if (debug_linux_nat) -+ { -+ fprintf_unfiltered (gdb_stdlog, -+ "SC: lwp kill %d %s\n", -+ err, -+ errno ? safe_strerror (errno) : "ERRNO-OK"); -+ } -+ } -+ -+#endif - return 0; - } - -@@ -1578,6 +1605,10 @@ linux_nat_detach (struct target_ops *ops, const char *args, int from_tty) - detach_one_lwp (main_lwp, &signo); - - inf_ptrace_detach_success (ops); -+ -+#ifdef NEED_DETACH_SIGSTOP -+ pid_was_stopped = 0; -+#endif - } - } - -@@ -1838,6 +1869,16 @@ linux_nat_resume (struct target_ops *ops, - return; - } - -+#ifdef NEED_DETACH_SIGSTOP -+ /* At this point, we are going to resume the inferior and if we -+ have attached to a stopped process, we no longer should leave -+ 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)) -+ pid_was_stopped = 0; -+ -+#endif - if (resume_many) - iterate_over_lwps (ptid, linux_nat_resume_callback, lp); - -@@ -3830,6 +3871,10 @@ linux_nat_mourn_inferior (struct target_ops *ops) - - /* Let the arch-specific native code know this process is gone. */ - linux_nat_forget_process (pid); -+#ifdef NEED_DETACH_SIGSTOP -+ -+ pid_was_stopped = 0; -+#endif - } - - /* Convert a native/host siginfo object, into/from the siginfo in the -diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp -index 6c8c8bf10e..c953a9c60d 100644 ---- a/gdb/testsuite/gdb.threads/attach-stopped.exp -+++ b/gdb/testsuite/gdb.threads/attach-stopped.exp -@@ -56,7 +56,65 @@ proc corefunc { threadtype } { - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${binfile} - -- # Verify that we can attach to the stopped process. -+ # Verify that we can attach to the process by first giving its -+ # executable name via the file command, and using attach with the -+ # process ID. -+ -+ set test "$threadtype: set file, before attach1 to stopped process" -+ gdb_test_multiple "file $binfile" "$test" { -+ -re "Load new symbol table from.*y or n. $" { -+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \ -+ "$test (re-read)" -+ } -+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" { -+ pass "$test" -+ } -+ } -+ -+ set test "$threadtype: attach1 to stopped, after setting file" -+ gdb_test_multiple "attach $testpid" "$test" { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ pass "$test" -+ } -+ } -+ -+ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there. -+ if {[string equal $threadtype threaded]} { -+ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach1 to stopped bt" -+ } else { -+ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach1 to stopped bt" -+ } -+ -+ # Exit and detach the process. -+ -+ gdb_exit -+ -+ # Avoid some race: -+ sleep 2 -+ -+ if [catch {open /proc/${testpid}/status r} fileid] { -+ set line2 "NOTFOUND" -+ } else { -+ gets $fileid line1; -+ gets $fileid line2; -+ close $fileid; -+ } -+ -+ set test "$threadtype: attach1, exit leaves process stopped" -+ if {[string match "*(stopped)*" $line2]} { -+ pass $test -+ } else { -+ fail $test -+ } -+ -+ # At this point, the process should still be stopped -+ -+ gdb_start -+ gdb_reinitialize_dir $srcdir/$subdir -+ gdb_load ${binfile} -+ -+ # Verify that we can attach to the process just by giving the -+ # process ID. - - set test "$threadtype: attach2 to stopped, after setting file" - gdb_test_multiple "attach $testpid" "$test" { --- -2.14.3 - diff --git a/gdb-6.8-bz436037-reg-no-longer-active.patch b/gdb-6.8-bz436037-reg-no-longer-active.patch index 5ff7334..86c833c 100644 --- a/gdb-6.8-bz436037-reg-no-longer-active.patch +++ b/gdb-6.8-bz436037-reg-no-longer-active.patch @@ -3,19 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-bz436037-reg-no-longer-active.patch -FileName: gdb-6.8-bz436037-reg-no-longer-active.patch - ;; Fix register assignments with no GDB stack frames (BZ 436037). ;;=push+jan: This fix is incorrect. ---- - gdb/valops.c | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gdb/valops.c b/gdb/valops.c -index 9b25980090..7aacd17d70 100644 --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -1103,6 +1103,8 @@ value_assign (struct value *toval, struct value *fromval) +@@ -1104,6 +1104,8 @@ value_assign (struct value *toval, struct value *fromval) struct gdbarch *gdbarch; int value_reg; @@ -24,7 +18,7 @@ index 9b25980090..7aacd17d70 100644 /* Figure out which frame this is in currently. We use VALUE_FRAME_ID for obtaining the value's frame id instead of -@@ -1112,8 +1114,14 @@ value_assign (struct value *toval, struct value *fromval) +@@ -1113,8 +1115,14 @@ value_assign (struct value *toval, struct value *fromval) frame. */ frame = frame_find_by_id (VALUE_FRAME_ID (toval)); @@ -41,6 +35,3 @@ index 9b25980090..7aacd17d70 100644 if (!frame) error (_("Value being assigned to is no longer active.")); --- -2.14.3 - diff --git a/gdb-6.8-bz442765-threaded-exec-test.patch b/gdb-6.8-bz442765-threaded-exec-test.patch index dd66c58..6468888 100644 --- a/gdb-6.8-bz442765-threaded-exec-test.patch +++ b/gdb-6.8-bz442765-threaded-exec-test.patch @@ -3,19 +3,12 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-bz442765-threaded-exec-test.patch -FileName: gdb-6.8-bz442765-threaded-exec-test.patch - ;; Test various forms of threads tracking across exec() (BZ 442765). ;;=fedoratest Test various forms of threads tracking across exec(2). ---- - gdb/testsuite/gdb.threads/threaded-exec.c | 111 ++++++++++++++++++++++++++-- - gdb/testsuite/gdb.threads/threaded-exec.exp | 13 +++- - 2 files changed, 115 insertions(+), 9 deletions(-) diff --git a/gdb/testsuite/gdb.threads/threaded-exec.c b/gdb/testsuite/gdb.threads/threaded-exec.c -index 522b24671d..7079317d3a 100644 --- a/gdb/testsuite/gdb.threads/threaded-exec.c +++ b/gdb/testsuite/gdb.threads/threaded-exec.c @@ -18,21 +18,95 @@ @@ -155,7 +148,6 @@ index 522b24671d..7079317d3a 100644 + assert (0); } diff --git a/gdb/testsuite/gdb.threads/threaded-exec.exp b/gdb/testsuite/gdb.threads/threaded-exec.exp -index 77c8a7dc85..8c43162b36 100644 --- a/gdb/testsuite/gdb.threads/threaded-exec.exp +++ b/gdb/testsuite/gdb.threads/threaded-exec.exp @@ -20,9 +20,14 @@ @@ -187,6 +179,3 @@ index 77c8a7dc85..8c43162b36 100644 gdb_test_multiple {} "Program exited" { -re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" { --- -2.14.3 - diff --git a/gdb-6.8-bz466901-backtrace-full-prelinked.patch b/gdb-6.8-bz466901-backtrace-full-prelinked.patch index 43c7c7f..a605129 100644 --- a/gdb-6.8-bz466901-backtrace-full-prelinked.patch +++ b/gdb-6.8-bz466901-backtrace-full-prelinked.patch @@ -3,24 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-bz466901-backtrace-full-prelinked.patch -FileName: gdb-6.8-bz466901-backtrace-full-prelinked.patch - ;; Fix resolving of variables at locations lists in prelinked libs (BZ 466901). ;;=fedoratest Fix resolving of variables at locations lists in prelinked libs (BZ 466901). ---- - .../gdb.dwarf2/dw2-loclist-prelinked-func.S | 328 +++++++++++++++++++++ - .../gdb.dwarf2/dw2-loclist-prelinked-main.c | 26 ++ - gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp | 102 +++++++ - 3 files changed, 456 insertions(+) - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp diff --git a/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S new file mode 100644 -index 0000000000..442c4d00a1 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S @@ -0,0 +1,328 @@ @@ -354,7 +343,6 @@ index 0000000000..442c4d00a1 + .section .note.GNU-stack,"",@progbits diff --git a/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c new file mode 100644 -index 0000000000..57386999ce --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c @@ -0,0 +1,26 @@ @@ -386,7 +374,6 @@ index 0000000000..57386999ce +} diff --git a/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp new file mode 100644 -index 0000000000..30d0473336 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp @@ -0,0 +1,102 @@ @@ -492,6 +479,3 @@ index 0000000000..30d0473336 + +# `abort' can get expressed as `*__GI_abort'. +gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\r\n\[\t \]+i = -?\[0-9\].*in main \\(.*" "Backtrace after abort()" --- -2.14.3 - diff --git a/gdb-6.8-quit-never-aborts.patch b/gdb-6.8-quit-never-aborts.patch index 3a928bd..ce30ef7 100644 --- a/gdb-6.8-quit-never-aborts.patch +++ b/gdb-6.8-quit-never-aborts.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-quit-never-aborts.patch -FileName: gdb-6.8-quit-never-aborts.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 . @@ -14,15 +12,8 @@ being sent during a testcase terminating its child GDB. Some of the threads may not be properly PTRACE_DETACHed which hurts if they should have been detached with SIGSTOP (as they are accidentally left running on the debugger termination). ---- - gdb/defs.h | 4 ++++ - gdb/extension.c | 5 +++++ - gdb/top.c | 6 ++++++ - gdb/utils.c | 7 +++++++ - 4 files changed, 22 insertions(+) diff --git a/gdb/defs.h b/gdb/defs.h -index 0c156d56c3..9a7f4d52b0 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -168,6 +168,10 @@ extern void default_quit_handler (void); @@ -37,10 +28,9 @@ index 0c156d56c3..9a7f4d52b0 100644 /* Helper for the QUIT macro. */ diff --git a/gdb/extension.c b/gdb/extension.c -index a1ee3510a6..229d702270 100644 --- a/gdb/extension.c +++ b/gdb/extension.c -@@ -830,6 +830,11 @@ check_quit_flag (void) +@@ -820,6 +820,11 @@ check_quit_flag (void) int i, result = 0; const struct extension_language_defn *extlang; @@ -53,11 +43,10 @@ index a1ee3510a6..229d702270 100644 { if (extlang->ops->check_quit_flag != NULL) diff --git a/gdb/top.c b/gdb/top.c -index 4749cf561d..e2665c8e22 100644 --- a/gdb/top.c +++ b/gdb/top.c -@@ -1580,7 +1580,13 @@ quit_force (int *exit_arg, int from_tty) - qt.args = NULL; +@@ -1606,7 +1606,13 @@ quit_force (int *exit_arg, int from_tty) + qt.from_tty = from_tty; +#ifndef NEED_DETACH_SIGSTOP @@ -71,10 +60,9 @@ index 4749cf561d..e2665c8e22 100644 /* Get out of tfind mode, and kill or detach all inferiors. */ TRY diff --git a/gdb/utils.c b/gdb/utils.c -index 6f0abc98a2..58c0380d17 100644 --- a/gdb/utils.c +++ b/gdb/utils.c -@@ -107,6 +107,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time; +@@ -108,6 +108,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time; static int debug_timestamp = 0; @@ -88,6 +76,3 @@ index 6f0abc98a2..58c0380d17 100644 /* Nonzero means that strings with character values >0x7F should be printed as octal escapes. Zero means just print the value (e.g. it's an international character, and the terminal or window can cope.) */ --- -2.14.3 - diff --git a/gdb-6.8-sparc64-silence-memcpy-check.patch b/gdb-6.8-sparc64-silence-memcpy-check.patch index 3762783..340ed7e 100644 --- a/gdb-6.8-sparc64-silence-memcpy-check.patch +++ b/gdb-6.8-sparc64-silence-memcpy-check.patch @@ -3,26 +3,17 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-sparc64-silence-memcpy-check.patch -FileName: 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. ---- - gdb/sparc-tdep.c | 1 + - 1 file changed, 1 insertion(+) diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c -index 12fd5b9e64..e304ba8dbc 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c -@@ -1444,6 +1444,7 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache, +@@ -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 (regcache, SPARC_F0_REGNUM, buf); + regcache->cooked_write (SPARC_F0_REGNUM, buf); if (len > 4) --- -2.14.3 - diff --git a/gdb-6.8-watchpoint-conditionals-test.patch b/gdb-6.8-watchpoint-conditionals-test.patch index 5e28d47..21a38f6 100644 --- a/gdb-6.8-watchpoint-conditionals-test.patch +++ b/gdb-6.8-watchpoint-conditionals-test.patch @@ -3,24 +3,15 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.8-watchpoint-conditionals-test.patch -FileName: 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 ---- - gdb/testsuite/gdb.base/watchpoint-cond.c | 31 +++++++++++++++++++++++++ - gdb/testsuite/gdb.base/watchpoint-cond.exp | 37 ++++++++++++++++++++++++++++++ - 2 files changed, 68 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/watchpoint-cond.c - create mode 100644 gdb/testsuite/gdb.base/watchpoint-cond.exp diff --git a/gdb/testsuite/gdb.base/watchpoint-cond.c b/gdb/testsuite/gdb.base/watchpoint-cond.c new file mode 100644 -index 0000000000..d4ec581946 --- /dev/null +++ b/gdb/testsuite/gdb.base/watchpoint-cond.c @@ -0,0 +1,31 @@ @@ -57,7 +48,6 @@ index 0000000000..d4ec581946 +} diff --git a/gdb/testsuite/gdb.base/watchpoint-cond.exp b/gdb/testsuite/gdb.base/watchpoint-cond.exp new file mode 100644 -index 0000000000..31d5b602aa --- /dev/null +++ b/gdb/testsuite/gdb.base/watchpoint-cond.exp @@ -0,0 +1,37 @@ @@ -98,6 +88,3 @@ index 0000000000..31d5b602aa + +gdb_test "watch i if i < 20" "atchpoint \[0-9\]+: i" +gdb_test "cont" "atchpoint \[0-9\]+: i.*Old value = 20.*New value = 19.*" --- -2.14.3 - 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 index 9a278c6..dd3a877 100644 --- 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 @@ -3,8 +3,6 @@ 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 -FileName: 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. @@ -17,12 +15,8 @@ FileName: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.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 ---- - gdb/gdb_bfd.c | 6 ++++++ - 1 file changed, 6 insertions(+) diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c -index 80ddd427af..3e4d3e4444 100644 --- a/gdb/gdb_bfd.c +++ b/gdb/gdb_bfd.c @@ -24,12 +24,14 @@ @@ -72,6 +66,3 @@ index 80ddd427af..3e4d3e4444 100644 /* Handle compressed sections, or ordinary uncompressed sections in the no-mmap case. */ --- -2.14.3 - diff --git a/gdb-8.1.tar.bz2 b/gdb-8.1.tar.bz2 deleted file mode 100644 index ca003f7..0000000 --- a/gdb-8.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9cdcfe72c9af064d3becce06047bbfd7446fa49812db01ef4d5caa97b4dfa082 -size 28966596 diff --git a/gdb-8.2.tar.bz2 b/gdb-8.2.tar.bz2 new file mode 100644 index 0000000..b124ce7 --- /dev/null +++ b/gdb-8.2.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dee9c5028f1fbe1415556e0f64a79d1f9a261516857af37ed6105f0b53999772 +size 29034948 diff --git a/gdb-archer-next-over-throw-cxx-exec.patch b/gdb-archer-next-over-throw-cxx-exec.patch index 1a7e126..7ee8188 100644 --- a/gdb-archer-next-over-throw-cxx-exec.patch +++ b/gdb-archer-next-over-throw-cxx-exec.patch @@ -3,23 +3,14 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-archer-next-over-throw-cxx-exec.patch -FileName: gdb-archer-next-over-throw-cxx-exec.patch - ;; Fix follow-exec for C++ programs (bugreported by Martin Stransky). ;;=fedoratest Archer-upstreamed: http://sourceware.org/ml/archer/2010-q2/msg00031.html ---- - gdb/testsuite/gdb.cp/cxxexec.cc | 25 ++++++++++++++++++++ - gdb/testsuite/gdb.cp/cxxexec.exp | 51 ++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 76 insertions(+) - create mode 100644 gdb/testsuite/gdb.cp/cxxexec.cc - create mode 100644 gdb/testsuite/gdb.cp/cxxexec.exp diff --git a/gdb/testsuite/gdb.cp/cxxexec.cc b/gdb/testsuite/gdb.cp/cxxexec.cc new file mode 100644 -index 0000000000..48fd63e9d3 --- /dev/null +++ b/gdb/testsuite/gdb.cp/cxxexec.cc @@ -0,0 +1,25 @@ @@ -50,7 +41,6 @@ index 0000000000..48fd63e9d3 +} diff --git a/gdb/testsuite/gdb.cp/cxxexec.exp b/gdb/testsuite/gdb.cp/cxxexec.exp new file mode 100644 -index 0000000000..c85dd0129d --- /dev/null +++ b/gdb/testsuite/gdb.cp/cxxexec.exp @@ -0,0 +1,51 @@ @@ -105,6 +95,3 @@ index 0000000000..c85dd0129d + +# `info inferiors' can show on older GDBs. +gdb_test "info threads" "info threads" "program finished" --- -2.14.3 - diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch index 223ff80..5d5ad27 100644 --- a/gdb-archer-pie-addons-keep-disabled.patch +++ b/gdb-archer-pie-addons-keep-disabled.patch @@ -3,20 +3,12 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-archer-pie-addons-keep-disabled.patch -FileName: gdb-archer-pie-addons-keep-disabled.patch - ;;=push+jan: Breakpoints disabling matching should not be based on address. ---- - gdb/breakpoint.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ - gdb/breakpoint.h | 3 +++ - gdb/objfiles.c | 5 +++++ - 3 files changed, 52 insertions(+) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index 2b5eebbbee..814802a0a1 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -15590,6 +15590,50 @@ initialize_breakpoint_ops (void) +@@ -15522,6 +15522,50 @@ initialize_breakpoint_ops (void) static struct cmd_list_element *enablebreaklist = NULL; @@ -68,10 +60,9 @@ index 2b5eebbbee..814802a0a1 100644 _initialize_breakpoint (void) { diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h -index 8bb81d8d17..3fddbaa713 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h -@@ -1656,6 +1656,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); @@ -82,10 +73,9 @@ index 8bb81d8d17..3fddbaa713 100644 extern void print_breakpoint (breakpoint *bp); diff --git a/gdb/objfiles.c b/gdb/objfiles.c -index 7adaef119d..2f061b47f7 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c -@@ -879,6 +879,11 @@ objfile_relocate1 (struct objfile *objfile, +@@ -883,6 +883,11 @@ objfile_relocate1 (struct objfile *objfile, obj_section_addr (s)); } @@ -97,6 +87,3 @@ index 7adaef119d..2f061b47f7 100644 /* Data changed. */ return 1; } --- -2.14.3 - diff --git a/gdb-archer-pie-addons.patch b/gdb-archer-pie-addons.patch index bc162fd..09bde5f 100644 --- a/gdb-archer-pie-addons.patch +++ b/gdb-archer-pie-addons.patch @@ -3,19 +3,12 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-archer-pie-addons.patch -FileName: gdb-archer-pie-addons.patch - ;;=push+jan: May get obsoleted by Tom's unrelocated objfiles patch. ---- - gdb/gdbtypes.h | 5 +++++ - gdb/value.c | 3 ++- - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h -index 179238ce82..5597038357 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h -@@ -453,6 +453,7 @@ enum field_loc_kind +@@ -505,6 +505,7 @@ enum field_loc_kind { FIELD_LOC_KIND_BITPOS, /**< bitpos */ FIELD_LOC_KIND_ENUMVAL, /**< enumval */ @@ -23,7 +16,7 @@ index 179238ce82..5597038357 100644 FIELD_LOC_KIND_PHYSADDR, /**< physaddr */ FIELD_LOC_KIND_PHYSNAME, /**< physname */ FIELD_LOC_KIND_DWARF_BLOCK /**< dwarf_block */ -@@ -504,6 +505,7 @@ union field_location +@@ -556,6 +557,7 @@ union field_location field. Otherwise, physname is the mangled label of the static field. */ @@ -31,7 +24,7 @@ index 179238ce82..5597038357 100644 CORE_ADDR physaddr; const char *physname; -@@ -1362,6 +1364,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); +@@ -1438,6 +1440,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) @@ -39,7 +32,7 @@ index 179238ce82..5597038357 100644 #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block) #define SET_FIELD_BITPOS(thisfld, bitpos) \ -@@ -1373,6 +1376,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); +@@ -1449,6 +1452,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)) @@ -47,7 +40,7 @@ index 179238ce82..5597038357 100644 #define SET_FIELD_PHYSADDR(thisfld, addr) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \ FIELD_STATIC_PHYSADDR (thisfld) = (addr)) -@@ -1389,6 +1393,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); +@@ -1465,6 +1469,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)) @@ -56,10 +49,9 @@ index 179238ce82..5597038357 100644 #define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n)) diff --git a/gdb/value.c b/gdb/value.c -index d4b4673f66..558d0bbd7a 100644 --- a/gdb/value.c +++ b/gdb/value.c -@@ -2966,7 +2966,8 @@ value_static_field (struct type *type, int fieldno) +@@ -2829,7 +2829,8 @@ value_static_field (struct type *type, int fieldno) { case FIELD_LOC_KIND_PHYSADDR: retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno), @@ -69,6 +61,3 @@ index d4b4673f66..558d0bbd7a 100644 break; case FIELD_LOC_KIND_PHYSNAME: { --- -2.14.3 - diff --git a/gdb-archer-vla-tests.patch b/gdb-archer-vla-tests.patch index 9531e8d..3eb880e 100644 --- a/gdb-archer-vla-tests.patch +++ b/gdb-archer-vla-tests.patch @@ -3,101 +3,9 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-archer-vla-tests.patch -FileName: gdb-archer-vla-tests.patch - ;;=fedoratest ---- - gdb/testsuite/gdb.ada/packed_array.exp | 6 + - gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S | 358 ++++++++++++++++ - gdb/testsuite/gdb.arch/x86_64-vla-pointer.c | 45 ++ - gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp | 65 +++ - gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S | 455 +++++++++++++++++++++ - gdb/testsuite/gdb.arch/x86_64-vla-typedef.c | 45 ++ - gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp | 64 +++ - gdb/testsuite/gdb.base/arrayidx.c | 7 + - gdb/testsuite/gdb.base/arrayidx.exp | 10 +- - .../gdb.base/internal-var-field-address.c | 20 + - .../gdb.base/internal-var-field-address.exp | 26 ++ - gdb/testsuite/gdb.base/vla-frame.c | 31 ++ - gdb/testsuite/gdb.base/vla-frame.exp | 38 ++ - gdb/testsuite/gdb.base/vla-overflow.c | 30 ++ - gdb/testsuite/gdb.base/vla-overflow.exp | 109 +++++ - gdb/testsuite/gdb.base/vla.c | 55 +++ - gdb/testsuite/gdb.base/vla.exp | 62 +++ - gdb/testsuite/gdb.cp/gdb9593.cc | 180 ++++++++ - gdb/testsuite/gdb.cp/gdb9593.exp | 182 +++++++++ - gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S | 246 +++++++++++ - gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp | 66 +++ - gdb/testsuite/gdb.dwarf2/dw2-stripped.c | 42 ++ - gdb/testsuite/gdb.dwarf2/dw2-stripped.exp | 79 ++++ - .../gdb.dwarf2/dw2-struct-member-data-location.S | 83 ++++ - .../gdb.dwarf2/dw2-struct-member-data-location.exp | 37 ++ - gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S | 121 ++++++ - gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp | 39 ++ - gdb/testsuite/gdb.fortran/dwarf-stride.exp | 42 ++ - gdb/testsuite/gdb.fortran/dwarf-stride.f90 | 40 ++ - gdb/testsuite/gdb.fortran/dynamic.exp | 154 +++++++ - gdb/testsuite/gdb.fortran/dynamic.f90 | 98 +++++ - gdb/testsuite/gdb.fortran/string.exp | 59 +++ - gdb/testsuite/gdb.fortran/string.f90 | 37 ++ - gdb/testsuite/gdb.fortran/subrange.exp | 72 ++++ - gdb/testsuite/gdb.fortran/subrange.f90 | 28 ++ - gdb/testsuite/gdb.mi/mi2-var-stale-type.c | 26 ++ - gdb/testsuite/gdb.mi/mi2-var-stale-type.exp | 57 +++ - gdb/testsuite/gdb.opt/array-from-register-func.c | 22 + - gdb/testsuite/gdb.opt/array-from-register.c | 28 ++ - gdb/testsuite/gdb.opt/array-from-register.exp | 33 ++ - gdb/testsuite/gdb.opt/fortran-string.exp | 39 ++ - gdb/testsuite/gdb.opt/fortran-string.f90 | 28 ++ - gdb/testsuite/gdb.pascal/arrays.exp | 104 +++++ - gdb/testsuite/gdb.pascal/arrays.pas | 82 ++++ - gdb/testsuite/lib/gdb.exp | 5 + - gdb/testsuite/lib/pascal.exp | 17 + - 46 files changed, 3471 insertions(+), 1 deletion(-) - create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S - create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-pointer.c - create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp - create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S - create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-typedef.c - create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp - create mode 100644 gdb/testsuite/gdb.base/internal-var-field-address.c - create mode 100644 gdb/testsuite/gdb.base/internal-var-field-address.exp - create mode 100644 gdb/testsuite/gdb.base/vla-frame.c - create mode 100644 gdb/testsuite/gdb.base/vla-frame.exp - create mode 100644 gdb/testsuite/gdb.base/vla-overflow.c - create mode 100644 gdb/testsuite/gdb.base/vla-overflow.exp - create mode 100644 gdb/testsuite/gdb.base/vla.c - create mode 100644 gdb/testsuite/gdb.base/vla.exp - create mode 100644 gdb/testsuite/gdb.cp/gdb9593.cc - create mode 100644 gdb/testsuite/gdb.cp/gdb9593.exp - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-stripped.c - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-stripped.exp - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp - create mode 100644 gdb/testsuite/gdb.fortran/dwarf-stride.exp - create mode 100644 gdb/testsuite/gdb.fortran/dwarf-stride.f90 - create mode 100644 gdb/testsuite/gdb.fortran/dynamic.exp - create mode 100644 gdb/testsuite/gdb.fortran/dynamic.f90 - create mode 100644 gdb/testsuite/gdb.fortran/string.exp - create mode 100644 gdb/testsuite/gdb.fortran/string.f90 - create mode 100644 gdb/testsuite/gdb.fortran/subrange.exp - create mode 100644 gdb/testsuite/gdb.fortran/subrange.f90 - create mode 100644 gdb/testsuite/gdb.mi/mi2-var-stale-type.c - create mode 100644 gdb/testsuite/gdb.mi/mi2-var-stale-type.exp - create mode 100644 gdb/testsuite/gdb.opt/array-from-register-func.c - create mode 100644 gdb/testsuite/gdb.opt/array-from-register.c - create mode 100644 gdb/testsuite/gdb.opt/array-from-register.exp - create mode 100644 gdb/testsuite/gdb.opt/fortran-string.exp - create mode 100644 gdb/testsuite/gdb.opt/fortran-string.f90 - create mode 100644 gdb/testsuite/gdb.pascal/arrays.exp - create mode 100644 gdb/testsuite/gdb.pascal/arrays.pas diff --git a/gdb/testsuite/gdb.ada/packed_array.exp b/gdb/testsuite/gdb.ada/packed_array.exp -index 3e614b788a..0ae87786db 100644 --- a/gdb/testsuite/gdb.ada/packed_array.exp +++ b/gdb/testsuite/gdb.ada/packed_array.exp @@ -56,5 +56,11 @@ gdb_test_multiple "$test" "$test" { @@ -114,7 +22,6 @@ index 3e614b788a..0ae87786db 100644 diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S b/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S new file mode 100644 -index 0000000000..3a983e6b22 --- /dev/null +++ b/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S @@ -0,0 +1,358 @@ @@ -478,7 +385,6 @@ index 0000000000..3a983e6b22 + .section .note.GNU-stack,"",@progbits diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c new file mode 100644 -index 0000000000..98ee43bbf2 --- /dev/null +++ b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c @@ -0,0 +1,45 @@ @@ -529,7 +435,6 @@ index 0000000000..98ee43bbf2 +#endif diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp new file mode 100644 -index 0000000000..3e2e64a6ab --- /dev/null +++ b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp @@ -0,0 +1,65 @@ @@ -600,7 +505,6 @@ index 0000000000..3e2e64a6ab +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S b/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S new file mode 100644 -index 0000000000..66f7a399bf --- /dev/null +++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S @@ -0,0 +1,455 @@ @@ -1061,7 +965,6 @@ index 0000000000..66f7a399bf + .section .note.GNU-stack,"",@progbits diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c new file mode 100644 -index 0000000000..40099e9d39 --- /dev/null +++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c @@ -0,0 +1,45 @@ @@ -1112,7 +1015,6 @@ index 0000000000..40099e9d39 +#endif diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp new file mode 100644 -index 0000000000..4ef6214629 --- /dev/null +++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp @@ -0,0 +1,64 @@ @@ -1181,7 +1083,6 @@ index 0000000000..4ef6214629 + +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" diff --git a/gdb/testsuite/gdb.base/arrayidx.c b/gdb/testsuite/gdb.base/arrayidx.c -index 5a0d01d04f..9e4b16e902 100644 --- a/gdb/testsuite/gdb.base/arrayidx.c +++ b/gdb/testsuite/gdb.base/arrayidx.c @@ -17,6 +17,13 @@ @@ -1199,7 +1100,6 @@ index 5a0d01d04f..9e4b16e902 100644 main (void) { diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp -index 91eb3c6056..af29a51f23 100644 --- a/gdb/testsuite/gdb.base/arrayidx.exp +++ b/gdb/testsuite/gdb.base/arrayidx.exp @@ -49,4 +49,12 @@ gdb_test "print array" \ @@ -1218,7 +1118,6 @@ index 91eb3c6056..af29a51f23 100644 +} diff --git a/gdb/testsuite/gdb.base/internal-var-field-address.c b/gdb/testsuite/gdb.base/internal-var-field-address.c new file mode 100644 -index 0000000000..eeb7b8501c --- /dev/null +++ b/gdb/testsuite/gdb.base/internal-var-field-address.c @@ -0,0 +1,20 @@ @@ -1244,7 +1143,6 @@ index 0000000000..eeb7b8501c +} staticstruct = { 1 }; diff --git a/gdb/testsuite/gdb.base/internal-var-field-address.exp b/gdb/testsuite/gdb.base/internal-var-field-address.exp new file mode 100644 -index 0000000000..33c9e94eee --- /dev/null +++ b/gdb/testsuite/gdb.base/internal-var-field-address.exp @@ -0,0 +1,26 @@ @@ -1276,7 +1174,6 @@ index 0000000000..33c9e94eee +gdb_test {p $varstruct.field} " = 1" diff --git a/gdb/testsuite/gdb.base/vla-frame.c b/gdb/testsuite/gdb.base/vla-frame.c new file mode 100644 -index 0000000000..5750f68b3d --- /dev/null +++ b/gdb/testsuite/gdb.base/vla-frame.c @@ -0,0 +1,31 @@ @@ -1313,7 +1210,6 @@ index 0000000000..5750f68b3d +} diff --git a/gdb/testsuite/gdb.base/vla-frame.exp b/gdb/testsuite/gdb.base/vla-frame.exp new file mode 100644 -index 0000000000..47736c7625 --- /dev/null +++ b/gdb/testsuite/gdb.base/vla-frame.exp @@ -0,0 +1,38 @@ @@ -1357,7 +1253,6 @@ index 0000000000..47736c7625 +gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*" diff --git a/gdb/testsuite/gdb.base/vla-overflow.c b/gdb/testsuite/gdb.base/vla-overflow.c new file mode 100644 -index 0000000000..c5d5ee0bb9 --- /dev/null +++ b/gdb/testsuite/gdb.base/vla-overflow.c @@ -0,0 +1,30 @@ @@ -1393,7 +1288,6 @@ index 0000000000..c5d5ee0bb9 +} diff --git a/gdb/testsuite/gdb.base/vla-overflow.exp b/gdb/testsuite/gdb.base/vla-overflow.exp new file mode 100644 -index 0000000000..43a5825979 --- /dev/null +++ b/gdb/testsuite/gdb.base/vla-overflow.exp @@ -0,0 +1,109 @@ @@ -1508,7 +1402,6 @@ index 0000000000..43a5825979 +verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" diff --git a/gdb/testsuite/gdb.base/vla.c b/gdb/testsuite/gdb.base/vla.c new file mode 100644 -index 0000000000..e1f3ed1780 --- /dev/null +++ b/gdb/testsuite/gdb.base/vla.c @@ -0,0 +1,55 @@ @@ -1569,7 +1462,6 @@ index 0000000000..e1f3ed1780 +} diff --git a/gdb/testsuite/gdb.base/vla.exp b/gdb/testsuite/gdb.base/vla.exp new file mode 100644 -index 0000000000..71fe637272 --- /dev/null +++ b/gdb/testsuite/gdb.base/vla.exp @@ -0,0 +1,62 @@ @@ -1637,7 +1529,6 @@ index 0000000000..71fe637272 +gdb_test "p temp3" " = '3' " "second: print temp3" diff --git a/gdb/testsuite/gdb.cp/gdb9593.cc b/gdb/testsuite/gdb.cp/gdb9593.cc new file mode 100644 -index 0000000000..783c9622a8 --- /dev/null +++ b/gdb/testsuite/gdb.cp/gdb9593.cc @@ -0,0 +1,180 @@ @@ -1823,7 +1714,6 @@ index 0000000000..783c9622a8 + diff --git a/gdb/testsuite/gdb.cp/gdb9593.exp b/gdb/testsuite/gdb.cp/gdb9593.exp new file mode 100644 -index 0000000000..ef40424402 --- /dev/null +++ b/gdb/testsuite/gdb.cp/gdb9593.exp @@ -0,0 +1,182 @@ @@ -2011,7 +1901,6 @@ index 0000000000..ef40424402 + "advance-over-throw" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S new file mode 100644 -index 0000000000..aac3baad8a --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S @@ -0,0 +1,246 @@ @@ -2263,7 +2152,6 @@ index 0000000000..aac3baad8a + .string "unsigned int" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp new file mode 100644 -index 0000000000..39e69b470f --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp @@ -0,0 +1,66 @@ @@ -2335,7 +2223,6 @@ index 0000000000..39e69b470f +gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]} diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.c b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c new file mode 100644 -index 0000000000..1f02d90eeb --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c @@ -0,0 +1,42 @@ @@ -2383,7 +2270,6 @@ index 0000000000..1f02d90eeb +} diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp new file mode 100644 -index 0000000000..9336e03157 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp @@ -0,0 +1,79 @@ @@ -2468,7 +2354,6 @@ index 0000000000..9336e03157 + "step" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S new file mode 100644 -index 0000000000..5fcdd84986 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S @@ -0,0 +1,83 @@ @@ -2557,7 +2442,6 @@ index 0000000000..5fcdd84986 + .byte 0x0 /* Terminator */ diff --git a/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp new file mode 100644 -index 0000000000..bc35209fe5 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp @@ -0,0 +1,37 @@ @@ -2600,7 +2484,6 @@ index 0000000000..bc35209fe5 +gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S new file mode 100644 -index 0000000000..9dbbf3c3e1 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S @@ -0,0 +1,121 @@ @@ -2727,7 +2610,6 @@ index 0000000000..9dbbf3c3e1 + .byte 0x0 /* Terminator */ diff --git a/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp new file mode 100644 -index 0000000000..cec673cd39 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp @@ -0,0 +1,39 @@ @@ -2772,7 +2654,6 @@ index 0000000000..cec673cd39 +gdb_test "p notype_string" " = 'x' " diff --git a/gdb/testsuite/gdb.fortran/dwarf-stride.exp b/gdb/testsuite/gdb.fortran/dwarf-stride.exp new file mode 100644 -index 0000000000..d7b8bea8db --- /dev/null +++ b/gdb/testsuite/gdb.fortran/dwarf-stride.exp @@ -0,0 +1,42 @@ @@ -2820,7 +2701,6 @@ index 0000000000..d7b8bea8db +gdb_test "p c40pt(2)" " = '1-hello.*" diff --git a/gdb/testsuite/gdb.fortran/dwarf-stride.f90 b/gdb/testsuite/gdb.fortran/dwarf-stride.f90 new file mode 100644 -index 0000000000..e492b3af42 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/dwarf-stride.f90 @@ -0,0 +1,40 @@ @@ -2866,7 +2746,6 @@ index 0000000000..e492b3af42 +end program repro diff --git a/gdb/testsuite/gdb.fortran/dynamic.exp b/gdb/testsuite/gdb.fortran/dynamic.exp new file mode 100644 -index 0000000000..37d435f799 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/dynamic.exp @@ -0,0 +1,154 @@ @@ -3026,7 +2905,6 @@ index 0000000000..37d435f799 +gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10" diff --git a/gdb/testsuite/gdb.fortran/dynamic.f90 b/gdb/testsuite/gdb.fortran/dynamic.f90 new file mode 100644 -index 0000000000..0f43564378 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/dynamic.f90 @@ -0,0 +1,98 @@ @@ -3130,7 +3008,6 @@ index 0000000000..0f43564378 +end diff --git a/gdb/testsuite/gdb.fortran/string.exp b/gdb/testsuite/gdb.fortran/string.exp new file mode 100644 -index 0000000000..1b7c0dbf73 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/string.exp @@ -0,0 +1,59 @@ @@ -3195,7 +3072,6 @@ index 0000000000..1b7c0dbf73 +gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f2 ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\)" "p *f re-set" diff --git a/gdb/testsuite/gdb.fortran/string.f90 b/gdb/testsuite/gdb.fortran/string.f90 new file mode 100644 -index 0000000000..226dc5d0ff --- /dev/null +++ b/gdb/testsuite/gdb.fortran/string.f90 @@ -0,0 +1,37 @@ @@ -3238,7 +3114,6 @@ index 0000000000..226dc5d0ff +end diff --git a/gdb/testsuite/gdb.fortran/subrange.exp b/gdb/testsuite/gdb.fortran/subrange.exp new file mode 100644 -index 0000000000..c121ab9751 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/subrange.exp @@ -0,0 +1,72 @@ @@ -3316,7 +3191,6 @@ index 0000000000..c121ab9751 +gdb_test {p $a (3, 2:2)} { = \(23\)} diff --git a/gdb/testsuite/gdb.fortran/subrange.f90 b/gdb/testsuite/gdb.fortran/subrange.f90 new file mode 100644 -index 0000000000..4747ea9746 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/subrange.f90 @@ -0,0 +1,28 @@ @@ -3350,7 +3224,6 @@ index 0000000000..4747ea9746 +end diff --git a/gdb/testsuite/gdb.mi/mi2-var-stale-type.c b/gdb/testsuite/gdb.mi/mi2-var-stale-type.c new file mode 100644 -index 0000000000..ebced3c042 --- /dev/null +++ b/gdb/testsuite/gdb.mi/mi2-var-stale-type.c @@ -0,0 +1,26 @@ @@ -3382,7 +3255,6 @@ index 0000000000..ebced3c042 +} diff --git a/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp b/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp new file mode 100644 -index 0000000000..88326c0390 --- /dev/null +++ b/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp @@ -0,0 +1,57 @@ @@ -3445,7 +3317,6 @@ index 0000000000..88326c0390 +mi_gdb_test "-var-update *" "\\^done,changelist=.*" "-var-update *" diff --git a/gdb/testsuite/gdb.opt/array-from-register-func.c b/gdb/testsuite/gdb.opt/array-from-register-func.c new file mode 100644 -index 0000000000..729f457c82 --- /dev/null +++ b/gdb/testsuite/gdb.opt/array-from-register-func.c @@ -0,0 +1,22 @@ @@ -3473,7 +3344,6 @@ index 0000000000..729f457c82 +} diff --git a/gdb/testsuite/gdb.opt/array-from-register.c b/gdb/testsuite/gdb.opt/array-from-register.c new file mode 100644 -index 0000000000..3090e7e631 --- /dev/null +++ b/gdb/testsuite/gdb.opt/array-from-register.c @@ -0,0 +1,28 @@ @@ -3507,7 +3377,6 @@ index 0000000000..3090e7e631 +} diff --git a/gdb/testsuite/gdb.opt/array-from-register.exp b/gdb/testsuite/gdb.opt/array-from-register.exp new file mode 100644 -index 0000000000..f2de718bc3 --- /dev/null +++ b/gdb/testsuite/gdb.opt/array-from-register.exp @@ -0,0 +1,33 @@ @@ -3546,7 +3415,6 @@ index 0000000000..f2de718bc3 +gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42" diff --git a/gdb/testsuite/gdb.opt/fortran-string.exp b/gdb/testsuite/gdb.opt/fortran-string.exp new file mode 100644 -index 0000000000..90a2bdf212 --- /dev/null +++ b/gdb/testsuite/gdb.opt/fortran-string.exp @@ -0,0 +1,39 @@ @@ -3591,7 +3459,6 @@ index 0000000000..90a2bdf212 +gdb_test "p s" "\\$\[0-9\]* = 'foo'" diff --git a/gdb/testsuite/gdb.opt/fortran-string.f90 b/gdb/testsuite/gdb.opt/fortran-string.f90 new file mode 100644 -index 0000000000..e48d520085 --- /dev/null +++ b/gdb/testsuite/gdb.opt/fortran-string.f90 @@ -0,0 +1,28 @@ @@ -3625,7 +3492,6 @@ index 0000000000..e48d520085 + end diff --git a/gdb/testsuite/gdb.pascal/arrays.exp b/gdb/testsuite/gdb.pascal/arrays.exp new file mode 100644 -index 0000000000..22acdb86d8 --- /dev/null +++ b/gdb/testsuite/gdb.pascal/arrays.exp @@ -0,0 +1,104 @@ @@ -3735,7 +3601,6 @@ index 0000000000..22acdb86d8 + diff --git a/gdb/testsuite/gdb.pascal/arrays.pas b/gdb/testsuite/gdb.pascal/arrays.pas new file mode 100644 -index 0000000000..295602d68c --- /dev/null +++ b/gdb/testsuite/gdb.pascal/arrays.pas @@ -0,0 +1,82 @@ @@ -3822,10 +3687,9 @@ index 0000000000..295602d68c + writeln(s); { set breakpoint 2 here } +end. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index a165bf0938..a13aaf7869 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp -@@ -169,6 +169,11 @@ proc gdb_unload {} { +@@ -170,6 +170,11 @@ proc gdb_unload {} { send_gdb "y\n" exp_continue } @@ -3838,7 +3702,6 @@ index a165bf0938..a13aaf7869 100644 send_gdb "y\n" exp_continue diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp -index 03d1b1bc06..9f9e143dff 100644 --- a/gdb/testsuite/lib/pascal.exp +++ b/gdb/testsuite/lib/pascal.exp @@ -37,6 +37,9 @@ proc pascal_init {} { @@ -3872,6 +3735,3 @@ index 03d1b1bc06..9f9e143dff 100644 } set pascal_init_done 1 } --- -2.14.3 - diff --git a/gdb-archer.patch b/gdb-archer.patch index 9f21e20..c522060 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-archer.patch -FileName: gdb-archer.patch - ;; Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher ;;=push @@ -15,33 +13,11 @@ GIT snapshot: commit 718a1618b2f691a7f407213bb50f100ac59f91c3 tromey/python ---- - gdb/Makefile.in | 6 ++ - gdb/data-directory/Makefile.in | 4 + - gdb/doc/gdb.texinfo | 10 +++ - gdb/doc/python.texi | 2 - - gdb/gdb-gdb.gdb.in | 10 +++ - gdb/main.c | 93 ++++++++++++++++++----- - gdb/python/lib/gdb/command/ignore_errors.py | 37 +++++++++ - gdb/python/lib/gdb/command/pahole.py | 81 ++++++++++++++++++++ - gdb/python/lib/gdb/function/in_scope.py | 47 ++++++++++++ - gdb/python/python-internal.h | 3 + - gdb/python/python.c | 113 ++++++++++++++++++++++++++++ - gdb/python/python.h | 2 + - gdb/testsuite/gdb.python/py-frame.exp | 2 + - gdb/testsuite/gdb.python/py-value.exp | 10 +++ - gdb/varobj.c | 8 ++ - gdb/varobj.h | 2 + - 16 files changed, 411 insertions(+), 19 deletions(-) - create mode 100644 gdb/python/lib/gdb/command/ignore_errors.py - create mode 100644 gdb/python/lib/gdb/command/pahole.py - create mode 100644 gdb/python/lib/gdb/function/in_scope.py diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index 3142ad6af1..28d8664236 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -2110,6 +2110,12 @@ stamp-h: $(srcdir)/config.in config.status +@@ -2112,6 +2112,12 @@ stamp-h: $(srcdir)/config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -51,23 +27,21 @@ index 3142ad6af1..28d8664236 100644 + CONFIG_HEADERS= \ + $(SHELL) config.status + - config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh + config.status: $(srcdir)/configure configure.nat configure.tgt configure.host ../bfd/development.sh $(SHELL) config.status --recheck diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in -index 5c7c0b4c2e..2014607e9e 100644 --- a/gdb/data-directory/Makefile.in +++ b/gdb/data-directory/Makefile.in -@@ -80,6 +80,8 @@ PYTHON_FILE_LIST = \ +@@ -80,6 +80,7 @@ PYTHON_FILE_LIST = \ gdb/unwinder.py \ gdb/xmethod.py \ gdb/command/__init__.py \ + gdb/command/ignore_errors.py \ -+ gdb/command/pahole.py \ gdb/command/explore.py \ gdb/command/backtrace.py \ gdb/command/frame_filters.py \ -@@ -92,6 +94,8 @@ PYTHON_FILE_LIST = \ +@@ -92,6 +93,8 @@ PYTHON_FILE_LIST = \ gdb/function/as_string.py \ gdb/function/caller_is.py \ gdb/function/strfns.py \ @@ -77,7 +51,6 @@ index 5c7c0b4c2e..2014607e9e 100644 gdb/printer/bound_registers.py diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 7b99ae1551..dea17fd5a7 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -1245,6 +1245,16 @@ for remote debugging. @@ -98,7 +71,6 @@ index 7b99ae1551..dea17fd5a7 100644 @item -tui @cindex @code{--tui} diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi -index ccf011e35e..461e900f77 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -88,8 +88,6 @@ containing @code{end}. For example: @@ -111,7 +83,6 @@ index ccf011e35e..461e900f77 100644 >end 23 diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in -index 05a38b2670..9801fdff67 100644 --- a/gdb/gdb-gdb.gdb.in +++ b/gdb/gdb-gdb.gdb.in @@ -1,5 +1,15 @@ @@ -131,7 +102,6 @@ index 05a38b2670..9801fdff67 100644 set variable $gdb_init_done = 1 diff --git a/gdb/main.c b/gdb/main.c -index b079e79c93..b150af4e70 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -33,6 +33,7 @@ @@ -142,7 +112,7 @@ index b079e79c93..b150af4e70 100644 #include "source.h" #include "cli/cli-cmds.h" #include "objfiles.h" -@@ -478,7 +479,7 @@ exec_or_core_file_attach (const char *filename, int from_tty) +@@ -479,7 +480,7 @@ exec_or_core_file_attach (const char *filename, int from_tty) } static void @@ -151,7 +121,7 @@ index b079e79c93..b150af4e70 100644 { int argc = context->argc; char **argv = context->argv; -@@ -694,10 +695,14 @@ captured_main_1 (struct captured_main_args *context) +@@ -695,10 +696,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}, @@ -167,7 +137,7 @@ index b079e79c93..b150af4e70 100644 { int option_index; -@@ -715,6 +720,9 @@ captured_main_1 (struct captured_main_args *context) +@@ -716,6 +721,9 @@ captured_main_1 (struct captured_main_args *context) case 0: /* Long option that just sets a flag. */ break; @@ -177,7 +147,7 @@ index b079e79c93..b150af4e70 100644 case OPT_SE: symarg = optarg; execarg = optarg; -@@ -889,7 +897,31 @@ captured_main_1 (struct captured_main_args *context) +@@ -890,7 +898,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. */ @@ -210,7 +180,7 @@ index b079e79c93..b150af4e70 100644 { /* The remaining options are the command-line options for the inferior. The first one is the sym/exec file, and the rest -@@ -1179,7 +1211,8 @@ captured_main_1 (struct captured_main_args *context) +@@ -1180,7 +1212,8 @@ captured_main_1 (struct captured_main_args *context) /* Read in the old history after all the command files have been read. */ @@ -220,7 +190,7 @@ index b079e79c93..b150af4e70 100644 if (batch_flag) { -@@ -1192,24 +1225,37 @@ static void +@@ -1193,24 +1226,37 @@ static void captured_main (void *data) { struct captured_main_args *context = (struct captured_main_args *) data; @@ -271,7 +241,7 @@ index b079e79c93..b150af4e70 100644 } /* No exit -- exit is through quit_command. */ } -@@ -1252,6 +1298,12 @@ print_gdb_help (struct ui_file *stream) +@@ -1253,6 +1299,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\ @@ -284,7 +254,7 @@ index b079e79c93..b150af4e70 100644 gdb [options] --args executable-file [inferior-arguments ...]\n\n\ "), stream); fputs_unfiltered (_("\ -@@ -1297,6 +1349,13 @@ Output and user interface control:\n\n\ +@@ -1298,6 +1350,13 @@ Output and user interface control:\n\n\ #endif fputs_unfiltered (_("\ --dbx DBX compatibility mode.\n\ @@ -300,7 +270,6 @@ index b079e79c93..b150af4e70 100644 "), stream); diff --git a/gdb/python/lib/gdb/command/ignore_errors.py b/gdb/python/lib/gdb/command/ignore_errors.py new file mode 100644 -index 0000000000..6fa48ff081 --- /dev/null +++ b/gdb/python/lib/gdb/command/ignore_errors.py @@ -0,0 +1,37 @@ @@ -341,96 +310,8 @@ index 0000000000..6fa48ff081 + pass + +IgnoreErrorsCommand () -diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py -new file mode 100644 -index 0000000000..e08eaf5ca8 ---- /dev/null -+++ b/gdb/python/lib/gdb/command/pahole.py -@@ -0,0 +1,81 @@ -+# pahole command for gdb -+ -+# Copyright (C) 2008, 2009, 2012 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 . -+ -+import gdb -+ -+class Pahole (gdb.Command): -+ """Show the holes in a structure. -+This command takes a single argument, a type name. -+It prints the type and displays comments showing where holes are.""" -+ -+ def __init__ (self): -+ super (Pahole, self).__init__ ("pahole", gdb.COMMAND_NONE, -+ gdb.COMPLETE_SYMBOL) -+ -+ def maybe_print_hole(self, bitpos, field_bitpos): -+ if bitpos != field_bitpos: -+ hole = field_bitpos - bitpos -+ print (' /* XXX %d bit hole, try to pack */' % hole) -+ -+ def pahole (self, type, level, name): -+ if name is None: -+ name = '' -+ tag = type.tag -+ if tag is None: -+ tag = '' -+ print ('%sstruct %s {' % (' ' * (2 * level), tag)) -+ bitpos = 0 -+ for field in type.fields (): -+ # Skip static fields. -+ if not hasattr (field, ('bitpos')): -+ continue -+ -+ ftype = field.type.strip_typedefs() -+ -+ self.maybe_print_hole(bitpos, field.bitpos) -+ bitpos = field.bitpos -+ if field.bitsize > 0: -+ fieldsize = field.bitsize -+ else: -+ # TARGET_CHAR_BIT here... -+ fieldsize = 8 * ftype.sizeof -+ -+ # TARGET_CHAR_BIT -+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "") -+ bitpos = bitpos + fieldsize -+ -+ if ftype.code == gdb.TYPE_CODE_STRUCT: -+ self.pahole (ftype, level + 1, field.name) -+ else: -+ print (' ' * (2 + 2 * level), end = "") -+ print ('%s %s' % (str (ftype), field.name)) -+ -+ if level == 0: -+ self.maybe_print_hole(bitpos, 8 * type.sizeof) -+ -+ print (' ' * (14 + 2 * level), end = "") -+ print ('} %s' % name) -+ -+ def invoke (self, arg, from_tty): -+ type = gdb.lookup_type (arg) -+ type = type.strip_typedefs () -+ if type.code != gdb.TYPE_CODE_STRUCT: -+ raise (TypeError, '%s is not a struct type' % arg) -+ print (' ' * 14, end = "") -+ self.pahole (type, 0, '') -+ -+Pahole() diff --git a/gdb/python/lib/gdb/function/in_scope.py b/gdb/python/lib/gdb/function/in_scope.py new file mode 100644 -index 0000000000..8742680614 --- /dev/null +++ b/gdb/python/lib/gdb/function/in_scope.py @@ -0,0 +1,47 @@ @@ -482,10 +363,9 @@ index 0000000000..8742680614 + +InScope () diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h -index 89bbc6987b..69dbb69c06 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h -@@ -657,6 +657,9 @@ class gdbpy_enter_varobj : public gdbpy_enter +@@ -644,6 +644,9 @@ class gdbpy_enter_varobj : public gdbpy_enter }; @@ -496,7 +376,6 @@ index 89bbc6987b..69dbb69c06 100644 extern const struct language_defn *python_language; diff --git a/gdb/python/python.c b/gdb/python/python.c -index 610dda828c..de5ffbd70b 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -95,6 +95,8 @@ const struct extension_language_defn extension_language_python = @@ -508,7 +387,7 @@ index 610dda828c..de5ffbd70b 100644 #include "target.h" #include "gdbthread.h" #include "interps.h" -@@ -242,6 +244,29 @@ gdbpy_enter::~gdbpy_enter () +@@ -237,6 +239,29 @@ gdbpy_enter::~gdbpy_enter () restore_active_ext_lang (m_previous_active); } @@ -538,7 +417,7 @@ index 610dda828c..de5ffbd70b 100644 /* Set the quit flag. */ static void -@@ -1356,6 +1381,92 @@ gdbpy_print_stack (void) +@@ -1367,6 +1392,92 @@ gdbpy_print_stack (void) /* Return the current Progspace. There always is one. */ @@ -631,7 +510,7 @@ index 610dda828c..de5ffbd70b 100644 static PyObject * gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2) -@@ -2034,6 +2145,8 @@ PyMethodDef python_GdbMethods[] = +@@ -2057,6 +2168,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." }, @@ -641,7 +520,6 @@ index 610dda828c..de5ffbd70b 100644 "Return a gdb parameter's value" }, diff --git a/gdb/python/python.h b/gdb/python/python.h -index de58fd81df..237a84a0b2 100644 --- a/gdb/python/python.h +++ b/gdb/python/python.h @@ -25,4 +25,6 @@ @@ -652,7 +530,6 @@ index de58fd81df..237a84a0b2 100644 + #endif /* GDB_PYTHON_H */ diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp -index f186fa9578..0327284226 100644 --- a/gdb/testsuite/gdb.python/py-frame.exp +++ b/gdb/testsuite/gdb.python/py-frame.exp @@ -95,6 +95,8 @@ gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.r @@ -665,7 +542,6 @@ index f186fa9578..0327284226 100644 gdb_test "python print ('result = %s' % (gdb.selected_frame ().read_register ('sp') == gdb.parse_and_eval ('\$sp')))" \ " = True" \ diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp -index eb82a7776f..3069a5c6d7 100644 --- 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 {} { @@ -693,10 +569,9 @@ index eb82a7776f..3069a5c6d7 100644 # Test either C or C++ values. diff --git a/gdb/varobj.c b/gdb/varobj.c -index 01dabef37c..c198731d0b 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c -@@ -217,6 +217,14 @@ is_root_p (const struct varobj *var) +@@ -218,6 +218,14 @@ is_root_p (const struct varobj *var) } #ifdef HAVE_PYTHON @@ -712,10 +587,9 @@ index 01dabef37c..c198731d0b 100644 /* See python-internal.h. */ gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var) diff --git a/gdb/varobj.h b/gdb/varobj.h -index 6e80d1b89e..677547996f 100644 --- a/gdb/varobj.h +++ b/gdb/varobj.h -@@ -327,6 +327,8 @@ extern bool varobj_has_more (const struct varobj *var, int to); +@@ -328,6 +328,8 @@ extern bool varobj_has_more (const struct varobj *var, int to); extern bool varobj_is_dynamic_p (const struct varobj *var); @@ -724,6 +598,3 @@ index 6e80d1b89e..677547996f 100644 extern bool varobj_default_value_is_changeable_p (const struct varobj *var); extern bool varobj_value_is_changeable_p (const struct varobj *var); --- -2.14.3 - diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch index 44c1724..93af291 100644 --- a/gdb-attach-fail-reasons-5of5.patch +++ b/gdb-attach-fail-reasons-5of5.patch @@ -1,9 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: attach-fail-reasons: SELinux deny_ptrace - -FileName: gdb-attach-fail-reasons-5of5.patch +Subject: gdb-attach-fail-reasons-5of5.patch ;; Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878). ;;=push+jan @@ -43,24 +41,11 @@ gdb/gdbserver/ * linux-low.c (linux_traceme): New function. (linux_create_inferior, linux_tracefork_child): Call it instead of direct ptrace. ---- - gdb/config.in | 6 +++++ - gdb/configure | 58 ++++++++++++++++++++++++++++++++++++++++++++++ - gdb/configure.ac | 4 ++++ - gdb/gdbserver/config.in | 6 +++++ - gdb/gdbserver/configure | 58 ++++++++++++++++++++++++++++++++++++++++++++++ - gdb/gdbserver/configure.ac | 4 ++++ - gdb/gdbserver/linux-low.c | 16 ++++++++++++- - gdb/linux-nat.c | 24 ++++++++++++++++++- - gdb/nat/linux-ptrace.c | 22 ++++++++++++++++++ - gdb/nat/linux-ptrace.h | 1 + - 10 files changed, 197 insertions(+), 2 deletions(-) diff --git a/gdb/config.in b/gdb/config.in -index edd7028f76..4de3e842d1 100644 --- a/gdb/config.in +++ b/gdb/config.in -@@ -270,6 +270,9 @@ +@@ -276,6 +276,9 @@ /* Define if librpm library is being used. */ #undef HAVE_LIBRPM @@ -70,7 +55,7 @@ index edd7028f76..4de3e842d1 100644 /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -@@ -393,6 +396,9 @@ +@@ -399,6 +402,9 @@ /* Define to 1 if you have the `scm_new_smob' function. */ #undef HAVE_SCM_NEW_SMOB @@ -81,10 +66,9 @@ index edd7028f76..4de3e842d1 100644 #undef HAVE_SETLOCALE diff --git a/gdb/configure b/gdb/configure -index 1cecdbc3b5..904cc453ad 100755 --- a/gdb/configure +++ b/gdb/configure -@@ -15681,6 +15681,64 @@ cat >>confdefs.h <<_ACEOF +@@ -15854,6 +15854,64 @@ cat >>confdefs.h <<_ACEOF _ACEOF @@ -150,10 +134,9 @@ index 1cecdbc3b5..904cc453ad 100755 # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, # except that the argument to --with-sysroot is optional. diff --git a/gdb/configure.ac b/gdb/configure.ac -index e232c1adcb..1557760ed8 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -2043,6 +2043,10 @@ case $host_os in +@@ -2054,6 +2054,10 @@ case $host_os in esac AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.]) @@ -165,7 +148,6 @@ index e232c1adcb..1557760ed8 100644 # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in -index dda7c1f150..b2a34b92ce 100644 --- a/gdb/gdbserver/config.in +++ b/gdb/gdbserver/config.in @@ -126,6 +126,9 @@ @@ -189,10 +171,9 @@ index dda7c1f150..b2a34b92ce 100644 #undef HAVE_SETNS diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure -index 340ca7a19e..6d7c9b2326 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure -@@ -8455,6 +8455,64 @@ if $want_ipa ; then +@@ -8535,6 +8535,64 @@ if $want_ipa ; then fi fi @@ -258,10 +239,9 @@ index 340ca7a19e..6d7c9b2326 100755 diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac -index 6727959e61..7c0f508275 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac -@@ -488,6 +488,10 @@ if $want_ipa ; then +@@ -486,6 +486,10 @@ if $want_ipa ; then fi fi @@ -273,25 +253,19 @@ index 6727959e61..7c0f508275 100644 AC_SUBST(GDBSERVER_LIBS) AC_SUBST(srv_xmlbuiltin) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c -index cfb2b56a08..0faac80625 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c -@@ -963,7 +963,21 @@ linux_ptrace_fun () +@@ -967,7 +967,16 @@ linux_ptrace_fun () { if (ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) 0, (PTRACE_TYPE_ARG4) 0) < 0) - trace_start_error_with_name ("ptrace"); + { + int save_errno = errno; -+ struct buffer buffer; + -+ buffer_init (&buffer); -+ linux_ptrace_create_warnings (&buffer); -+ buffer_grow_str0 (&buffer, ""); ++ std::string msg (linux_ptrace_create_warnings ()); + -+ std::string msg -+ = string_printf (_("%sCannot trace created process"), -+ buffer_finish (&buffer)); ++ msg += _("Cannot trace created process"); + + errno = save_errno; + trace_start_error_with_name (msg.c_str ()); @@ -300,45 +274,31 @@ index cfb2b56a08..0faac80625 100644 if (setpgid (0, 0) < 0) trace_start_error_with_name ("setpgid"); diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c -index c41ea391a0..1570a2bcb6 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c -@@ -1127,7 +1127,29 @@ linux_nat_create_inferior (struct target_ops *ops, +@@ -1089,7 +1089,17 @@ linux_nat_target::create_inferior (const char *exec_file, /* Make sure we report all signals during startup. */ - linux_nat_pass_signals (ops, 0, NULL); + pass_signals (0, NULL); -- linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty); -+ volatile struct gdb_exception ex; +- inf_ptrace_target::create_inferior (exec_file, allargs, env, from_tty); + TRY + { -+ linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty); ++ inf_ptrace_target::create_inferior (exec_file, allargs, env, from_tty); + } + CATCH (ex, RETURN_MASK_ERROR) + { -+ struct buffer buffer; -+ char *message, *buffer_s; ++ std::string result = linux_ptrace_create_warnings (); + -+ message = xstrdup (ex.message); -+ make_cleanup (xfree, message); -+ -+ buffer_init (&buffer); -+ linux_ptrace_create_warnings (&buffer); -+ -+ buffer_grow_str0 (&buffer, ""); -+ buffer_s = buffer_finish (&buffer); -+ make_cleanup (xfree, buffer_s); -+ -+ throw_error (ex.error, "%s%s", buffer_s, message); ++ throw_error (ex.error, "%s%s", result.c_str (), ex.message); + } + END_CATCH } /* Callback for linux_proc_attach_tgid_threads. Attach to PTID if not diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c -index ac6ba72390..be51e2449b 100644 --- a/gdb/nat/linux-ptrace.c +++ b/gdb/nat/linux-ptrace.c -@@ -27,6 +27,10 @@ +@@ -25,6 +25,10 @@ #include #endif @@ -349,50 +309,49 @@ index ac6ba72390..be51e2449b 100644 /* Stores the ptrace options supported by the running kernel. A value of -1 means we did not check for features yet. A value of 0 means there are no supported features. */ -@@ -51,6 +55,8 @@ linux_ptrace_attach_fail_reason (pid_t pid, struct buffer *buffer) - buffer_xml_printf (buffer, _("process %d is a zombie " - "- the process has already terminated"), - (int) pid); +@@ -50,6 +54,8 @@ linux_ptrace_attach_fail_reason (pid_t pid) + "terminated"), + (int) pid); + ++ result += linux_ptrace_create_warnings (); + -+ linux_ptrace_create_warnings (buffer); + return result; } - /* See linux-ptrace.h. */ -@@ -594,6 +600,22 @@ linux_ptrace_init_warnings (void) +@@ -583,6 +589,25 @@ linux_ptrace_init_warnings (void) linux_ptrace_test_ret_to_nx (); } +/* Print all possible reasons we could fail to create a traced process. */ + -+void -+linux_ptrace_create_warnings (struct buffer *buffer) ++std::string ++linux_ptrace_create_warnings () +{ ++ std::string result; ++ +#ifdef HAVE_LIBSELINUX + /* -1 is returned for errors, 0 if it has no effect, 1 if PTRACE_ATTACH is + forbidden. */ + if (security_get_boolean_active ("deny_ptrace") == 1) -+ buffer_xml_printf (buffer, -+ _("the SELinux boolean 'deny_ptrace' is enabled, " -+ "you can disable this process attach protection by: " -+ "(gdb) shell sudo setsebool deny_ptrace=0")); ++ string_appendf (result, ++ _("the SELinux boolean 'deny_ptrace' is enabled, " ++ "you can disable this process attach protection by: " ++ "(gdb) shell sudo setsebool deny_ptrace=0\n")); +#endif /* HAVE_LIBSELINUX */ ++ return result; +} + /* Extract extended ptrace event from wait status. */ int diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h -index 1f960ed132..84912f909c 100644 --- a/gdb/nat/linux-ptrace.h +++ b/gdb/nat/linux-ptrace.h -@@ -190,6 +190,7 @@ extern void linux_ptrace_attach_fail_reason (pid_t pid, struct buffer *buffer); - extern char *linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err); +@@ -184,6 +184,7 @@ extern std::string linux_ptrace_attach_fail_reason (pid_t pid); + extern std::string linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err); extern void linux_ptrace_init_warnings (void); -+extern void linux_ptrace_create_warnings (struct buffer *buffer); ++extern std::string linux_ptrace_create_warnings (); extern void linux_check_ptrace_features (void); extern void linux_enable_event_reporting (pid_t pid, int attached); extern void linux_disable_event_reporting (pid_t pid); --- -2.14.3 - diff --git a/gdb-btrobust.patch b/gdb-btrobust.patch index 1e703fa..21f6a68 100644 --- a/gdb-btrobust.patch +++ b/gdb-btrobust.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-btrobust.patch -FileName: gdb-btrobust.patch - ;; Continue backtrace even if a frame filter throws an exception (Phil Muldoon). ;;=push @@ -12,15 +10,11 @@ This should fix the error with glib. An error message will still be printed, but a default backtrace will occur in this case. -- ---- - gdb/python/py-framefilter.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c -index e887849c36..a8e4f49eb5 100644 --- a/gdb/python/py-framefilter.c +++ b/gdb/python/py-framefilter.c -@@ -1388,6 +1388,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, +@@ -1151,6 +1151,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, htab_eq_pointer, NULL)); @@ -28,23 +22,24 @@ index e887849c36..a8e4f49eb5 100644 while (true) { gdbpy_ref<> item (PyIter_Next (iterable.get ())); -@@ -1397,7 +1398,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, +@@ -1159,8 +1160,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, + { if (PyErr_Occurred ()) { - gdbpy_print_stack (); +- throw_quit_or_print_exception (); - return EXT_LANG_BT_ERROR; ++ gdbpy_print_stack (); + return count_printed > 0 ? EXT_LANG_BT_ERROR : EXT_LANG_BT_NO_FILTERS; } break; } -@@ -1409,6 +1410,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, +@@ -1193,7 +1194,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) - gdbpy_print_stack (); +- throw_quit_or_print_exception (); ++ gdbpy_print_stack (); + count_printed++; } return success; --- -2.14.3 - diff --git a/gdb-bz1219747-attach-kills.patch b/gdb-bz1219747-attach-kills.patch index 07db39b..fffff41 100644 --- a/gdb-bz1219747-attach-kills.patch +++ b/gdb-bz1219747-attach-kills.patch @@ -1,9 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: Never kill PID on: gdb exec PID - -FileName: gdb-bz1219747-attach-kills.patch +Subject: gdb-bz1219747-attach-kills.patch ;; Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747). ;;=push+jan @@ -78,19 +76,11 @@ gdb/testsuite/ChangeLog * gdb.base/attach-kills.c: New. * gdb.base/attach-kills.exp: New. ---- - gdb/main.c | 5 +++- - gdb/testsuite/gdb.base/attach-kills.c | 25 +++++++++++++++++ - gdb/testsuite/gdb.base/attach-kills.exp | 49 +++++++++++++++++++++++++++++++++ - 3 files changed, 78 insertions(+), 1 deletion(-) - create mode 100644 gdb/testsuite/gdb.base/attach-kills.c - create mode 100644 gdb/testsuite/gdb.base/attach-kills.exp diff --git a/gdb/main.c b/gdb/main.c -index 17d35f4a8a..b079e79c93 100644 --- a/gdb/main.c +++ b/gdb/main.c -@@ -1114,7 +1114,10 @@ captured_main_1 (struct captured_main_args *context) +@@ -1115,7 +1115,10 @@ captured_main_1 (struct captured_main_args *context) if (isdigit (pid_or_core_arg[0])) { if (catch_command_errors (attach_command, pid_or_core_arg, @@ -104,7 +94,6 @@ index 17d35f4a8a..b079e79c93 100644 } diff --git a/gdb/testsuite/gdb.base/attach-kills.c b/gdb/testsuite/gdb.base/attach-kills.c new file mode 100644 -index 0000000000..2398f00442 --- /dev/null +++ b/gdb/testsuite/gdb.base/attach-kills.c @@ -0,0 +1,25 @@ @@ -135,7 +124,6 @@ index 0000000000..2398f00442 +} diff --git a/gdb/testsuite/gdb.base/attach-kills.exp b/gdb/testsuite/gdb.base/attach-kills.exp new file mode 100644 -index 0000000000..9a93cb7584 --- /dev/null +++ b/gdb/testsuite/gdb.base/attach-kills.exp @@ -0,0 +1,49 @@ @@ -188,6 +176,3 @@ index 0000000000..9a93cb7584 +} + +kill_wait_spawned_process $test_spawn_id --- -2.14.3 - diff --git a/gdb-bz533176-fortran-omp-step.patch b/gdb-bz533176-fortran-omp-step.patch index c749ffa..d522218 100644 --- a/gdb-bz533176-fortran-omp-step.patch +++ b/gdb-bz533176-fortran-omp-step.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-bz533176-fortran-omp-step.patch -FileName: gdb-bz533176-fortran-omp-step.patch - ;; Fix stepping with OMP parallel Fortran sections (BZ 533176). ;;=push+jan: It requires some better DWARF annotations. @@ -28,19 +26,11 @@ upstream) or "step" (default in F/RHEL) the simultaneous execution of the threads is inconvenient. Setting it to "on" will lockup the debugging as the threads need to get synchronized at some point. This is a more general debugging problem of GOMP outside of the scope of this Bug. ---- - gdb/infrun.c | 11 +++++++++++ - gdb/testsuite/gdb.fortran/omp-step.exp | 31 +++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.fortran/omp-step.f90 | 32 ++++++++++++++++++++++++++++++++ - 3 files changed, 74 insertions(+) - create mode 100644 gdb/testsuite/gdb.fortran/omp-step.exp - create mode 100644 gdb/testsuite/gdb.fortran/omp-step.f90 diff --git a/gdb/infrun.c b/gdb/infrun.c -index 1d0f731954..dcf022bd50 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c -@@ -6690,6 +6690,16 @@ process_event_stop_test (struct execution_control_state *ecs) +@@ -6695,6 +6695,16 @@ process_event_stop_test (struct execution_control_state *ecs) if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL) { @@ -57,7 +47,7 @@ index 1d0f731954..dcf022bd50 100644 /* We're doing a "next". Normal (forward) execution: set a breakpoint at the -@@ -6723,6 +6733,7 @@ process_event_stop_test (struct execution_control_state *ecs) +@@ -6728,6 +6738,7 @@ process_event_stop_test (struct execution_control_state *ecs) keep_going (ecs); return; @@ -67,7 +57,6 @@ index 1d0f731954..dcf022bd50 100644 /* If we are in a function call trampoline (a stub between the diff --git a/gdb/testsuite/gdb.fortran/omp-step.exp b/gdb/testsuite/gdb.fortran/omp-step.exp new file mode 100644 -index 0000000000..66440a7507 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/omp-step.exp @@ -0,0 +1,31 @@ @@ -104,7 +93,6 @@ index 0000000000..66440a7507 +gdb_continue_to_breakpoint "success" ".*success.*" diff --git a/gdb/testsuite/gdb.fortran/omp-step.f90 b/gdb/testsuite/gdb.fortran/omp-step.f90 new file mode 100644 -index 0000000000..a0cfb37014 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/omp-step.f90 @@ -0,0 +1,32 @@ @@ -140,6 +128,3 @@ index 0000000000..a0cfb37014 + end do + print *, "success" + end --- -2.14.3 - diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch index 2509007..aa183b8 100644 --- a/gdb-bz541866-rwatch-before-run.patch +++ b/gdb-bz541866-rwatch-before-run.patch @@ -3,28 +3,14 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-bz541866-rwatch-before-run.patch -FileName: gdb-bz541866-rwatch-before-run.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. ---- - gdb/breakpoint.c | 4 +-- - gdb/config/i386/nm-linux.h | 28 +++++++++++++++ - gdb/config/i386/nm-linux64.h | 28 +++++++++++++++ - gdb/configure.nat | 2 ++ - gdb/target.h | 2 ++ - .../gdb.base/watchpoint-hw-before-run.exp | 40 ++++++++++++++++++++++ - 6 files changed, 102 insertions(+), 2 deletions(-) - create mode 100644 gdb/config/i386/nm-linux.h - create mode 100644 gdb/config/i386/nm-linux64.h - create mode 100644 gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index 814802a0a1..5a99de75e1 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -8864,7 +8864,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, +@@ -8807,7 +8807,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, int enabled, int internal, unsigned flags, int display_canonical) { @@ -33,7 +19,7 @@ index 814802a0a1..5a99de75e1 100644 if (type == bp_hardware_breakpoint) { -@@ -14425,7 +14425,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition, +@@ -14356,7 +14356,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition, if (bpt->type == bp_hardware_breakpoint) { @@ -44,7 +30,6 @@ index 814802a0a1..5a99de75e1 100644 target_can_use_hardware_watchpoint (bp_hardware_breakpoint, diff --git a/gdb/config/i386/nm-linux.h b/gdb/config/i386/nm-linux.h new file mode 100644 -index 0000000000..38e94baab1 --- /dev/null +++ b/gdb/config/i386/nm-linux.h @@ -0,0 +1,28 @@ @@ -78,7 +63,6 @@ index 0000000000..38e94baab1 +#endif /* NM_LINUX64_H */ diff --git a/gdb/config/i386/nm-linux64.h b/gdb/config/i386/nm-linux64.h new file mode 100644 -index 0000000000..212daba477 --- /dev/null +++ b/gdb/config/i386/nm-linux64.h @@ -0,0 +1,28 @@ @@ -111,10 +95,9 @@ index 0000000000..212daba477 + +#endif /* NM_LINUX64_H */ diff --git a/gdb/configure.nat b/gdb/configure.nat -index 8e14892722..6dbb072054 100644 --- a/gdb/configure.nat +++ b/gdb/configure.nat -@@ -237,6 +237,7 @@ case ${gdb_host} in +@@ -238,6 +238,7 @@ case ${gdb_host} in ;; i386) # Host: Intel 386 running GNU/Linux. @@ -122,7 +105,7 @@ index 8e14892722..6dbb072054 100644 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" -@@ -289,6 +290,7 @@ case ${gdb_host} in +@@ -290,6 +291,7 @@ case ${gdb_host} in case ${gdb_host_cpu} in i386) # Host: GNU/Linux x86-64 @@ -131,16 +114,15 @@ index 8e14892722..6dbb072054 100644 amd64-nat.o amd64-linux-nat.o x86-linux-nat.o linux-btrace.o \ x86-linux.o x86-linux-dregs.o amd64-linux-siginfo.o" diff --git a/gdb/target.h b/gdb/target.h -index 4781fbc59c..e3a2882fe5 100644 --- a/gdb/target.h +++ b/gdb/target.h -@@ -1915,9 +1915,11 @@ extern struct thread_info *target_thread_handle_to_thread_info +@@ -1953,9 +1953,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. */ +#ifndef target_can_use_hardware_watchpoint #define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \ - (*current_target.to_can_use_hw_breakpoint) (¤t_target, \ + (current_top_target ()->can_use_hw_breakpoint) ( \ TYPE, CNT, OTHERTYPE) +#endif @@ -148,7 +130,6 @@ index 4781fbc59c..e3a2882fe5 100644 memory region, or zero if not supported. */ diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp b/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp new file mode 100644 -index 0000000000..4ce9997e4a --- /dev/null +++ b/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp @@ -0,0 +1,40 @@ @@ -192,6 +173,3 @@ index 0000000000..4ce9997e4a +gdb_test "" "main .* at .*" "start" + +gdb_test "continue" "Continuing.\r\n\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*" --- -2.14.3 - diff --git a/gdb-bz568248-oom-is-error.patch b/gdb-bz568248-oom-is-error.patch index 943af77..21bf7a4 100644 --- a/gdb-bz568248-oom-is-error.patch +++ b/gdb-bz568248-oom-is-error.patch @@ -1,9 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: nomem: internal_error -> error - -FileName: gdb-bz568248-oom-is-error.patch +Subject: gdb-bz568248-oom-is-error.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. @@ -51,15 +49,11 @@ gdb/ Tom Tromey * utils.c (nomem): Change internal_error to error. ---- - gdb/utils.c | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gdb/utils.c b/gdb/utils.c -index c531748fe4..0066bfcc4b 100644 --- a/gdb/utils.c +++ b/gdb/utils.c -@@ -774,13 +774,11 @@ malloc_failure (long size) +@@ -746,13 +746,11 @@ malloc_failure (long size) { if (size > 0) { @@ -75,6 +69,3 @@ index c531748fe4..0066bfcc4b 100644 } } --- -2.14.3 - diff --git a/gdb-bz601887-dwarf4-rh-test.patch b/gdb-bz601887-dwarf4-rh-test.patch index 60903e7..5f46cbc 100644 --- a/gdb-bz601887-dwarf4-rh-test.patch +++ b/gdb-bz601887-dwarf4-rh-test.patch @@ -3,22 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-bz601887-dwarf4-rh-test.patch -FileName: gdb-bz601887-dwarf4-rh-test.patch - ;; Backport DWARF-4 support (BZ 601887, Tom Tromey). ;;=fedoratest ---- - gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S | 167 ++++++++++++++++++++++++++ - gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c | 22 ++++ - gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp | 42 +++++++ - 3 files changed, 231 insertions(+) - create mode 100644 gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S - create mode 100644 gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c - create mode 100644 gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S new file mode 100644 -index 0000000000..48b1bbf3e1 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S @@ -0,0 +1,167 @@ @@ -191,7 +180,6 @@ index 0000000000..48b1bbf3e1 + .section .note.GNU-stack,"",@progbits diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c new file mode 100644 -index 0000000000..46fcd120f4 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c @@ -0,0 +1,22 @@ @@ -219,7 +207,6 @@ index 0000000000..46fcd120f4 +} diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp new file mode 100644 -index 0000000000..a728f9c5ed --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp @@ -0,0 +1,42 @@ @@ -265,6 +252,3 @@ index 0000000000..a728f9c5ed +clean_restart $executable + +gdb_test "ptype main" {type = int \(void\)} --- -2.14.3 - diff --git a/gdb-bz634108-solib_address.patch b/gdb-bz634108-solib_address.patch index 95a5cce..4a25f21 100644 --- a/gdb-bz634108-solib_address.patch +++ b/gdb-bz634108-solib_address.patch @@ -3,22 +3,15 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-bz634108-solib_address.patch -FileName: gdb-bz634108-solib_address.patch - ;; Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). ;;=fedoratest Fix gdb.solib_address (fix by Phil Muldoon). s/solib_address/solib_name/ during upstreaming. ---- - .../gdb.python/rh634108-solib_address.exp | 24 ++++++++++++++++++++++ - 1 file changed, 24 insertions(+) - create mode 100644 gdb/testsuite/gdb.python/rh634108-solib_address.exp diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp new file mode 100644 -index 0000000000..c0451cf09e --- /dev/null +++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp @@ -0,0 +1,24 @@ @@ -46,6 +39,3 @@ index 0000000000..c0451cf09e +if { [skip_python_tests] } { continue } + +gdb_test "python print gdb.solib_name(-1)" "None" "gdb.solib_name exists" --- -2.14.3 - diff --git a/gdb-ccache-workaround.patch b/gdb-ccache-workaround.patch index 9cb76f7..e9df62f 100644 --- a/gdb-ccache-workaround.patch +++ b/gdb-ccache-workaround.patch @@ -3,16 +3,10 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-ccache-workaround.patch -FileName: gdb-ccache-workaround.patch - ;; Workaround ccache making lineno non-zero for command-line definitions. ;;=fedoratest: ccache is rarely used and it is even fixed now. ---- - gdb/testsuite/gdb.base/macscp.exp | 8 ++++++++ - 1 file changed, 8 insertions(+) diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp -index 27dc991ce9..a3b9458b44 100644 --- a/gdb/testsuite/gdb.base/macscp.exp +++ b/gdb/testsuite/gdb.base/macscp.exp @@ -25,6 +25,14 @@ if { [test_compiler_info "gcc-*"] || [test_compiler_info "clang-*"] } { @@ -30,6 +24,3 @@ index 27dc991ce9..a3b9458b44 100644 # Generate the intermediate object file. This is required by Darwin to # have access to the .debug_macinfo section. if {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${objfile}" \ --- -2.14.3 - diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch index 7855440..12f3965 100644 --- a/gdb-container-rh-pkg.patch +++ b/gdb-container-rh-pkg.patch @@ -3,19 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-container-rh-pkg.patch -FileName: gdb-container-rh-pkg.patch - ;; Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114). ;;=fedora ---- - gdb/remote.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gdb/remote.c b/gdb/remote.c -index 86777f1e5e..fc003c0736 100644 --- a/gdb/remote.c +++ b/gdb/remote.c -@@ -13437,7 +13437,17 @@ remote_pid_to_exec_file (struct target_ops *self, 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) @@ -34,6 +28,3 @@ index 86777f1e5e..fc003c0736 100644 inf = find_inferior_pid (pid); if (inf == NULL) --- -2.14.3 - diff --git a/gdb-core-open-vdso-warning.patch b/gdb-core-open-vdso-warning.patch index 8c77a08..18a20e4 100644 --- a/gdb-core-open-vdso-warning.patch +++ b/gdb-core-open-vdso-warning.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-core-open-vdso-warning.patch -FileName: gdb-core-open-vdso-warning.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@.*> @@ -17,12 +15,8 @@ Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Inp commit 7d760051ffb8a23cdc51342d4e6243fbc462f73f Author: Ulrich Weigand Date: Wed Sep 25 11:52:50 2013 +0000 ---- - gdb/testsuite/gdb.base/solib-symbol.exp | 23 +++++++++++++++++++++-- - 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/solib-symbol.exp -index 20c1d47a03..893efe0b2d 100644 --- a/gdb/testsuite/gdb.base/solib-symbol.exp +++ b/gdb/testsuite/gdb.base/solib-symbol.exp @@ -29,6 +29,7 @@ set testfile "solib-symbol-main" @@ -62,6 +56,3 @@ index 20c1d47a03..893efe0b2d 100644 +gdb_run_cmd +gdb_test "" "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\nBreakpoint \[0-9\]+, main .*" \ + "warning for missing libraries" --- -2.14.3 - diff --git a/gdb-dts-rhel6-python-compat.patch b/gdb-dts-rhel6-python-compat.patch index 336d761..9c7051a 100644 --- a/gdb-dts-rhel6-python-compat.patch +++ b/gdb-dts-rhel6-python-compat.patch @@ -3,24 +3,12 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-dts-rhel6-python-compat.patch -FileName: gdb-dts-rhel6-python-compat.patch - ;; [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon). ;;=fedora https://bugzilla.redhat.com/show_bug.cgi?id=1020004 ---- - gdb/data-directory/Makefile.in | 3 + - gdb/python/lib/gdb/FrameWrapper.py | 122 ++++++++++++++++++++++++++++++++ - gdb/python/lib/gdb/backtrace.py | 42 +++++++++++ - gdb/python/lib/gdb/command/backtrace.py | 106 +++++++++++++++++++++++++++ - 4 files changed, 273 insertions(+) - create mode 100644 gdb/python/lib/gdb/FrameWrapper.py - create mode 100644 gdb/python/lib/gdb/backtrace.py - create mode 100644 gdb/python/lib/gdb/command/backtrace.py diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in -index 753e0b69a3..5c7c0b4c2e 100644 --- a/gdb/data-directory/Makefile.in +++ b/gdb/data-directory/Makefile.in @@ -71,6 +71,8 @@ PYTHON_FILE_LIST = \ @@ -42,7 +30,6 @@ index 753e0b69a3..5c7c0b4c2e 100644 gdb/command/prompt.py \ diff --git a/gdb/python/lib/gdb/FrameWrapper.py b/gdb/python/lib/gdb/FrameWrapper.py new file mode 100644 -index 0000000000..34ba4a2a12 --- /dev/null +++ b/gdb/python/lib/gdb/FrameWrapper.py @@ -0,0 +1,122 @@ @@ -170,7 +157,6 @@ index 0000000000..34ba4a2a12 + return getattr (self.frame, name) diff --git a/gdb/python/lib/gdb/backtrace.py b/gdb/python/lib/gdb/backtrace.py new file mode 100644 -index 0000000000..06c893f239 --- /dev/null +++ b/gdb/python/lib/gdb/backtrace.py @@ -0,0 +1,42 @@ @@ -218,7 +204,6 @@ index 0000000000..06c893f239 + diff --git a/gdb/python/lib/gdb/command/backtrace.py b/gdb/python/lib/gdb/command/backtrace.py new file mode 100644 -index 0000000000..eeea9093e8 --- /dev/null +++ b/gdb/python/lib/gdb/command/backtrace.py @@ -0,0 +1,106 @@ @@ -328,6 +313,3 @@ index 0000000000..eeea9093e8 + pair[1].describe (sys.stdout, full) + +FilteringBacktrace() --- -2.14.3 - diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch index afcb6f6..14ee21d 100644 --- a/gdb-fedora-libncursesw.patch +++ b/gdb-fedora-libncursesw.patch @@ -3,31 +3,24 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-fedora-libncursesw.patch -FileName: gdb-fedora-libncursesw.patch - ;; Force libncursesw over libncurses to match the includes (RH BZ 1270534). ;;=push+jan Fedora: Force libncursesw over libncurses to match the includes. https://bugzilla.redhat.com/show_bug.cgi?id=1270534 ---- - gdb/configure | 6 ++++-- - gdb/configure.ac | 6 ++++-- - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gdb/configure b/gdb/configure -index 6fb5b5b509..db849572b5 100755 --- a/gdb/configure +++ b/gdb/configure -@@ -9238,6 +9238,7 @@ if test x"$prefer_curses" = xyes; then +@@ -9393,6 +9393,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. + # Fedora: Force libncursesw over libncurses to match the includes. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 $as_echo_n "checking for library containing waddstr... " >&6; } - if test "${ac_cv_search_waddstr+set}" = set; then : -@@ -9262,7 +9263,7 @@ return waddstr (); + if ${ac_cv_search_waddstr+:} false; then : +@@ -9417,7 +9418,7 @@ return waddstr (); return 0; } _ACEOF @@ -36,15 +29,15 @@ index 6fb5b5b509..db849572b5 100755 if test -z "$ac_lib"; then ac_res="none required" else -@@ -9336,6 +9337,7 @@ case $host_os in +@@ -9491,6 +9492,7 @@ case $host_os in esac # These are the libraries checked by Readline. +# Fedora: Force libncursesw over libncurses to match the includes. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 $as_echo_n "checking for library containing tgetent... " >&6; } - if test "${ac_cv_search_tgetent+set}" = set; then : -@@ -9360,7 +9362,7 @@ return tgetent (); + if ${ac_cv_search_tgetent+:} false; then : +@@ -9515,7 +9517,7 @@ return tgetent (); return 0; } _ACEOF @@ -54,10 +47,9 @@ index 6fb5b5b509..db849572b5 100755 ac_res="none required" else diff --git a/gdb/configure.ac b/gdb/configure.ac -index d891c7bccc..4412e25450 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -755,7 +755,8 @@ if test x"$prefer_curses" = xyes; then +@@ -766,7 +766,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. @@ -67,7 +59,7 @@ index d891c7bccc..4412e25450 100644 if test "$ac_cv_search_waddstr" != no; then curses_found=yes -@@ -797,7 +798,8 @@ case $host_os in +@@ -808,7 +809,8 @@ case $host_os in esac # These are the libraries checked by Readline. @@ -77,6 +69,3 @@ index d891c7bccc..4412e25450 100644 if test "$ac_cv_search_tgetent" = no; then CONFIG_OBS="$CONFIG_OBS stub-termcap.o" --- -2.14.3 - diff --git a/gdb-follow-child-stale-parent.patch b/gdb-follow-child-stale-parent.patch index 48ae949..b1e62e5 100644 --- a/gdb-follow-child-stale-parent.patch +++ b/gdb-follow-child-stale-parent.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-follow-child-stale-parent.patch -FileName: gdb-follow-child-stale-parent.patch - ;; Fix regression by python on ia64 due to stale current frame. ;;=push+jan @@ -22,15 +20,11 @@ unwinders try to access it, breaking: +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish ---- - gdb/infrun.c | 3 +++ - 1 file changed, 3 insertions(+) diff --git a/gdb/infrun.c b/gdb/infrun.c -index dcf022bd50..b468d02fd6 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c -@@ -749,6 +749,9 @@ follow_fork (void) +@@ -752,6 +752,9 @@ follow_fork (void) } else { @@ -40,6 +34,3 @@ index dcf022bd50..b468d02fd6 100644 /* This pending follow fork event is now handled, one way or another. The previous selected thread may be gone from the lists by now, but if it is still around, need --- -2.14.3 - diff --git a/gdb-fortran-frame-string.patch b/gdb-fortran-frame-string.patch index 5fd5c98..6b80383 100644 --- a/gdb-fortran-frame-string.patch +++ b/gdb-fortran-frame-string.patch @@ -1,9 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: Display Fortran strings in backtraces - -FileName: gdb-fortran-frame-string.patch +Subject: gdb-fortran-frame-string.patch ;; Display Fortran strings in backtraces. ;;=fedoratest @@ -29,16 +27,9 @@ No regressions on {x86_64,x86_64-m32,i686}-fedora22pre-linux-gnu. Thanks, Jan ---- - gdb/testsuite/gdb.fortran/fortran-frame-string.exp | 36 ++++++++++++++++++++++ - gdb/testsuite/gdb.fortran/fortran-frame-string.f90 | 28 +++++++++++++++++ - 2 files changed, 64 insertions(+) - create mode 100644 gdb/testsuite/gdb.fortran/fortran-frame-string.exp - create mode 100644 gdb/testsuite/gdb.fortran/fortran-frame-string.f90 diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.exp b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp new file mode 100644 -index 0000000000..7114afd440 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp @@ -0,0 +1,36 @@ @@ -80,7 +71,6 @@ index 0000000000..7114afd440 +gdb_test "frame" { \(s='foo', .*} diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 new file mode 100644 -index 0000000000..3d1576fb1f --- /dev/null +++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 @@ -0,0 +1,28 @@ @@ -112,6 +102,3 @@ index 0000000000..3d1576fb1f + program main + call f ('foo') + end --- -2.14.3 - diff --git a/gdb-gdb-add-index-script.patch b/gdb-gdb-add-index-script.patch deleted file mode 100644 index 7cd26af..0000000 --- a/gdb-gdb-add-index-script.patch +++ /dev/null @@ -1,179 +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: RFC: add DWARF index support - -FileName: gdb-gdb-add-index-script.patch - -;; Provide /usr/bin/gdb-add-index for rpm-build (Tom Tromey). -;;=push: Re-check against the upstream version. - -http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html - -Jan Kratochvil: Fixed $d -> $dir. -Jan Kratochvil: Remove /dev/null redirection. - ->>>>> "Tom" == Tom Tromey writes: - -Tom> This patch series adds support for a DWARF index to gdb. - -Roland suggested we wrap up the index-creation code into a helper -script. - -I'm not sure if this is something people would want in gdb proper, but I -figured I would send it here just in case. - -Tom - -2010-07-09 Tom Tromey - - * Makefile.in (install-only): Install gdb-add-index. - * gdb-add-index: New file. - -2010-07-09 Tom Tromey - - * gdb.texinfo (Index Files): Mention gdb-add-index. - ->From 30714fe719e61baea03d0dc5793eb0d564faebb7 Mon Sep 17 00:00:00 2001 -From: Tom Tromey -Date: Fri, 9 Jul 2010 11:17:54 -0600 -Subject: [PATCH 4/4] add gdb-add-index -Subject: [PATCH 4/4] add gdb-add-index ---- - gdb/Makefile.in | 9 +++++++++ - gdb/doc/Makefile.in | 9 ++++++++- - gdb/doc/gdb.texinfo | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 74 insertions(+), 1 deletion(-) - -diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index e77d6a5c03..3142ad6af1 100644 ---- a/gdb/Makefile.in -+++ b/gdb/Makefile.in -@@ -1770,6 +1770,15 @@ install-only: install-gstack $(CONFIG_INSTALL) - $(INSTALL_SCRIPT) gcore \ - $(DESTDIR)$(bindir)/$$transformed_name; \ - fi -+ transformed_name=`t='$(program_transform_name)'; \ -+ echo gdb-add-index | sed -e "$$t"` ; \ -+ if test "x$$transformed_name" = x; then \ -+ transformed_name=gdb-add-index ; \ -+ else \ -+ true ; \ -+ fi ; \ -+ $(INSTALL_PROGRAM) $(srcdir)/contrib/gdb-add-index.sh \ -+ $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) - @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do - - install-strip: -diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in -index eafadee899..0323bc4ecb 100644 ---- a/gdb/doc/Makefile.in -+++ b/gdb/doc/Makefile.in -@@ -174,7 +174,7 @@ POD2MAN5 = pod2man --center="GNU Development Tools" \ - --release="gdb-`sed q version.subst`" --section=5 - - # List of man pages generated from gdb.texi --MAN1S = gdb.1 gdbserver.1 gcore.1 -+MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1 - MAN5S = gdbinit.5 - MANS = $(MAN1S) $(MAN5S) - -@@ -633,6 +633,13 @@ gcore.1: $(GDB_DOC_FILES) - mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) - rm -f gcore.pod - -+gdb-add-index.1: $(GDB_DOC_FILES) -+ touch $@ -+ -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod -+ -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -+ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) -+ rm -f gdb-add-index.pod -+ - gdbinit.5: $(GDB_DOC_FILES) - touch $@ - -$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod -diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 2f2cbd3dea..7b99ae1551 100644 ---- a/gdb/doc/gdb.texinfo -+++ b/gdb/doc/gdb.texinfo -@@ -19796,6 +19796,14 @@ There are currently some limitation on indices. They only work when - for DWARF debugging information, not stabs. And, they do not - currently work for programs using Ada. - -+@value{GDBN} comes with a program, @command{gdb-add-index}, which can -+be used to add the index to a symbol file. It takes the symbol file -+as its only argument: -+ -+@smallexample -+$ gdb-add-index symfile -+@end smallexample -+ - @node Symbol Errors - @section Errors Reading Symbol Files - -@@ -42759,6 +42767,7 @@ switch (die->tag) - * gdbserver man:: Remote Server for the GNU Debugger man page - * gcore man:: Generate a core file of a running program - * gdbinit man:: gdbinit scripts -+* gdb-add-index man:: Add index files to speed up GDB - @end menu - - @node gdb man -@@ -43435,6 +43444,54 @@ Richard M. Stallman and Roland H. Pesch, July 1991. - @end ifset - @c man end - -+@node gdb-add-index man -+@heading gdb-add-index -+ -+@c man title gdb-add-index Add index files to speed up GDB -+ -+@c man begin SYNOPSIS gdb-add-index -+gdb-add-index @var{filename} -+@c man end -+ -+@c man begin DESCRIPTION gdb-add-index -+When GDB finds a symbol file, it scans the symbols in the file in order -+to construct an internal symbol table. This lets most GDB operations -+work quickly--at the cost of a delay early on. For large programs, -+this delay can be quite lengthy, so GDB provides a way to build an -+index, which speeds up startup. -+ -+To determine whether a file contains such an index, use the command -+@command{readelf -S filename}: the index is stored in a section named -+@code{.gdb_index}. Note that the index is never generated for files that do -+not contain DWARF debug information (sections named @code{.debug_*}). -+ -+See more in -+@ifset man -+the @value{GDBN} manual in node @code{Index Files} -+-- shell command @code{info -f gdb -n 'Index Files'}. -+@end ifset -+@ifclear man -+@ref{Index Files}. -+@end ifclear -+@c man end -+ -+@c man begin SEEALSO gdb-add-index -+@ifset man -+The full documentation for @value{GDBN} is maintained as a Texinfo manual. -+If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo -+documentation are properly installed at your site, the command -+ -+@smallexample -+info gdb -+@end smallexample -+ -+should give you access to the complete manual. -+ -+@cite{Using GDB: A Guide to the GNU Source-Level Debugger}, -+Richard M. Stallman and Roland H. Pesch, July 1991. -+@end ifset -+@c man end -+ - @include gpl.texi - - @node GNU Free Documentation License --- -2.14.3 - diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch index 979b42d..e7d25de 100644 --- a/gdb-glibc-strstr-workaround.patch +++ b/gdb-glibc-strstr-workaround.patch @@ -3,21 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-glibc-strstr-workaround.patch -FileName: gdb-glibc-strstr-workaround.patch - ;; Workaround PR libc/14166 for inferior calls of strstr. ;;=fedora: Compatibility with RHELs (unchecked which ones). ---- - gdb/dwarf2read.c | 20 ++++ - .../gdb.base/gnu-ifunc-strstr-workaround.exp | 108 +++++++++++++++++++++ - 2 files changed, 128 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index c8db955f2f..6ebe00f542 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -21328,6 +21328,26 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu, +@@ -21286,6 +21286,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); @@ -46,7 +38,6 @@ index c8db955f2f..6ebe00f542 100644 /* Fortran does not have mangling standard and the mangling does differ diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp new file mode 100644 -index 0000000000..5469cd7354 --- /dev/null +++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp @@ -0,0 +1,108 @@ @@ -158,6 +149,3 @@ index 0000000000..5469cd7354 + +gdb_test {print strstr("abc","b")} { = 0x[0-9a-f]+ "bc"} +gdb_test {print strstr("def","e")} { = 0x[0-9a-f]+ "ef"} --- -2.14.3 - diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch index ff45ef1..f1b05a9 100644 --- a/gdb-gnat-dwarf-crash-3of3.patch +++ b/gdb-gnat-dwarf-crash-3of3.patch @@ -1,9 +1,7 @@ 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_assert -> complaint for weird DWARF - -FileName: gdb-gnat-dwarf-crash-3of3.patch +Subject: gdb-gnat-dwarf-crash-3of3.patch ;; Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211). ;;=push+jan @@ -40,29 +38,199 @@ gdb/ 2014-02-24 Jan Kratochvil * dwarf2read.c (process_die): Change gdb_assert to complaint. ---- - gdb/dwarf2read.c | 8 ++++++++ - 1 file changed, 8 insertions(+) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index fbaa0af64f..2c972d5e74 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -10612,6 +10612,14 @@ private: +@@ -10499,6 +10499,13 @@ private: static void process_die (struct die_info *die, struct dwarf2_cu *cu) { + if (die->in_process) + { -+ complaint (&symfile_complaints, -+ _("DIE at 0x%x attempted to be processed twice"), -+ to_underlying (die->sect_off)); ++ complaint (_("DIE at 0x%s attempted to be processed twice"), ++ sect_offset_str (die->sect_off)); + return; + } + process_die_scope scope (die, cu); switch (die->tag) --- -2.14.3 - +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 \ + target_pid_to_str (process_ptid)); + } + ++#ifdef NEED_DETACH_SIGSTOP ++ /* We should check PID_WAS_STOPPED and detach it stopped accordingly. ++ In this point of code it cannot be 1 as we would not get FORK ++ executed without CONTINUE first which resets PID_WAS_STOPPED. ++ We would have to first TARGET_STOP and WAITPID it as with running ++ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */ ++#endif + target_detach (parent_inf, 0); + } + +diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c +--- a/gdb/linux-nat.c ++++ b/gdb/linux-nat.c +@@ -191,6 +191,12 @@ struct linux_nat_target *linux_target; + /* Does the current host support PTRACE_GETREGSET? */ + enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN; + ++#ifdef NEED_DETACH_SIGSTOP ++/* PID of the inferior stopped by SIGSTOP before attaching (or zero). */ ++static pid_t pid_was_stopped; ++ ++#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) + if (debug_linux_nat) + fprintf_unfiltered (gdb_stdlog, + "LNPAW: Attaching to a stopped process\n"); ++#ifdef NEED_DETACH_SIGSTOP ++ pid_was_stopped = ptid.pid (); ++#endif + + /* 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) + return gdb_signal_to_host (signo); + } + ++#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 (lp->ptid.pid () == pid_was_stopped) ++ { ++ int err; ++ ++ errno = 0; ++ err = kill_lwp (lp->ptid.lwp (), SIGSTOP); ++ if (debug_linux_nat) ++ { ++ fprintf_unfiltered (gdb_stdlog, ++ "SC: lwp kill %d %s\n", ++ err, ++ errno ? safe_strerror (errno) : "ERRNO-OK"); ++ } ++ } ++ ++#endif + return 0; + } + +@@ -1507,6 +1535,10 @@ linux_nat_target::detach (inferior *inf, int from_tty) + detach_one_lwp (main_lwp, &signo); + + detach_success (inf); ++ ++#ifdef NEED_DETACH_SIGSTOP ++ pid_was_stopped = 0; ++#endif + } + } + +@@ -1765,6 +1797,16 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo) + return; + } + ++#ifdef NEED_DETACH_SIGSTOP ++ /* At this point, we are going to resume the inferior and if we ++ have attached to a stopped process, we no longer should leave ++ 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 == lp->ptid.pid ()) ++ pid_was_stopped = 0; ++ ++#endif + if (resume_many) + iterate_over_lwps (ptid, linux_nat_resume_callback, lp); + +@@ -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); ++#ifdef NEED_DETACH_SIGSTOP ++ ++ pid_was_stopped = 0; ++#endif + } + + /* Convert a native/host siginfo object, into/from the siginfo in the +diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp +--- a/gdb/testsuite/gdb.threads/attach-stopped.exp ++++ b/gdb/testsuite/gdb.threads/attach-stopped.exp +@@ -56,7 +56,65 @@ proc corefunc { threadtype } { + gdb_reinitialize_dir $srcdir/$subdir + gdb_load ${binfile} + +- # Verify that we can attach to the stopped process. ++ # Verify that we can attach to the process by first giving its ++ # executable name via the file command, and using attach with the ++ # process ID. ++ ++ set test "$threadtype: set file, before attach1 to stopped process" ++ gdb_test_multiple "file $binfile" "$test" { ++ -re "Load new symbol table from.*y or n. $" { ++ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \ ++ "$test (re-read)" ++ } ++ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" { ++ pass "$test" ++ } ++ } ++ ++ set test "$threadtype: attach1 to stopped, after setting file" ++ gdb_test_multiple "attach $testpid" "$test" { ++ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { ++ pass "$test" ++ } ++ } ++ ++ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there. ++ if {[string equal $threadtype threaded]} { ++ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach1 to stopped bt" ++ } else { ++ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach1 to stopped bt" ++ } ++ ++ # Exit and detach the process. ++ ++ gdb_exit ++ ++ # Avoid some race: ++ sleep 2 ++ ++ if [catch {open /proc/${testpid}/status r} fileid] { ++ set line2 "NOTFOUND" ++ } else { ++ gets $fileid line1; ++ gets $fileid line2; ++ close $fileid; ++ } ++ ++ set test "$threadtype: attach1, exit leaves process stopped" ++ if {[string match "*(stopped)*" $line2]} { ++ pass $test ++ } else { ++ fail $test ++ } ++ ++ # At this point, the process should still be stopped ++ ++ gdb_start ++ gdb_reinitialize_dir $srcdir/$subdir ++ gdb_load ${binfile} ++ ++ # Verify that we can attach to the process just by giving the ++ # process ID. + + set test "$threadtype: attach2 to stopped, after setting file" + gdb_test_multiple "attach $testpid" "$test" { diff --git a/gdb-jit-reader-multilib.patch b/gdb-jit-reader-multilib.patch index d5efd1d..9cb52eb 100644 --- a/gdb-jit-reader-multilib.patch +++ b/gdb-jit-reader-multilib.patch @@ -3,20 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-jit-reader-multilib.patch -FileName: gdb-jit-reader-multilib.patch - ;; Fix jit-reader.h for multi-lib. ;;=push+jan ---- - gdb/configure | 8 +++++--- - gdb/configure.ac | 8 +++++--- - 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gdb/configure b/gdb/configure -index 904cc453ad..6fb5b5b509 100755 --- a/gdb/configure +++ b/gdb/configure -@@ -9528,10 +9528,12 @@ _ACEOF +@@ -9680,10 +9680,12 @@ _ACEOF @@ -33,10 +26,9 @@ index 904cc453ad..6fb5b5b509 100755 TARGET_PTR="unsigned __int128" else diff --git a/gdb/configure.ac b/gdb/configure.ac -index 1557760ed8..d891c7bccc 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -832,10 +832,12 @@ AC_CHECK_SIZEOF(unsigned long long) +@@ -843,10 +843,12 @@ AC_CHECK_SIZEOF(unsigned long long) AC_CHECK_SIZEOF(unsigned long) AC_CHECK_SIZEOF(unsigned __int128) @@ -52,6 +44,3 @@ index 1557760ed8..d891c7bccc 100644 elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then TARGET_PTR="unsigned __int128" else --- -2.14.3 - diff --git a/gdb-libexec-add-index.patch b/gdb-libexec-add-index.patch index 2b8f527..0d7408b 100644 --- a/gdb-libexec-add-index.patch +++ b/gdb-libexec-add-index.patch @@ -3,16 +3,10 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-libexec-add-index.patch -FileName: gdb-libexec-add-index.patch - ;; Fix gdb-headless /usr/bin/ executables (BZ 1390251). ;;=fedora ---- - gdb/contrib/gdb-add-index.sh | 5 +++++ - 1 file changed, 5 insertions(+) diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh -index 71146966ab..500b2f62d5 100755 --- a/gdb/contrib/gdb-add-index.sh +++ b/gdb/contrib/gdb-add-index.sh @@ -21,6 +21,11 @@ @@ -26,7 +20,4 @@ index 71146966ab..500b2f62d5 100755 + myname="${0##*/}" - if test $# != 1; then --- -2.14.3 - + dwarf5="" diff --git a/gdb-lineno-makeup-test.patch b/gdb-lineno-makeup-test.patch index cd8a9aa..dfaf0a7 100644 --- a/gdb-lineno-makeup-test.patch +++ b/gdb-lineno-makeup-test.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-lineno-makeup-test.patch -FileName: gdb-lineno-makeup-test.patch - ;; Testcase for "Do not make up line information" fix by Daniel Jacobowitz. ;;=fedoratest @@ -15,18 +13,9 @@ and the upstream fix: http://sourceware.org/ml/gdb-patches/2006-11/msg00253.html [rfc] Do not make up line information http://sourceware.org/ml/gdb-cvs/2006-11/msg00127.html ---- - gdb/testsuite/gdb.base/lineno-makeup-func.c | 21 ++++++++ - gdb/testsuite/gdb.base/lineno-makeup.c | 35 +++++++++++++ - gdb/testsuite/gdb.base/lineno-makeup.exp | 78 +++++++++++++++++++++++++++++ - 3 files changed, 134 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/lineno-makeup-func.c - create mode 100644 gdb/testsuite/gdb.base/lineno-makeup.c - create mode 100644 gdb/testsuite/gdb.base/lineno-makeup.exp diff --git a/gdb/testsuite/gdb.base/lineno-makeup-func.c b/gdb/testsuite/gdb.base/lineno-makeup-func.c new file mode 100644 -index 0000000000..1a0220ea52 --- /dev/null +++ b/gdb/testsuite/gdb.base/lineno-makeup-func.c @@ -0,0 +1,21 @@ @@ -53,7 +42,6 @@ index 0000000000..1a0220ea52 +} diff --git a/gdb/testsuite/gdb.base/lineno-makeup.c b/gdb/testsuite/gdb.base/lineno-makeup.c new file mode 100644 -index 0000000000..5d4be90999 --- /dev/null +++ b/gdb/testsuite/gdb.base/lineno-makeup.c @@ -0,0 +1,35 @@ @@ -94,7 +82,6 @@ index 0000000000..5d4be90999 +} diff --git a/gdb/testsuite/gdb.base/lineno-makeup.exp b/gdb/testsuite/gdb.base/lineno-makeup.exp new file mode 100644 -index 0000000000..9e11d78bf9 --- /dev/null +++ b/gdb/testsuite/gdb.base/lineno-makeup.exp @@ -0,0 +1,78 @@ @@ -176,6 +163,3 @@ index 0000000000..9e11d78bf9 + fail $test + } +} --- -2.14.3 - diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch index ff703f3..ac3c637 100644 --- a/gdb-linux_perf-bundle.patch +++ b/gdb-linux_perf-bundle.patch @@ -3,22 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-linux_perf-bundle.patch -FileName: gdb-linux_perf-bundle.patch - ;; [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). ;;=fedora ---- - gdb/configure | 2 +- - gdb/configure.ac | 2 +- - gdb/gdb.c | 8 +++ - gdb/nat/linux-btrace.h | 171 +++++++++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 181 insertions(+), 2 deletions(-) diff --git a/gdb/configure b/gdb/configure -index db849572b5..7720c00f4b 100755 --- a/gdb/configure +++ b/gdb/configure -@@ -11907,7 +11907,7 @@ else +@@ -12059,7 +12059,7 @@ else #include #ifndef PERF_ATTR_SIZE_VER5 @@ -28,20 +19,18 @@ index db849572b5..7720c00f4b 100755 _ACEOF diff --git a/gdb/configure.ac b/gdb/configure.ac -index 4412e25450..e64b0e806f 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -1466,7 +1466,7 @@ else - AC_PREPROC_IFELSE(AC_LANG_SOURCE([[ +@@ -1477,7 +1477,7 @@ else + AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ #include #ifndef PERF_ATTR_SIZE_VER5 -# error +// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL #endif - ]]), [perf_event=yes], [perf_event=no]) + ]])], [perf_event=yes], [perf_event=no]) if test "$perf_event" != yes; then diff --git a/gdb/gdb.c b/gdb/gdb.c -index b97500e579..151545105c 100644 --- a/gdb/gdb.c +++ b/gdb/gdb.c @@ -20,11 +20,19 @@ @@ -65,7 +54,6 @@ index b97500e579..151545105c 100644 args.argc = argc; args.argv = argv; diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h -index 31a8d9e67b..72faf23c5f 100644 --- a/gdb/nat/linux-btrace.h +++ b/gdb/nat/linux-btrace.h @@ -28,6 +28,177 @@ @@ -246,6 +234,3 @@ index 31a8d9e67b..72faf23c5f 100644 struct target_ops; #if HAVE_LINUX_PERF_EVENT_H --- -2.14.3 - diff --git a/gdb-moribund-utrace-workaround.patch b/gdb-moribund-utrace-workaround.patch index 9fbdd80..aa77bdc 100644 --- a/gdb-moribund-utrace-workaround.patch +++ b/gdb-moribund-utrace-workaround.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-moribund-utrace-workaround.patch -FileName: gdb-moribund-utrace-workaround.patch - ;; Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623). ;;=push+jan: Currently it is still not fully safe. @@ -12,15 +10,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=590623 http://sources.redhat.com/bugzilla/show_bug.cgi?id=11593 Bug in FSF GDB exploited by the ptrace-on-utrace interaction. ---- - gdb/breakpoint.c | 2 ++ - 1 file changed, 2 insertions(+) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index 5a99de75e1..6a0c15b239 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -12089,6 +12089,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode) +@@ -12016,6 +12016,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); @@ -29,6 +23,3 @@ index 5a99de75e1..6a0c15b239 100644 old_loc->owner = NULL; VEC_safe_push (bp_location_p, moribund_locations, old_loc); --- -2.14.3 - diff --git a/gdb-opcodes-clflushopt-test.patch b/gdb-opcodes-clflushopt-test.patch index 67f8d0d..0d77c2e 100644 --- a/gdb-opcodes-clflushopt-test.patch +++ b/gdb-opcodes-clflushopt-test.patch @@ -3,20 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-opcodes-clflushopt-test.patch -FileName: gdb-opcodes-clflushopt-test.patch - ;; Test clflushopt instruction decode (for RH BZ 1262471). ;;=fedoratest ---- - gdb/testsuite/gdb.arch/amd64-clflushopt.S | 19 +++++++++++++++++++ - gdb/testsuite/gdb.arch/amd64-clflushopt.exp | 25 +++++++++++++++++++++++++ - 2 files changed, 44 insertions(+) - create mode 100644 gdb/testsuite/gdb.arch/amd64-clflushopt.S - create mode 100644 gdb/testsuite/gdb.arch/amd64-clflushopt.exp diff --git a/gdb/testsuite/gdb.arch/amd64-clflushopt.S b/gdb/testsuite/gdb.arch/amd64-clflushopt.S new file mode 100644 -index 0000000000..dee4f006dc --- /dev/null +++ b/gdb/testsuite/gdb.arch/amd64-clflushopt.S @@ -0,0 +1,19 @@ @@ -41,7 +32,6 @@ index 0000000000..dee4f006dc + clflushopt (%edi) diff --git a/gdb/testsuite/gdb.arch/amd64-clflushopt.exp b/gdb/testsuite/gdb.arch/amd64-clflushopt.exp new file mode 100644 -index 0000000000..22a9decee2 --- /dev/null +++ b/gdb/testsuite/gdb.arch/amd64-clflushopt.exp @@ -0,0 +1,25 @@ @@ -70,6 +60,3 @@ index 0000000000..22a9decee2 +} + +gdb_test "disas _start" "Dump of assembler code for function _start:\r\n *0x\[0-9a-f\]+ <\[+\]0>:\tclflushopt \\(%edi\\)\r\nEnd of assembler dump\\." "clflushopt" --- -2.14.3 - diff --git a/gdb-physname-pr11734-test.patch b/gdb-physname-pr11734-test.patch index 87f14b5..6585b66 100644 --- a/gdb-physname-pr11734-test.patch +++ b/gdb-physname-pr11734-test.patch @@ -3,30 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-physname-pr11734-test.patch -FileName: gdb-physname-pr11734-test.patch - ;; Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). ;;=fedoratest http://sourceware.org/ml/gdb-patches/2010-12/msg00263.html ---- - gdb/testsuite/gdb.cp/pr11734-1.cc | 30 +++++++++++++++++++++ - gdb/testsuite/gdb.cp/pr11734-2.cc | 27 +++++++++++++++++++ - gdb/testsuite/gdb.cp/pr11734-3.cc | 27 +++++++++++++++++++ - gdb/testsuite/gdb.cp/pr11734-4.cc | 27 +++++++++++++++++++ - gdb/testsuite/gdb.cp/pr11734.exp | 55 +++++++++++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.cp/pr11734.h | 28 ++++++++++++++++++++ - 6 files changed, 194 insertions(+) - create mode 100644 gdb/testsuite/gdb.cp/pr11734-1.cc - create mode 100644 gdb/testsuite/gdb.cp/pr11734-2.cc - create mode 100644 gdb/testsuite/gdb.cp/pr11734-3.cc - create mode 100644 gdb/testsuite/gdb.cp/pr11734-4.cc - create mode 100644 gdb/testsuite/gdb.cp/pr11734.exp - create mode 100644 gdb/testsuite/gdb.cp/pr11734.h diff --git a/gdb/testsuite/gdb.cp/pr11734-1.cc b/gdb/testsuite/gdb.cp/pr11734-1.cc new file mode 100644 -index 0000000000..f3480ce977 --- /dev/null +++ b/gdb/testsuite/gdb.cp/pr11734-1.cc @@ -0,0 +1,30 @@ @@ -62,7 +45,6 @@ index 0000000000..f3480ce977 + diff --git a/gdb/testsuite/gdb.cp/pr11734-2.cc b/gdb/testsuite/gdb.cp/pr11734-2.cc new file mode 100644 -index 0000000000..dbebe8281a --- /dev/null +++ b/gdb/testsuite/gdb.cp/pr11734-2.cc @@ -0,0 +1,27 @@ @@ -95,7 +77,6 @@ index 0000000000..dbebe8281a + diff --git a/gdb/testsuite/gdb.cp/pr11734-3.cc b/gdb/testsuite/gdb.cp/pr11734-3.cc new file mode 100644 -index 0000000000..faaeffc9dd --- /dev/null +++ b/gdb/testsuite/gdb.cp/pr11734-3.cc @@ -0,0 +1,27 @@ @@ -128,7 +109,6 @@ index 0000000000..faaeffc9dd + diff --git a/gdb/testsuite/gdb.cp/pr11734-4.cc b/gdb/testsuite/gdb.cp/pr11734-4.cc new file mode 100644 -index 0000000000..6edf8110f1 --- /dev/null +++ b/gdb/testsuite/gdb.cp/pr11734-4.cc @@ -0,0 +1,27 @@ @@ -161,7 +141,6 @@ index 0000000000..6edf8110f1 + diff --git a/gdb/testsuite/gdb.cp/pr11734.exp b/gdb/testsuite/gdb.cp/pr11734.exp new file mode 100644 -index 0000000000..e731d422f6 --- /dev/null +++ b/gdb/testsuite/gdb.cp/pr11734.exp @@ -0,0 +1,55 @@ @@ -222,7 +201,6 @@ index 0000000000..e731d422f6 +return 0 diff --git a/gdb/testsuite/gdb.cp/pr11734.h b/gdb/testsuite/gdb.cp/pr11734.h new file mode 100644 -index 0000000000..7f6e72a685 --- /dev/null +++ b/gdb/testsuite/gdb.cp/pr11734.h @@ -0,0 +1,28 @@ @@ -254,6 +232,3 @@ index 0000000000..7f6e72a685 + void foo (char *); +}; + --- -2.14.3 - diff --git a/gdb-physname-pr12273-test.patch b/gdb-physname-pr12273-test.patch index 7f181a3..e03abf1 100644 --- a/gdb-physname-pr12273-test.patch +++ b/gdb-physname-pr12273-test.patch @@ -3,22 +3,13 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-physname-pr12273-test.patch -FileName: gdb-physname-pr12273-test.patch - ;; Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). ;;=fedoratest http://sourceware.org/ml/gdb-patches/2010-12/msg00264.html ---- - gdb/testsuite/gdb.cp/pr12273.cc | 37 ++++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.cp/pr12273.exp | 46 ++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 83 insertions(+) - create mode 100644 gdb/testsuite/gdb.cp/pr12273.cc - create mode 100644 gdb/testsuite/gdb.cp/pr12273.exp diff --git a/gdb/testsuite/gdb.cp/pr12273.cc b/gdb/testsuite/gdb.cp/pr12273.cc new file mode 100644 -index 0000000000..79dd7bad74 --- /dev/null +++ b/gdb/testsuite/gdb.cp/pr12273.cc @@ -0,0 +1,37 @@ @@ -61,7 +52,6 @@ index 0000000000..79dd7bad74 +} diff --git a/gdb/testsuite/gdb.cp/pr12273.exp b/gdb/testsuite/gdb.cp/pr12273.exp new file mode 100644 -index 0000000000..9d71482742 --- /dev/null +++ b/gdb/testsuite/gdb.cp/pr12273.exp @@ -0,0 +1,46 @@ @@ -111,6 +101,3 @@ index 0000000000..9d71482742 +} + +gdb_exit --- -2.14.3 - diff --git a/gdb-ppc-power7-test.patch b/gdb-ppc-power7-test.patch index 12ab81e..de30c55 100644 --- a/gdb-ppc-power7-test.patch +++ b/gdb-ppc-power7-test.patch @@ -3,20 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-ppc-power7-test.patch -FileName: gdb-ppc-power7-test.patch - ;; Test power7 ppc disassembly. ;;=fedoratest ---- - gdb/testsuite/gdb.arch/powerpc-power7rh.exp | 178 ++++++++++++++++++++++++++++ - gdb/testsuite/gdb.arch/powerpc-power7rh.s | 107 +++++++++++++++++ - 2 files changed, 285 insertions(+) - create mode 100644 gdb/testsuite/gdb.arch/powerpc-power7rh.exp - create mode 100644 gdb/testsuite/gdb.arch/powerpc-power7rh.s diff --git a/gdb/testsuite/gdb.arch/powerpc-power7rh.exp b/gdb/testsuite/gdb.arch/powerpc-power7rh.exp new file mode 100644 -index 0000000000..0c2bbdaede --- /dev/null +++ b/gdb/testsuite/gdb.arch/powerpc-power7rh.exp @@ -0,0 +1,178 @@ @@ -200,7 +191,6 @@ index 0000000000..0c2bbdaede +func_check 0x19c "isel r2,r3,r4,28" diff --git a/gdb/testsuite/gdb.arch/powerpc-power7rh.s b/gdb/testsuite/gdb.arch/powerpc-power7rh.s new file mode 100644 -index 0000000000..98b2e797e7 --- /dev/null +++ b/gdb/testsuite/gdb.arch/powerpc-power7rh.s @@ -0,0 +1,107 @@ @@ -311,6 +301,3 @@ index 0000000000..98b2e797e7 + .long 0xedc07834 /* 194: frsqrtes f14,f15 */ + .long 0xedc07835 /* 198: frsqrtes. f14,f15 */ + .long 0x7c43271e /* 19c: isel r2,r3,r4,28 */ --- -2.14.3 - diff --git a/gdb-ppc64-stwux-tautological-compare.patch b/gdb-ppc64-stwux-tautological-compare.patch deleted file mode 100644 index b9b31b3..0000000 --- a/gdb-ppc64-stwux-tautological-compare.patch +++ /dev/null @@ -1,56 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Sun, 4 Feb 2018 21:42:18 +0100 -Subject: gdb-ppc64-stwux-tautological-compare.patch - -FileName: gdb-ppc64-stwux-tautological-compare.patch - -;; Fix ppc64 stwux encoding as found by gcc-8.0 -Werror=tautological-compare. - -[patch] ppc64: Fix stwux encoding -https://sourceware.org/ml/gdb-patches/2018-02/msg00058.html - -with gcc-8.0.1-0.9.fc28.x86_64 I get: - -../../gdb/rs6000-tdep.c: In function 'CORE_ADDR skip_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, rs6000_framedata*)': -../../gdb/rs6000-tdep.c:1911:34: error: bitwise comparison always evaluates to false [-Werror=tautological-compare] - else if ((op & 0xfc1f016a) == 0x7c01016e) - ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ - -The code is there since: - commit 98f08d3d9b69b344bb8b0cd2a4bda1cf4d966e20 - Author: Kevin Buettner - Date: Thu May 29 19:47:14 2003 +0000 - From Jimi X : - * rs6000-tdep.c (skip_prologue): Improve support for 64-bit code. -So I do not think we can find the original author. - -https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.alangref/idalangref_stwux_stux_instrs.htm -says - bit 21 - 30 = 183 - Those are bits 1..10 in normal bit order: 183<<1 = 0x16e - -gdb/ChangeLog -2018-02-04 Jan Kratochvil - - * rs6000-tdep.c (skip_prologue): Fix stwux encoding. ---- - gdb/rs6000-tdep.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c -index 23d0db3b8f..5275ff5b91 100644 ---- a/gdb/rs6000-tdep.c -+++ b/gdb/rs6000-tdep.c -@@ -1908,7 +1908,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, - offset = fdata->offset; - continue; - } -- else if ((op & 0xfc1f016a) == 0x7c01016e) -+ else if ((op & 0xfc1f016e) == 0x7c01016e) - { /* stwux rX,r1,rY */ - /* No way to figure out what r1 is going to be. */ - fdata->frameless = 0; --- -2.14.3 - diff --git a/gdb-python-gil.patch b/gdb-python-gil.patch index 1aa8db2..1211df5 100644 --- a/gdb-python-gil.patch +++ b/gdb-python-gil.patch @@ -3,24 +3,10 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-python-gil.patch -FileName: gdb-python-gil.patch - ;; Fix Python GIL with gdb.execute("continue") (Phil Muldoon, BZ 1116957). ;;=push ---- - gdb/doc/python.texi | 8 ++++ - gdb/python/python-internal.h | 2 + - gdb/python/python.c | 42 +++++++++++++++--- - gdb/testsuite/gdb.python/py-gil-mthread.c | 13 ++++++ - gdb/testsuite/gdb.python/py-gil-mthread.exp | 69 +++++++++++++++++++++++++++++ - gdb/testsuite/gdb.python/py-gil-mthread.py | 28 ++++++++++++ - 6 files changed, 157 insertions(+), 5 deletions(-) - create mode 100644 gdb/testsuite/gdb.python/py-gil-mthread.c - create mode 100644 gdb/testsuite/gdb.python/py-gil-mthread.exp - create mode 100644 gdb/testsuite/gdb.python/py-gil-mthread.py diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi -index ebd48fffe7..ccf011e35e 100644 --- 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 @@ -39,7 +25,6 @@ index ebd48fffe7..ccf011e35e 100644 @findex gdb.breakpoints diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h -index c110588f76..89bbc6987b 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -148,6 +148,8 @@ typedef int Py_ssize_t; @@ -52,10 +37,9 @@ index c110588f76..89bbc6987b 100644 #endif diff --git a/gdb/python/python.c b/gdb/python/python.c -index 4844c86c54..610dda828c 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c -@@ -554,12 +554,16 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) +@@ -556,12 +556,16 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) { const char *arg; PyObject *from_tty_obj = NULL, *to_string_obj = NULL; @@ -76,7 +60,7 @@ index 4844c86c54..610dda828c 100644 return NULL; from_tty = 0; -@@ -580,12 +584,28 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) +@@ -582,6 +586,15 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) to_string = cmp; } @@ -92,8 +76,9 @@ index 4844c86c54..610dda828c 100644 std::string to_string_res; TRY - { - struct interp *interp; +@@ -602,6 +615,13 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) + + counted_command_line lines = read_command_lines_1 (reader, 1, nullptr); + /* In the case of long running GDB commands, allow the user to + release the Python GIL acquired by Python. Restore the GIL @@ -105,10 +90,10 @@ index 4844c86c54..610dda828c 100644 scoped_restore save_async = make_scoped_restore (¤t_ui->async, 0); scoped_restore save_uiout = make_scoped_restore (¤t_uiout); -@@ -600,10 +620,22 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) - to_string_res = execute_command_to_string (arg, from_tty); +@@ -617,10 +637,22 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) + from_tty); else - execute_command (arg, from_tty); + execute_control_commands (lines.get (), from_tty); + + /* Reacquire the GIL if it was released earlier. */ + if (release_gil) @@ -131,7 +116,6 @@ index 4844c86c54..610dda828c 100644 diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.c b/gdb/testsuite/gdb.python/py-gil-mthread.c new file mode 100644 -index 0000000000..1a12fc9c6d --- /dev/null +++ b/gdb/testsuite/gdb.python/py-gil-mthread.c @@ -0,0 +1,13 @@ @@ -150,7 +134,6 @@ index 0000000000..1a12fc9c6d +} diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.exp b/gdb/testsuite/gdb.python/py-gil-mthread.exp new file mode 100644 -index 0000000000..a89c16a45b --- /dev/null +++ b/gdb/testsuite/gdb.python/py-gil-mthread.exp @@ -0,0 +1,69 @@ @@ -225,7 +208,6 @@ index 0000000000..a89c16a45b +} diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.py b/gdb/testsuite/gdb.python/py-gil-mthread.py new file mode 100644 -index 0000000000..6a89964139 --- /dev/null +++ b/gdb/testsuite/gdb.python/py-gil-mthread.py @@ -0,0 +1,28 @@ @@ -257,6 +239,3 @@ index 0000000000..6a89964139 + +while 1: + pass --- -2.14.3 - diff --git a/gdb-readline62-ask-more-rh.patch b/gdb-readline62-ask-more-rh.patch index e246291..c600c01 100644 --- a/gdb-readline62-ask-more-rh.patch +++ b/gdb-readline62-ask-more-rh.patch @@ -3,16 +3,10 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-readline62-ask-more-rh.patch -FileName: gdb-readline62-ask-more-rh.patch - ;; Work around readline-6.2 incompatibility not asking for --more-- (BZ 701131). ;;=fedora ---- - gdb/event-top.c | 7 +++++++ - 1 file changed, 7 insertions(+) diff --git a/gdb/event-top.c b/gdb/event-top.c -index 0d668f35e0..4aa26125f9 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -1183,6 +1183,13 @@ gdb_setup_readline (int editing) @@ -29,6 +23,3 @@ index 0d668f35e0..4aa26125f9 100644 /* This function is a noop for the sync case. The assumption is that the sync setup is ALL done in gdb_init, and we would only mess it up here. The sync stuff should really go away over --- -2.14.3 - diff --git a/gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch b/gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch index 3cef49d..5a5af92 100644 --- a/gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +++ b/gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch @@ -3,20 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -FileName: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch - ;; Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343). ;;=fedoratest ---- - gdb/testsuite/gdb.base/set-solib-absolute-prefix.c | 26 +++++++++++++++ - .../gdb.base/set-solib-absolute-prefix.exp | 39 ++++++++++++++++++++++ - 2 files changed, 65 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/set-solib-absolute-prefix.c - create mode 100644 gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp diff --git a/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c new file mode 100644 -index 0000000000..2675a34f1a --- /dev/null +++ b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c @@ -0,0 +1,26 @@ @@ -48,7 +39,6 @@ index 0000000000..2675a34f1a +} diff --git a/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp new file mode 100644 -index 0000000000..bb4c8b962b --- /dev/null +++ b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp @@ -0,0 +1,39 @@ @@ -91,6 +81,3 @@ index 0000000000..bb4c8b962b + ".*warning: Unable to find dynamic linker breakpoint function.*" \ + "set solib-absolute-prefix" +gdb_test "bt" "__kernel_vsyscall.*" "backtrace with __kernel_vsyscall" --- -2.14.3 - diff --git a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch index 7f5e26e..6eecc8f 100644 --- a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +++ b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -FileName: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch - ;; Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614) ;;=fedoratest @@ -29,18 +27,9 @@ Date: Wed Mar 28 17:38:08 2012 +0000 * python/py-inferior.c (infpy_read_memory): Remove cleanups and explicitly free 'buffer' on exit paths. Decref 'membuf_object' before returning. ---- - .../py-gdb-rhbz1007614-memleak-infpy_read_memory.c | 27 +++++++++ - ...y-gdb-rhbz1007614-memleak-infpy_read_memory.exp | 68 ++++++++++++++++++++++ - ...py-gdb-rhbz1007614-memleak-infpy_read_memory.py | 30 ++++++++++ - 3 files changed, 125 insertions(+) - create mode 100644 gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c - create mode 100644 gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp - create mode 100644 gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c new file mode 100644 -index 0000000000..f2697efa9a --- /dev/null +++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c @@ -0,0 +1,27 @@ @@ -73,7 +62,6 @@ index 0000000000..f2697efa9a +} diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp new file mode 100644 -index 0000000000..2e6786d499 --- /dev/null +++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp @@ -0,0 +1,68 @@ @@ -147,7 +135,6 @@ index 0000000000..2e6786d499 +} diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py new file mode 100644 -index 0000000000..e807728047 --- /dev/null +++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py @@ -0,0 +1,30 @@ @@ -181,6 +168,3 @@ index 0000000000..e807728047 + print "Hello, World!" + +HelloWorld () --- -2.14.3 - diff --git a/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch b/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch index 87c2f4b..e6bd797 100644 --- a/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +++ b/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -FileName: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch - ;; Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan ;; Kratochvil, RH BZ 1084404). ;;=fedoratest @@ -12,20 +10,9 @@ FileName: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch These testcases have been created by compiling glibc-2.17-78 on RHEL-7.1 s390x/ppc64 boxes, and then taking the "select.o" file present at $builddir/misc/select.o. ---- - gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp | 34 ++++++++++++ - gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu | 70 +++++++++++++++++++++++++ - gdb/testsuite/gdb.arch/s390x-prologue-skip.exp | 34 ++++++++++++ - gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu | 64 ++++++++++++++++++++++ - 4 files changed, 202 insertions(+) - create mode 100644 gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp - create mode 100644 gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu - create mode 100644 gdb/testsuite/gdb.arch/s390x-prologue-skip.exp - create mode 100644 gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu diff --git a/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp new file mode 100644 -index 0000000000..2f54c1f981 --- /dev/null +++ b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp @@ -0,0 +1,34 @@ @@ -65,7 +52,6 @@ index 0000000000..2f54c1f981 +gdb_test "break ___newselect_nocancel" "Breakpoint $decimal at 0xc: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on ___newselect_nocancel" diff --git a/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu new file mode 100644 -index 0000000000..9196bbac47 --- /dev/null +++ b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu @@ -0,0 +1,70 @@ @@ -141,7 +127,6 @@ index 0000000000..9196bbac47 +end diff --git a/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp b/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp new file mode 100644 -index 0000000000..df3acf8c02 --- /dev/null +++ b/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp @@ -0,0 +1,34 @@ @@ -181,7 +166,6 @@ index 0000000000..df3acf8c02 +gdb_test "break select" "Breakpoint $decimal at 0x48: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on select" diff --git a/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu b/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu new file mode 100644 -index 0000000000..6442e6048d --- /dev/null +++ b/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu @@ -0,0 +1,64 @@ @@ -249,6 +233,3 @@ index 0000000000..6442e6048d +L````(`````$````%````````````````````/`````$````%`````````$@` +` +end --- -2.14.3 - diff --git a/gdb-rhbz1149205-catch-syscall-after-fork-test.patch b/gdb-rhbz1149205-catch-syscall-after-fork-test.patch index 728e1b8..68de6b2 100644 --- a/gdb-rhbz1149205-catch-syscall-after-fork-test.patch +++ b/gdb-rhbz1149205-catch-syscall-after-fork-test.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -FileName: gdb-rhbz1149205-catch-syscall-after-fork-test.patch - ;; Fix '`catch syscall' doesn't work for parent after `fork' is called' ;; (Philippe Waroquiers, RH BZ 1149205). ;;=fedoratest @@ -43,16 +41,9 @@ Author: Philippe Waroquiers Date: Tue May 21 18:47:05 2013 +0000 Fix internal error caused by interaction between catch signal and fork ---- - .../gdb.base/gdb-rhbz1149205-catch-syscall-fork.c | 11 ++++ - .../gdb-rhbz1149205-catch-syscall-fork.exp | 58 ++++++++++++++++++++++ - 2 files changed, 69 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c - create mode 100644 gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c b/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c new file mode 100644 -index 0000000000..947258e22f --- /dev/null +++ b/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c @@ -0,0 +1,11 @@ @@ -69,7 +60,6 @@ index 0000000000..947258e22f +} diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp b/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp new file mode 100644 -index 0000000000..96d31d7018 --- /dev/null +++ b/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp @@ -0,0 +1,58 @@ @@ -131,6 +121,3 @@ index 0000000000..96d31d7018 +gdb_test "continue" \ + "Continuing\.\r\n.*\r\nCatchpoint $decimal \\\(call to syscall .?chdir.?.*" \ + "continue from catch syscall after fork" --- -2.14.3 - diff --git a/gdb-rhbz1156192-recursive-dlopen-test.patch b/gdb-rhbz1156192-recursive-dlopen-test.patch index 7a8dc54..6b92424 100644 --- a/gdb-rhbz1156192-recursive-dlopen-test.patch +++ b/gdb-rhbz1156192-recursive-dlopen-test.patch @@ -3,25 +3,12 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1156192-recursive-dlopen-test.patch -FileName: gdb-rhbz1156192-recursive-dlopen-test.patch - ;; Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to ;; crash.' (RH BZ 1156192). ;;=fedoratest ---- - .../gdb-rhbz1156192-recursive-dlopen-libbar.c | 30 +++++ - .../gdb-rhbz1156192-recursive-dlopen-libfoo.c | 30 +++++ - .../gdb.base/gdb-rhbz1156192-recursive-dlopen.c | 124 +++++++++++++++++++ - .../gdb.base/gdb-rhbz1156192-recursive-dlopen.exp | 137 +++++++++++++++++++++ - 4 files changed, 321 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c - create mode 100644 gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c - create mode 100644 gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c - create mode 100644 gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c new file mode 100644 -index 0000000000..6ecf50d2ad --- /dev/null +++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c @@ -0,0 +1,30 @@ @@ -57,7 +44,6 @@ index 0000000000..6ecf50d2ad +} diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c new file mode 100644 -index 0000000000..e4523933db --- /dev/null +++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c @@ -0,0 +1,30 @@ @@ -93,7 +79,6 @@ index 0000000000..e4523933db +} diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c new file mode 100644 -index 0000000000..17b29904ef --- /dev/null +++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c @@ -0,0 +1,124 @@ @@ -223,7 +208,6 @@ index 0000000000..17b29904ef +} diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp new file mode 100644 -index 0000000000..2c32676e50 --- /dev/null +++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp @@ -0,0 +1,137 @@ @@ -364,6 +348,3 @@ index 0000000000..2c32676e50 +} + +test_stop_on_solib_events --- -2.14.3 - diff --git a/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch b/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch index 3762088..675b02f 100644 --- a/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch +++ b/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch -FileName: gdb-rhbz1186476-internal-error-unqualified-name-re-set-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). @@ -20,18 +18,9 @@ Comments from Sergio Durigan Junior: allows the user to continue the debugging session), and tell the user that, although more than one location was found for his/her breakpoint, only one will be used. ---- - ...-internal-error-unqualified-name-re-set-main.cc | 22 ++++++++++ - ...86476-internal-error-unqualified-name-re-set.cc | 26 +++++++++++ - ...6476-internal-error-unqualified-name-re-set.exp | 51 ++++++++++++++++++++++ - 3 files changed, 99 insertions(+) - create mode 100644 gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc - create mode 100644 gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc - create mode 100644 gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp diff --git a/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc new file mode 100644 -index 0000000000..1c9f8eabc1 --- /dev/null +++ b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc @@ -0,0 +1,22 @@ @@ -59,7 +48,6 @@ index 0000000000..1c9f8eabc1 +} diff --git a/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc new file mode 100644 -index 0000000000..007854b0c4 --- /dev/null +++ b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc @@ -0,0 +1,26 @@ @@ -91,7 +79,6 @@ index 0000000000..007854b0c4 +C b (1); diff --git a/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp new file mode 100644 -index 0000000000..19b2530969 --- /dev/null +++ b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp @@ -0,0 +1,51 @@ @@ -146,6 +133,3 @@ index 0000000000..19b2530969 +gdb_test "run" + +gdb_test "info break" " in C::C\\(\\) at .* in C::C\\(int\\) at .*" --- -2.14.3 - diff --git a/gdb-rhbz1187581-power8-regs-1of7.patch b/gdb-rhbz1187581-power8-regs-1of7.patch new file mode 100644 index 0000000..cb71ba5 --- /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..5c87335 --- /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..47a3482 --- /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..accc02a --- /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..8c59bf5 --- /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..6d2d699 --- /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..4d9c3ce --- /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-rhbz1261564-aarch64-hw-watchpoint-test.patch b/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch index 09c6ee2..889aa48 100644 --- a/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +++ b/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch @@ -3,20 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -FileName: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch - ;; [aarch64] Fix hardware watchpoints (RH BZ 1261564). ;;=fedoratest ---- - .../gdb.base/rhbz1261564-aarch64-watchpoint.c | 33 ++++++++++++++ - .../gdb.base/rhbz1261564-aarch64-watchpoint.exp | 53 ++++++++++++++++++++++ - 2 files changed, 86 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c - create mode 100644 gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c new file mode 100644 -index 0000000000..085001d7f3 --- /dev/null +++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c @@ -0,0 +1,33 @@ @@ -55,7 +46,6 @@ index 0000000000..085001d7f3 +} diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp new file mode 100644 -index 0000000000..49bb975602 --- /dev/null +++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp @@ -0,0 +1,53 @@ @@ -112,6 +102,3 @@ index 0000000000..49bb975602 +setup_xfail "powerpc*-*-*" + +gdb_continue_to_end --- -2.14.3 - diff --git a/gdb-rhbz1325795-framefilters-test.patch b/gdb-rhbz1325795-framefilters-test.patch index 525432f..b1cd040 100644 --- a/gdb-rhbz1325795-framefilters-test.patch +++ b/gdb-rhbz1325795-framefilters-test.patch @@ -3,22 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1325795-framefilters-test.patch -FileName: gdb-rhbz1325795-framefilters-test.patch - ;; New test for Python "Cannot locate object file for block" (for RH BZ 1325795). ;;=fedoratest ---- - gdb/testsuite/gdb.python/py-framefilter-thread.c | 39 ++++++++++++++ - gdb/testsuite/gdb.python/py-framefilter-thread.exp | 54 +++++++++++++++++++ - gdb/testsuite/gdb.python/py-framefilter-thread.py | 60 ++++++++++++++++++++++ - 3 files changed, 153 insertions(+) - create mode 100644 gdb/testsuite/gdb.python/py-framefilter-thread.c - create mode 100644 gdb/testsuite/gdb.python/py-framefilter-thread.exp - create mode 100644 gdb/testsuite/gdb.python/py-framefilter-thread.py diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.c b/gdb/testsuite/gdb.python/py-framefilter-thread.c new file mode 100644 -index 0000000000..6cebabb67a --- /dev/null +++ b/gdb/testsuite/gdb.python/py-framefilter-thread.c @@ -0,0 +1,39 @@ @@ -63,7 +52,6 @@ index 0000000000..6cebabb67a +} diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.exp b/gdb/testsuite/gdb.python/py-framefilter-thread.exp new file mode 100644 -index 0000000000..71f9746337 --- /dev/null +++ b/gdb/testsuite/gdb.python/py-framefilter-thread.exp @@ -0,0 +1,54 @@ @@ -123,7 +111,6 @@ index 0000000000..71f9746337 +gdb_test "bt" " in \[0-9\]+ \[^\r\n\]*" "bt with filters" diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.py b/gdb/testsuite/gdb.python/py-framefilter-thread.py new file mode 100644 -index 0000000000..8964799408 --- /dev/null +++ b/gdb/testsuite/gdb.python/py-framefilter-thread.py @@ -0,0 +1,60 @@ @@ -187,6 +174,3 @@ index 0000000000..8964799408 + return frame_iter + +FrameFilter() --- -2.14.3 - diff --git a/gdb-rhbz1350436-type-printers-error.patch b/gdb-rhbz1350436-type-printers-error.patch index fb2fec8..77aab65 100644 --- a/gdb-rhbz1350436-type-printers-error.patch +++ b/gdb-rhbz1350436-type-printers-error.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1350436-type-printers-error.patch -FileName: gdb-rhbz1350436-type-printers-error.patch - ;; Test 'info type-printers' Python error (RH BZ 1350436). ;;=fedoratest @@ -13,14 +11,8 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1350436 [testsuite patch] PR python/17136: 'info type-printers' causes an exception when there are per-objfile printers https://sourceware.org/ml/gdb-patches/2016-06/msg00455.html ---- - gdb/testsuite/gdb.python/py-typeprint.cc | 6 ++++++ - gdb/testsuite/gdb.python/py-typeprint.exp | 4 ++++ - gdb/testsuite/gdb.python/py-typeprint.py | 24 ++++++++++++++++++++++-- - 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.python/py-typeprint.cc b/gdb/testsuite/gdb.python/py-typeprint.cc -index 8135a5aa26..fb961f347d 100644 --- a/gdb/testsuite/gdb.python/py-typeprint.cc +++ b/gdb/testsuite/gdb.python/py-typeprint.cc @@ -31,6 +31,12 @@ templ s; @@ -37,7 +29,6 @@ index 8135a5aa26..fb961f347d 100644 { return 0; diff --git a/gdb/testsuite/gdb.python/py-typeprint.exp b/gdb/testsuite/gdb.python/py-typeprint.exp -index 15135b6f12..885457a853 100644 --- a/gdb/testsuite/gdb.python/py-typeprint.exp +++ b/gdb/testsuite/gdb.python/py-typeprint.exp @@ -50,3 +50,7 @@ gdb_test_no_output "enable type-printer string" @@ -49,7 +40,6 @@ index 15135b6f12..885457a853 100644 + "info type-printers for other" +gdb_test "whatis ovar" "type = Another" diff --git a/gdb/testsuite/gdb.python/py-typeprint.py b/gdb/testsuite/gdb.python/py-typeprint.py -index db5ea71b3b..69fc8c3886 100644 --- a/gdb/testsuite/gdb.python/py-typeprint.py +++ b/gdb/testsuite/gdb.python/py-typeprint.py @@ -15,7 +15,7 @@ @@ -89,6 +79,3 @@ index db5ea71b3b..69fc8c3886 100644 + +import gdb.types +gdb.types.register_type_printer(gdb.objfiles()[0], OtherTypePrinter()) --- -2.14.3 - diff --git a/gdb-rhbz1398387-tab-crash-test.patch b/gdb-rhbz1398387-tab-crash-test.patch index 1364ca0..ad0abe6 100644 --- a/gdb-rhbz1398387-tab-crash-test.patch +++ b/gdb-rhbz1398387-tab-crash-test.patch @@ -3,20 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz1398387-tab-crash-test.patch -FileName: gdb-rhbz1398387-tab-crash-test.patch - ;; New testcase for: Fix -completion crash (Gary Benson, RH BZ 1398387). ;;=fedoratest ---- - gdb/testsuite/gdb.base/tab-crash.bz2.uu | 393 ++++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.base/tab-crash.exp | 43 ++++ - 2 files changed, 436 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/tab-crash.bz2.uu - create mode 100644 gdb/testsuite/gdb.base/tab-crash.exp diff --git a/gdb/testsuite/gdb.base/tab-crash.bz2.uu b/gdb/testsuite/gdb.base/tab-crash.bz2.uu new file mode 100644 -index 0000000000..e55ec5011b --- /dev/null +++ b/gdb/testsuite/gdb.base/tab-crash.bz2.uu @@ -0,0 +1,393 @@ @@ -415,7 +406,6 @@ index 0000000000..e55ec5011b +end diff --git a/gdb/testsuite/gdb.base/tab-crash.exp b/gdb/testsuite/gdb.base/tab-crash.exp new file mode 100644 -index 0000000000..91c45aa366 --- /dev/null +++ b/gdb/testsuite/gdb.base/tab-crash.exp @@ -0,0 +1,43 @@ @@ -462,6 +452,3 @@ index 0000000000..91c45aa366 +clean_restart ${debugfile} + +gdb_test "complete p si" "complete p si\r\np size_of_encoded_value" --- -2.14.3 - diff --git a/gdb-rhbz1491128-batch-mode-exit-status-1of2.patch b/gdb-rhbz1491128-batch-mode-exit-status-1of2.patch new file mode 100644 index 0000000..8d97731 --- /dev/null +++ b/gdb-rhbz1491128-batch-mode-exit-status-1of2.patch @@ -0,0 +1,323 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Gary Benson +Date: Wed, 29 Aug 2018 16:11:50 +0100 +Subject: gdb-rhbz1491128-batch-mode-exit-status-1of2.patch + +;; Fix for 'gdb in batch mode always exit with status 0' (Gary Benson) +;; RHBZ #1491128 + +Indicate batch mode failures by exiting with nonzero status + +This commit causes GDB in batch mode to exit with nonzero status +if the last command to be executed fails. + +gdb/ChangeLog: + + PR gdb/13000: + * gdb/main.c (captured_main_1): Exit with nonzero status + in batch mode if the last command to be executed failed. + * NEWS: Mention the above. + +gdb/testsuite/ChangeLog: + + PR gdb/13000: + * gdb.base/batch-exit-status.exp: New file. + * gdb.base/batch-exit-status.good-commands: Likewise. + * gdb.base/batch-exit-status.bad-commands: Likewise. + +diff --git a/gdb/ChangeLog b/gdb/ChangeLog +--- a/gdb/ChangeLog ++++ b/gdb/ChangeLog +@@ -1,3 +1,10 @@ ++2018-08-16 Gary Benson ++ ++ PR gdb/13000: ++ * gdb/main.c (captured_main_1): Exit with nonzero status ++ in batch mode if the last command to be executed failed. ++ * NEWS: Mention the above. ++ + 2018-08-03 Sergio Durigan Junior + + * ser-tcp.c (net_open): Fix thinko when deciding whether to +diff --git a/gdb/NEWS b/gdb/NEWS +--- a/gdb/NEWS ++++ b/gdb/NEWS +@@ -7,6 +7,9 @@ + can be passed using the '[ADDRESS]:PORT' notation, or the regular + 'ADDRESS:PORT' method. + ++* GDB in batch mode now exits with status 1 if the last command to be ++ executed failed. ++ + *** Changes in GDB 8.2 + + * The 'set disassembler-options' command now supports specifying options +diff --git a/gdb/main.c b/gdb/main.c +--- a/gdb/main.c ++++ b/gdb/main.c +@@ -518,6 +518,7 @@ captured_main_1 (struct captured_main_args *context, int &python_script) + int i; + int save_auto_load; + struct objfile *objfile; ++ int ret = 1; + + #ifdef HAVE_SBRK + /* Set this before constructing scoped_command_stats. */ +@@ -1051,7 +1052,7 @@ captured_main_1 (struct captured_main_args *context, int &python_script) + processed; it sets global parameters, which are independent of + what file you are debugging or what directory you are in. */ + if (system_gdbinit && !inhibit_gdbinit) +- catch_command_errors (source_script, system_gdbinit, 0); ++ ret = catch_command_errors (source_script, system_gdbinit, 0); + + /* Read and execute $HOME/.gdbinit file, if it exists. This is done + *before* all the command line arguments are processed; it sets +@@ -1059,7 +1060,7 @@ captured_main_1 (struct captured_main_args *context, int &python_script) + debugging or what directory you are in. */ + + if (home_gdbinit && !inhibit_gdbinit && !inhibit_home_gdbinit) +- catch_command_errors (source_script, home_gdbinit, 0); ++ ret = catch_command_errors (source_script, home_gdbinit, 0); + + /* Process '-ix' and '-iex' options early. */ + for (i = 0; i < cmdarg_vec.size (); i++) +@@ -1069,12 +1070,12 @@ captured_main_1 (struct captured_main_args *context, int &python_script) + switch (cmdarg_p.type) + { + case CMDARG_INIT_FILE: +- catch_command_errors (source_script, cmdarg_p.string, +- !batch_flag); ++ ret = catch_command_errors (source_script, cmdarg_p.string, ++ !batch_flag); + break; + case CMDARG_INIT_COMMAND: +- catch_command_errors (execute_command, cmdarg_p.string, +- !batch_flag); ++ ret = catch_command_errors (execute_command, cmdarg_p.string, ++ !batch_flag); + break; + } + } +@@ -1082,11 +1083,11 @@ captured_main_1 (struct captured_main_args *context, int &python_script) + /* Now perform all the actions indicated by the arguments. */ + if (cdarg != NULL) + { +- catch_command_errors (cd_command, cdarg, 0); ++ ret = catch_command_errors (cd_command, cdarg, 0); + } + + for (i = 0; i < dirarg.size (); i++) +- catch_command_errors (directory_switch, dirarg[i], 0); ++ ret = catch_command_errors (directory_switch, dirarg[i], 0); + + /* Skip auto-loading section-specified scripts until we've sourced + local_gdbinit (which is often used to augment the source search +@@ -1115,19 +1116,19 @@ captured_main_1 (struct captured_main_args *context, int &python_script) + 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); + } + else + { + if (execarg != NULL) +- catch_command_errors (exec_file_attach, execarg, +- !batch_flag); ++ ret = catch_command_errors (exec_file_attach, execarg, ++ !batch_flag); + if (symarg != NULL) +- catch_command_errors (symbol_file_add_main_adapter, symarg, +- !batch_flag); ++ ret = catch_command_errors (symbol_file_add_main_adapter, ++ symarg, !batch_flag); + } + + if (corearg && pidarg) +@@ -1135,9 +1136,14 @@ captured_main_1 (struct captured_main_args *context, int &python_script) + "a core file at the same time.")); + + if (corearg != NULL) +- catch_command_errors (core_file_command, corearg, !batch_flag); ++ { ++ ret = catch_command_errors (core_file_command, corearg, ++ !batch_flag); ++ } + else if (pidarg != NULL) +- catch_command_errors (attach_command, pidarg, !batch_flag); ++ { ++ ret = catch_command_errors (attach_command, pidarg, !batch_flag); ++ } + else if (pid_or_core_arg) + { + /* The user specified 'gdb program pid' or gdb program core'. +@@ -1146,17 +1152,23 @@ captured_main_1 (struct captured_main_args *context, int &python_script) + + if (isdigit (pid_or_core_arg[0])) + { +- if (catch_command_errors (attach_command, pid_or_core_arg, +- !batch_flag) == 0 ++ ret = catch_command_errors (attach_command, pid_or_core_arg, ++ !batch_flag); ++ 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); ++ } ++ else ++ { ++ /* Can't be a pid, better be a corefile. */ ++ ret = catch_command_errors (core_file_command, ++ pid_or_core_arg, ++ !batch_flag); + } +- else /* Can't be a pid, better be a corefile. */ +- catch_command_errors (core_file_command, pid_or_core_arg, +- !batch_flag); + } + + if (ttyarg != NULL) +@@ -1180,7 +1192,7 @@ captured_main_1 (struct captured_main_args *context, int &python_script) + { + auto_load_local_gdbinit_loaded = 1; + +- catch_command_errors (source_script, local_gdbinit, 0); ++ ret = catch_command_errors (source_script, local_gdbinit, 0); + } + } + +@@ -1200,12 +1212,12 @@ captured_main_1 (struct captured_main_args *context, int &python_script) + switch (cmdarg_p.type) + { + case CMDARG_FILE: +- catch_command_errors (source_script, cmdarg_p.string, +- !batch_flag); ++ ret = catch_command_errors (source_script, cmdarg_p.string, ++ !batch_flag); + break; + case CMDARG_COMMAND: +- catch_command_errors (execute_command, cmdarg_p.string, +- !batch_flag); ++ ret = catch_command_errors (execute_command, cmdarg_p.string, ++ !batch_flag); + break; + } + } +@@ -1217,8 +1229,11 @@ captured_main_1 (struct captured_main_args *context, int &python_script) + + if (batch_flag) + { ++ int error_status = EXIT_FAILURE; ++ int *exit_arg = ret == 0 ? &error_status : NULL; ++ + /* We have hit the end of the batch file. */ +- quit_force (NULL, 0); ++ quit_force (exit_arg, 0); + } + } + +diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog +--- a/gdb/testsuite/ChangeLog ++++ b/gdb/testsuite/ChangeLog +@@ -1,3 +1,10 @@ ++2018-08-16 Gary Benson ++ ++ PR gdb/13000: ++ * gdb.base/batch-exit-status.exp: New file. ++ * gdb.base/batch-exit-status.good-commands: Likewise. ++ * gdb.base/batch-exit-status.bad-commands: Likewise. ++ + 2018-07-11 Sergio Durigan Junior + Jan Kratochvil + Paul Fertser +diff --git a/gdb/testsuite/gdb.base/batch-exit-status.bad-commands b/gdb/testsuite/gdb.base/batch-exit-status.bad-commands +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/batch-exit-status.bad-commands +@@ -0,0 +1 @@ ++bork +diff --git a/gdb/testsuite/gdb.base/batch-exit-status.exp b/gdb/testsuite/gdb.base/batch-exit-status.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/batch-exit-status.exp +@@ -0,0 +1,63 @@ ++# Copyright (C) 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 . ++ ++# Check that "gdb -batch" exits with appropriate status. ++ ++standard_testfile ++ ++set good_commands "$srcdir/$subdir/batch-exit-status.good-commands" ++set bad_commands "$srcdir/$subdir/batch-exit-status.bad-commands" ++ ++proc _test_exit_status {expect_status cmdline_opts} { ++ global gdb_spawn_id ++ ++ gdb_exit ++ if {[gdb_spawn_with_cmdline_opts $cmdline_opts] != 0} { ++ fail "spawn" ++ return ++ } ++ ++ set result [wait -i $gdb_spawn_id] ++ verbose $result ++ gdb_assert { [lindex $result 2] == 0 } ++ set actual_status [lindex $result 3] ++ gdb_assert { $actual_status == $expect_status } ++} ++ ++proc test_exit_status {expect_status cmdline_opts} { ++ with_test_prefix $cmdline_opts { ++ _test_exit_status $expect_status $cmdline_opts ++ } ++} ++ ++# gdb -batch with nothing to do should exit 0. ++test_exit_status 0 "-batch" ++ ++# Bad command-line options should cause exit 1. ++test_exit_status 1 "-batch -jslkflsdjlkfjlksdjf" ++ ++# gdb -batch with good commands should exit 0. ++test_exit_status 0 "-batch -ex \"info source\"" ++test_exit_status 0 "-batch -x $good_commands" ++ ++# gdb -batch with bad commands should exit 1. ++test_exit_status 1 "-batch -ex \"set not-a-thing 4\"" ++test_exit_status 1 "-batch -x $bad_commands" ++ ++# Success or failure of the last thing determines the exit code. ++test_exit_status 0 "-batch -ex \"set not-a-thing 4\" -x $good_commands" ++test_exit_status 0 "-batch -x $bad_commands -ex \"info source\"" ++test_exit_status 1 "-batch -x $good_commands -x $bad_commands" ++test_exit_status 1 "-batch -x $good_commands -ex \"set not-a-thing 4\"" +diff --git a/gdb/testsuite/gdb.base/batch-exit-status.good-commands b/gdb/testsuite/gdb.base/batch-exit-status.good-commands +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/batch-exit-status.good-commands +@@ -0,0 +1 @@ ++info mem diff --git a/gdb-rhbz1491128-batch-mode-exit-status-2of2.patch b/gdb-rhbz1491128-batch-mode-exit-status-2of2.patch new file mode 100644 index 0000000..9a0210f --- /dev/null +++ b/gdb-rhbz1491128-batch-mode-exit-status-2of2.patch @@ -0,0 +1,65 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Gary Benson +Date: Mon, 3 Sep 2018 16:14:55 +0100 +Subject: gdb-rhbz1491128-batch-mode-exit-status-2of2.patch + +;; Fix for 'gdb in batch mode always exit with status 0' (Gary Benson) +;; RHBZ #1491128 + +Fix batch exit status test failure on Fedora 28 + +This commit adds calls to remote_close and clear_gdb_spawn_id to +gdb.base/batch-exit-status.exp, fixing failures reported by buildbot +on Fedora 28 where gdb_spawn_id not being reset by the previous test +caused default_gdb_spawn to return without spawning. + +This commit also changes the test to use detect GDB's exit using +gdb_test_multiple expecting 'eof', rather than using 'wait -i' alone. +This means the testcase won't hang forever on failure as fixed in +gdb.base/quit.exp by commit 15763a09d4ae ("Fix 'gdb.base/quit.exp +hangs forever' if the test fails"). + +gdb/testsuite/ChangeLog: + + * gdb.base/batch-exit-status.exp: Use gdb_test_multiple and expect + 'eof' before 'wait -i'. Use remote_close and clear_gdb_spawn_id. + +diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog +--- a/gdb/testsuite/ChangeLog ++++ b/gdb/testsuite/ChangeLog +@@ -1,3 +1,8 @@ ++2018-09-04 Gary Benson ++ ++ * gdb.base/batch-exit-status.exp: Use gdb_test_multiple and expect ++ 'eof' before 'wait -i'. Use remote_close and clear_gdb_spawn_id. ++ + 2018-08-16 Gary Benson + + PR gdb/13000: +diff --git a/gdb/testsuite/gdb.base/batch-exit-status.exp b/gdb/testsuite/gdb.base/batch-exit-status.exp +--- a/gdb/testsuite/gdb.base/batch-exit-status.exp ++++ b/gdb/testsuite/gdb.base/batch-exit-status.exp +@@ -29,11 +29,18 @@ proc _test_exit_status {expect_status cmdline_opts} { + return + } + +- set result [wait -i $gdb_spawn_id] +- verbose $result +- gdb_assert { [lindex $result 2] == 0 } +- set actual_status [lindex $result 3] +- gdb_assert { $actual_status == $expect_status } ++ gdb_test_multiple "" "run til exit" { ++ eof { ++ set result [wait -i $gdb_spawn_id] ++ verbose $result ++ ++ gdb_assert { [lindex $result 2] == 0 } ++ gdb_assert { [lindex $result 3] == $expect_status } ++ ++ remote_close host ++ clear_gdb_spawn_id ++ } ++ } + } + + proc test_exit_status {expect_status cmdline_opts} { diff --git a/gdb-rhbz1540559-gdbaddindex-glibcdebug-regression.patch b/gdb-rhbz1540559-gdbaddindex-glibcdebug-regression.patch deleted file mode 100644 index ef756fe..0000000 --- a/gdb-rhbz1540559-gdbaddindex-glibcdebug-regression.patch +++ /dev/null @@ -1,135 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Sun, 4 Feb 2018 20:55:04 +0100 -Subject: gdb-rhbz1540559-gdbaddindex-glibcdebug-regression.patch - -FileName: gdb-rhbz1540559-gdbaddindex-glibcdebug-regression.patch - -;; Fix -D_GLIBCXX_DEBUG gdb-add-index regression (RH BZ 1540559). - -gdb: Out-of-bounds vector access while running gdb-add-index -https://bugzilla.redhat.com/show_bug.cgi?id=1540559 - -Fedora Rawhide started to use -D_GLIBCXX_DEBUG which made gdb-add-index -failing. - -/usr/include/c++/7/debug/safe_iterator.h:270: -Error: attempt to dereference a past-the-end iterator. -Objects involved in the operation: - iterator "this" @ 0x0x7fffffffcb90 { - type = __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator > > >, std::__debug::vector > > > (mutable iterator); - state = past-the-end; - references sequence with type 'std::__debug::vector > >' @ 0x0x7fffffffcc50 - } - -/usr/include/c++/7/debug/vector:417: -Error: attempt to subscript container with out-of-bounds index 556, but -container only holds 556 elements. -Objects involved in the operation: - sequence "this" @ 0x0x2e87af8 { - type = std::__debug::vector >; - } - -I do not know if anyone regression-tests GDB with -D_GLIBCXX_DEBUG, -I have just checked -D_GLIBCXX_DEBUG run against gdb-add-index. - -The two -D_GLIBCXX_DEBUG regressions were made by: - -commit bc8f2430e08cc2a520db49a42686e0529be4a3bc -Author: Jan Kratochvil -Date: Mon Jun 12 16:29:53 2017 +0100 - Code cleanup: C++ify .gdb_index producer - -commit af5bf4ada48ff65b6658be1fab8f9c8f8ab5f319 -Author: Simon Marchi -Date: Sat Oct 14 08:06:29 2017 -0400 - Replace psymbol_allocation_list with std::vector - -gdb/ChangeLog -2018-02-04 Jan Kratochvil - - * dwarf2read.c (data_buf::grow) (write_one_signatured_type) - (recursively_write_psymbols) (debug_names::recursively_write_psymbols) - (debug_names::write_one_signatured_type): Fix -D_GLIBCXX_DEBUG - regression. ---- - gdb/dwarf2read.c | 22 +++++++++++++--------- - 1 file changed, 13 insertions(+), 9 deletions(-) - -diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 64329af71e..3c9b9dc188 100644 ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -25696,7 +25696,7 @@ private: - gdb_byte *grow (size_t size) - { - m_vec.resize (m_vec.size () + size); -- return &*m_vec.end () - size; -+ return &*(m_vec.end () - size); - } - - gdb::byte_vector m_vec; -@@ -26130,12 +26130,14 @@ write_one_signatured_type (void **slot, void *d) - - write_psymbols (info->symtab, - info->psyms_seen, -- &info->objfile->global_psymbols[psymtab->globals_offset], -+ (info->objfile->global_psymbols.data() -+ + psymtab->globals_offset), - psymtab->n_global_syms, info->cu_index, - 0); - write_psymbols (info->symtab, - info->psyms_seen, -- &info->objfile->static_psymbols[psymtab->statics_offset], -+ (info->objfile->static_psymbols.data() -+ + psymtab->statics_offset), - psymtab->n_static_syms, info->cu_index, - 1); - -@@ -26185,12 +26187,12 @@ recursively_write_psymbols (struct objfile *objfile, - - write_psymbols (symtab, - psyms_seen, -- &objfile->global_psymbols[psymtab->globals_offset], -+ objfile->global_psymbols.data() + psymtab->globals_offset, - psymtab->n_global_syms, cu_index, - 0); - write_psymbols (symtab, - psyms_seen, -- &objfile->static_psymbols[psymtab->statics_offset], -+ objfile->static_psymbols.data() + psymtab->statics_offset, - psymtab->n_static_syms, cu_index, - 1); - } -@@ -26379,10 +26381,10 @@ public: - psyms_seen, cu_index); - - write_psymbols (psyms_seen, -- &objfile->global_psymbols[psymtab->globals_offset], -+ objfile->global_psymbols.data() + psymtab->globals_offset, - psymtab->n_global_syms, cu_index, false, unit_kind::cu); - write_psymbols (psyms_seen, -- &objfile->static_psymbols[psymtab->statics_offset], -+ objfile->static_psymbols.data() + psymtab->statics_offset, - psymtab->n_static_syms, cu_index, true, unit_kind::cu); - } - -@@ -26738,11 +26740,13 @@ private: - struct partial_symtab *psymtab = entry->per_cu.v.psymtab; - - write_psymbols (info->psyms_seen, -- &info->objfile->global_psymbols[psymtab->globals_offset], -+ (info->objfile->global_psymbols.data() -+ + psymtab->globals_offset), - psymtab->n_global_syms, info->cu_index, false, - unit_kind::tu); - write_psymbols (info->psyms_seen, -- &info->objfile->static_psymbols[psymtab->statics_offset], -+ (info->objfile->static_psymbols.data() -+ + psymtab->statics_offset), - psymtab->n_static_syms, info->cu_index, true, - unit_kind::tu); - --- -2.14.3 - diff --git a/gdb-rhbz1553104-s390x-arch12-test.patch b/gdb-rhbz1553104-s390x-arch12-test.patch new file mode 100644 index 0000000..d094b8d --- /dev/null +++ b/gdb-rhbz1553104-s390x-arch12-test.patch @@ -0,0 +1,81 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Jan Kratochvil +Date: Fri, 23 Mar 2018 20:42:44 +0100 +Subject: gdb-rhbz1553104-s390x-arch12-test.patch + +;; [s390x] Backport arch12 instructions decoding (RH BZ 1553104). +;; =fedoratest + +diff --git a/gdb/testsuite/gdb.arch/s390x-arch12.S b/gdb/testsuite/gdb.arch/s390x-arch12.S +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/s390x-arch12.S +@@ -0,0 +1,4 @@ ++.text ++.globl load_guarded ++load_guarded: ++.byte 0xeb,0xbf,0xf0,0x58,0x00,0x24,0xe3,0xf0,0xff,0x50,0xff,0x71,0xb9,0x04,0x00,0xbf,0xe3,0x20,0xb0,0xa0,0x00,0x24,0xe3,0x10,0xb0,0xa0,0x00,0x04,0xe3,0x10,0x10,0x00,0x00,0x4c,0xe3,0x10,0xb0,0xa8,0x00,0x24,0xe3,0x10,0xb0,0xa8,0x00,0x04,0xb9,0x04,0x00,0x21,0xe3,0x40,0xb1,0x20,0x00,0x04,0xeb,0xbf,0xb1,0x08,0x00,0x04,0x07,0xf4 +diff --git a/gdb/testsuite/gdb.arch/s390x-arch12.exp b/gdb/testsuite/gdb.arch/s390x-arch12.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/s390x-arch12.exp +@@ -0,0 +1,34 @@ ++# 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 . ++ ++#if { ![istarget s390x-*linux-*] || ![is_lp64_target] } { ++# verbose "Skipping s390x-prologue-skip.exp" ++# return ++#} ++ ++set testfile "s390x-arch12" ++set uufile "${srcdir}/${subdir}/${testfile}.o.uu" ++set ofile "${srcdir}/${subdir}/${testfile}.o" ++ ++if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } { ++ untested "failed uudecode" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_load $ofile ++ ++gdb_test "disas load_guarded" " <\\+28>:\tlgg\t%r1,0\\(%r1\\)\r\n\[^\r\n\]* <\\+34>:\tstg\t%r1,168\\(%r11\\)\r\n.*" +diff --git a/gdb/testsuite/gdb.arch/s390x-arch12.o.uu b/gdb/testsuite/gdb.arch/s390x-arch12.o.uu +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/s390x-arch12.o.uu +@@ -0,0 +1,20 @@ ++begin 644 s390x-arch12.o ++M?T5,1@("`0`````````````!`!8````!```````````````````````````` ++M``$X``````!```````!```<`!.N_\%@`)./P_U#_<;D$`+_C(+"@`"3C$+"@ ++M``3C$!```$SC$+"H`"3C$+"H``2Y!``AXT"Q(``$Z[^Q"``$!_0`+G-Y;71A ++M8@`N Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: Expand bitpos and type.length to LONGEST and ULONGEST - -FileName: gdb-rhbz795424-bitpos-20of25.patch +Subject: gdb-rhbz795424-bitpos-20of25.patch ;; Fix `GDB cannot access struct member whose offset is larger than 256MB' ;; (RH BZ 795424). @@ -471,108 +469,20 @@ gdb/testsuite/ChangeLog: Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-main.patch ---- - gdb/aarch64-linux-nat.c | 2 +- - gdb/ada-lang.c | 105 +++++++++++++++++++++------------------- - gdb/ada-lang.h | 6 +-- - gdb/ada-typeprint.c | 7 +-- - gdb/ada-valprint.c | 39 +++++++-------- - gdb/amd64-tdep.c | 8 +-- - gdb/annotate.c | 8 +-- - gdb/annotate.h | 4 +- - gdb/arch-utils.c | 2 +- - gdb/arch-utils.h | 2 +- - gdb/arm-linux-nat.c | 2 +- - gdb/ax-gdb.c | 30 ++++++------ - gdb/ax-general.c | 2 +- - gdb/ax.h | 2 +- - gdb/breakpoint.c | 8 +-- - gdb/breakpoint.h | 4 +- - gdb/c-lang.c | 6 +-- - gdb/c-lang.h | 4 +- - gdb/c-typeprint.c | 7 +-- - gdb/c-valprint.c | 10 ++-- - gdb/compile/compile-c-support.c | 4 +- - gdb/cp-abi.c | 6 +-- - gdb/cp-abi.h | 20 ++++---- - gdb/cp-valprint.c | 2 +- - gdb/d-lang.h | 2 +- - gdb/d-valprint.c | 2 +- - gdb/dwarf2loc.c | 18 +++---- - gdb/dwarf2read.c | 12 ++--- - gdb/eval.c | 15 +++--- - gdb/f-lang.c | 2 +- - gdb/f-lang.h | 2 +- - gdb/f-valprint.c | 14 +++--- - gdb/findvar.c | 6 +-- - gdb/frame.c | 4 +- - gdb/frame.h | 2 +- - gdb/gdbarch.c | 2 +- - gdb/gdbarch.h | 4 +- - gdb/gdbarch.sh | 2 +- - gdb/gdbtypes.c | 14 +++--- - gdb/gdbtypes.h | 6 +-- - gdb/gnu-v2-abi.c | 9 ++-- - gdb/gnu-v3-abi.c | 14 +++--- - gdb/go-lang.h | 2 +- - gdb/go-valprint.c | 2 +- - gdb/i386-tdep.c | 2 +- - gdb/language.c | 4 +- - gdb/language.h | 4 +- - gdb/m2-lang.c | 10 ++-- - gdb/m2-lang.h | 2 +- - gdb/m2-typeprint.c | 9 ++-- - gdb/m2-valprint.c | 16 +++--- - gdb/memrange.c | 4 +- - gdb/memrange.h | 8 +-- - gdb/mips-linux-nat.c | 2 +- - gdb/nat/x86-dregs.c | 4 +- - gdb/nat/x86-dregs.h | 2 +- - gdb/opencl-lang.c | 26 +++++----- - gdb/p-lang.c | 14 +++--- - gdb/p-lang.h | 6 +-- - gdb/p-valprint.c | 6 +-- - gdb/ppc-linux-nat.c | 2 +- - gdb/ppc-linux-tdep.c | 2 +- - gdb/printcmd.c | 4 +- - gdb/procfs.c | 2 +- - gdb/regcache.c | 19 ++++---- - gdb/regcache.h | 23 ++++----- - gdb/remote.c | 2 +- - gdb/rust-lang.c | 4 +- - gdb/s390-linux-nat.c | 2 +- - gdb/spu-multiarch.c | 2 +- - gdb/stack.c | 10 ++-- - gdb/symmisc.c | 6 +-- - gdb/target-delegates.c | 6 +-- - gdb/target.c | 4 +- - gdb/target.h | 2 +- - gdb/tracepoint.c | 32 ++++++------ - gdb/tracepoint.h | 2 +- - gdb/valarith.c | 12 ++--- - gdb/valops.c | 18 +++---- - gdb/valprint.c | 18 +++---- - gdb/valprint.h | 8 +-- - gdb/value.c | 10 ++-- - gdb/value.h | 15 +++--- - gdb/x86-nat.c | 2 +- - 84 files changed, 385 insertions(+), 365 deletions(-) diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c -index 9385659f14..08e6f4d4fd 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c -@@ -708,7 +708,7 @@ aarch64_linux_remove_watchpoint (struct target_ops *self, +@@ -808,7 +808,7 @@ aarch64_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len, + /* Implement the "region_ok_for_hw_watchpoint" target_ops method. */ - static int - aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self, -- CORE_ADDR addr, int len) -+ CORE_ADDR addr, LONGEST len) + int +-aarch64_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) ++aarch64_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { return aarch64_linux_region_ok_for_watchpoint (addr, len); } diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c -index 6395184956..8d25fdb4c6 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -78,7 +78,7 @@ static struct type *desc_bounds_type (struct type *); @@ -636,9 +546,9 @@ index 6395184956..8d25fdb4c6 100644 +static int find_struct_field (const char *, struct type *, LONGEST, + struct type **, LONGEST *, int *, int *, int *); - static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR, - struct value *); -@@ -237,7 +238,7 @@ static int ada_is_direct_array_type (struct type *); + static int ada_resolve_function (struct block_symbol *, int, + struct value **, int, const char *, +@@ -234,7 +235,7 @@ static int ada_is_direct_array_type (struct type *); static void ada_language_arch_info (struct gdbarch *, struct language_arch_info *); @@ -647,7 +557,7 @@ index 6395184956..8d25fdb4c6 100644 struct type *); static struct value *assign_aggregate (struct value *, struct value *, -@@ -700,7 +701,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) +@@ -697,7 +698,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) } static const gdb_byte * @@ -656,7 +566,7 @@ index 6395184956..8d25fdb4c6 100644 { if (valaddr == NULL) return NULL; -@@ -709,7 +710,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) +@@ -706,7 +707,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) } static CORE_ADDR @@ -665,7 +575,7 @@ index 6395184956..8d25fdb4c6 100644 { if (address == 0) return 0; -@@ -1747,7 +1748,7 @@ desc_bounds (struct value *arr) +@@ -1743,7 +1744,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. */ @@ -674,7 +584,7 @@ index 6395184956..8d25fdb4c6 100644 fat_pntr_bounds_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 1); -@@ -1813,7 +1814,7 @@ desc_data (struct value *arr) +@@ -1809,7 +1810,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. */ @@ -683,7 +593,7 @@ index 6395184956..8d25fdb4c6 100644 fat_pntr_data_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 0); -@@ -1848,7 +1849,7 @@ desc_one_bound (struct value *bounds, int i, int which) +@@ -1844,7 +1845,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. */ @@ -692,7 +602,7 @@ index 6395184956..8d25fdb4c6 100644 desc_bound_bitpos (struct type *type, int i, int which) { return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); -@@ -2038,7 +2039,7 @@ ada_type_of_array (struct value *arr, int bounds) +@@ -2034,7 +2035,7 @@ ada_type_of_array (struct value *arr, int bounds) zero, and does not need to be recomputed. */ if (lo < hi) { @@ -701,7 +611,7 @@ index 6395184956..8d25fdb4c6 100644 (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8; -@@ -2198,7 +2199,7 @@ decode_packed_array_bitsize (struct type *type) +@@ -2194,7 +2195,7 @@ decode_packed_array_bitsize (struct type *type) the length is arbitrary. */ static struct type * @@ -710,7 +620,7 @@ index 6395184956..8d25fdb4c6 100644 { struct type *new_elt_type; struct type *new_type; -@@ -2252,7 +2253,7 @@ decode_constrained_packed_array_type (struct type *type) +@@ -2248,7 +2249,7 @@ decode_constrained_packed_array_type (struct type *type) char *name; const char *tail; struct type *shadow_type; @@ -719,7 +629,7 @@ index 6395184956..8d25fdb4c6 100644 if (!raw_name) raw_name = ada_type_name (desc_base_type (type)); -@@ -2323,7 +2324,8 @@ decode_constrained_packed_array (struct value *arr) +@@ -2319,7 +2320,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. */ @@ -729,7 +639,7 @@ index 6395184956..8d25fdb4c6 100644 ULONGEST mod; mod = ada_modulus (value_type (arr)) - 1; -@@ -2551,7 +2553,7 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size, +@@ -2547,7 +2549,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, @@ -738,7 +648,7 @@ index 6395184956..8d25fdb4c6 100644 struct type *type) { struct value *v; -@@ -2621,7 +2623,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, +@@ -2617,7 +2619,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, if (obj != NULL) { @@ -747,7 +657,7 @@ index 6395184956..8d25fdb4c6 100644 set_value_component_location (v, obj); set_value_bitpos (v, bit_offset + value_bitpos (obj)); -@@ -2667,7 +2669,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, +@@ -2663,7 +2665,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, @@ -756,7 +666,7 @@ index 6395184956..8d25fdb4c6 100644 { unsigned int accum, mask; int accum_bits, chunk_size; -@@ -2757,7 +2759,7 @@ ada_value_assign (struct value *toval, struct value *fromval) +@@ -2753,7 +2755,7 @@ ada_value_assign (struct value *toval, struct value *fromval) { int len = (value_bitpos (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; @@ -765,7 +675,7 @@ index 6395184956..8d25fdb4c6 100644 gdb_byte *buffer = (gdb_byte *) alloca (len); struct value *val; CORE_ADDR to_addr = value_address (toval); -@@ -2808,7 +2810,7 @@ value_assign_to_component (struct value *container, struct value *component, +@@ -2804,7 +2806,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); @@ -774,7 +684,7 @@ index 6395184956..8d25fdb4c6 100644 val = value_cast (value_type (component), val); -@@ -4476,7 +4478,7 @@ ensure_lval (struct value *val) +@@ -4462,7 +4464,7 @@ ensure_lval (struct value *val) if (VALUE_LVAL (val) == not_lval || VALUE_LVAL (val) == lval_internalvar) { @@ -783,7 +693,7 @@ index 6395184956..8d25fdb4c6 100644 const CORE_ADDR addr = value_as_long (value_allocate_space_in_inferior (len)); -@@ -4560,7 +4562,7 @@ static CORE_ADDR +@@ -4546,7 +4548,7 @@ static CORE_ADDR value_pointer (struct value *value, struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); @@ -792,7 +702,7 @@ index 6395184956..8d25fdb4c6 100644 gdb_byte *buf = (gdb_byte *) alloca (len); CORE_ADDR addr; -@@ -6718,7 +6720,7 @@ value_tag_from_contents_and_address (struct type *type, +@@ -6657,7 +6659,7 @@ value_tag_from_contents_and_address (struct type *type, const gdb_byte *valaddr, CORE_ADDR address) { @@ -801,7 +711,7 @@ index 6395184956..8d25fdb4c6 100644 struct type *tag_type; if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, -@@ -7211,7 +7213,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) +@@ -7150,7 +7152,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 * @@ -810,7 +720,7 @@ index 6395184956..8d25fdb4c6 100644 struct type *arg_type) { struct type *type; -@@ -7223,7 +7225,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, +@@ -7162,7 +7164,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) { @@ -819,7 +729,7 @@ index 6395184956..8d25fdb4c6 100644 int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); return ada_value_primitive_packed_val (arg1, value_contents (arg1), -@@ -7300,9 +7302,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, +@@ -7239,9 +7241,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, Returns 1 if found, 0 otherwise. */ static int @@ -831,7 +741,7 @@ index 6395184956..8d25fdb4c6 100644 int *index_p) { int i; -@@ -7321,8 +7323,8 @@ find_struct_field (const char *name, struct type *type, int offset, +@@ -7260,8 +7262,8 @@ find_struct_field (const char *name, struct type *type, int offset, for (i = 0; i < TYPE_NFIELDS (type); i += 1) { @@ -842,7 +752,7 @@ index 6395184956..8d25fdb4c6 100644 const char *t_field_name = TYPE_FIELD_NAME (type, i); if (t_field_name == NULL) -@@ -7424,7 +7426,7 @@ num_visible_fields (struct type *type) +@@ -7363,7 +7365,7 @@ num_visible_fields (struct type *type) long explanation in find_struct_field's function documentation. */ static struct value * @@ -851,7 +761,7 @@ index 6395184956..8d25fdb4c6 100644 struct type *type) { int i; -@@ -7472,7 +7474,7 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, +@@ -7411,7 +7413,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)); @@ -860,7 +770,7 @@ index 6395184956..8d25fdb4c6 100644 for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) { -@@ -7504,8 +7506,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, +@@ -7443,8 +7445,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, return NULL; } @@ -871,7 +781,7 @@ index 6395184956..8d25fdb4c6 100644 /* Return field #INDEX in ARG, where the index is that returned by -@@ -7514,7 +7516,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, +@@ -7453,7 +7455,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, * If found, return value, else return NULL. */ static struct value * @@ -880,7 +790,7 @@ index 6395184956..8d25fdb4c6 100644 struct type *type) { return ada_index_struct_field_1 (&index, arg, offset, type); -@@ -7526,7 +7528,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, +@@ -7465,7 +7467,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, * *INDEX_P. */ static struct value * @@ -889,7 +799,7 @@ index 6395184956..8d25fdb4c6 100644 struct type *type) { int i; -@@ -7616,7 +7618,8 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err) +@@ -7555,7 +7557,8 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err) v = ada_search_struct_field (name, arg, 0, t); else { @@ -899,7 +809,7 @@ index 6395184956..8d25fdb4c6 100644 struct type *field_type; CORE_ADDR address; -@@ -7960,8 +7963,8 @@ ada_coerce_ref (struct value *val0) +@@ -7899,8 +7902,8 @@ ada_coerce_ref (struct value *val0) /* Return OFF rounded upward if necessary to a multiple of ALIGNMENT (a power of 2). */ @@ -910,7 +820,7 @@ index 6395184956..8d25fdb4c6 100644 { return (off + alignment - 1) & ~(alignment - 1); } -@@ -8355,10 +8358,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, +@@ -8290,10 +8293,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, struct value *mark = value_mark (); struct value *dval; struct type *rtype; @@ -923,7 +833,7 @@ index 6395184956..8d25fdb4c6 100644 int f; /* Compute the number of fields in this record type that are going -@@ -8436,7 +8438,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, +@@ -8370,7 +8372,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, that follow this one. */ if (ada_is_aligner_type (field_type)) { @@ -932,7 +842,7 @@ index 6395184956..8d25fdb4c6 100644 field_valaddr = cond_offset_host (field_valaddr, field_offset); field_address = cond_offset_target (field_address, field_offset); -@@ -8572,11 +8574,11 @@ ada_template_to_fixed_record_type_1 (struct type *type, +@@ -8506,11 +8508,11 @@ ada_template_to_fixed_record_type_1 (struct type *type, if (TYPE_LENGTH (type) <= 0) { if (TYPE_NAME (rtype)) @@ -948,7 +858,7 @@ index 6395184956..8d25fdb4c6 100644 } else { -@@ -9042,7 +9044,8 @@ to_fixed_array_type (struct type *type0, struct value *dval, +@@ -8974,7 +8976,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. */ @@ -959,10 +869,9 @@ index 6395184956..8d25fdb4c6 100644 TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0); diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h -index bac6c06e40..784e4935a3 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h -@@ -175,7 +175,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int, +@@ -173,7 +173,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int, extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, struct ui_file *stream); @@ -971,7 +880,7 @@ index bac6c06e40..784e4935a3 100644 struct ui_file *, int, struct value *, const struct value_print_options *); -@@ -190,7 +190,7 @@ extern void ada_emit_char (int, struct type *, struct ui_file *, int, int); +@@ -188,7 +188,7 @@ extern void ada_emit_char (int, struct type *, struct ui_file *, int, int); extern void ada_printchar (int, struct type *, struct ui_file *); extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *, @@ -980,7 +889,7 @@ index bac6c06e40..784e4935a3 100644 const struct value_print_options *); struct value *ada_convert_actual (struct value *actual, -@@ -262,7 +262,7 @@ extern int ada_is_constrained_packed_array_type (struct type *); +@@ -261,7 +261,7 @@ extern int ada_is_constrained_packed_array_type (struct type *); extern struct value *ada_value_primitive_packed_val (struct value *, const gdb_byte *, @@ -990,7 +899,6 @@ index bac6c06e40..784e4935a3 100644 extern struct type *ada_coerce_to_simple_array_type (struct type *); diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c -index 47ce897d01..9ef9b3c2f9 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -896,8 +896,8 @@ ada_print_type (struct type *type0, const char *varstring, @@ -1015,7 +923,6 @@ index 47ce897d01..9ef9b3c2f9 100644 case TYPE_CODE_ENUM: if (show < 0) diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c -index c5efdf1c1c..5912c6d016 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -34,11 +34,11 @@ @@ -1032,7 +939,7 @@ index c5efdf1c1c..5912c6d016 100644 const struct language_defn *); -@@ -280,7 +280,7 @@ ada_emit_char (int c, struct type *type, struct ui_file *stream, +@@ -316,7 +316,7 @@ ada_emit_char (int c, struct type *type, struct ui_file *stream, of a character. */ static int @@ -1041,7 +948,7 @@ index c5efdf1c1c..5912c6d016 100644 enum bfd_endian byte_order) { if (type_len == 1) -@@ -440,11 +440,11 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) +@@ -476,11 +476,11 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) static void printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, @@ -1055,7 +962,7 @@ index c5efdf1c1c..5912c6d016 100644 unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; -@@ -459,9 +459,9 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, +@@ -495,9 +495,9 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, { /* Position of the character we are examining to see whether it is repeated. */ @@ -1067,7 +974,7 @@ index c5efdf1c1c..5912c6d016 100644 QUIT; -@@ -492,7 +492,8 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, +@@ -528,7 +528,8 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, ada_emit_char (char_at (string, i, type_len, byte_order), elttype, stream, '\'', type_len); fputs_filtered ("'", stream); @@ -1077,7 +984,7 @@ index c5efdf1c1c..5912c6d016 100644 i = rep1 - 1; things_printed += options->repeat_count_threshold; need_comma = 1; -@@ -520,7 +521,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, +@@ -556,7 +557,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, void ada_printstr (struct ui_file *stream, struct type *type, @@ -1086,7 +993,7 @@ index c5efdf1c1c..5912c6d016 100644 const char *encoding, int force_ellipses, const struct value_print_options *options) { -@@ -530,12 +531,12 @@ ada_printstr (struct ui_file *stream, struct type *type, +@@ -566,12 +567,12 @@ ada_printstr (struct ui_file *stream, struct type *type, static int print_variant_part (struct type *type, int field_num, @@ -1101,7 +1008,7 @@ index c5efdf1c1c..5912c6d016 100644 const struct language_defn *language) { struct type *var_type = TYPE_FIELD_TYPE (type, field_num); -@@ -571,11 +572,11 @@ print_variant_part (struct type *type, int field_num, +@@ -607,11 +608,11 @@ print_variant_part (struct type *type, int field_num, static int print_field_values (struct type *type, const gdb_byte *valaddr, @@ -1115,7 +1022,7 @@ index c5efdf1c1c..5912c6d016 100644 const struct language_defn *language) { int i, len; -@@ -641,7 +642,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, +@@ -677,7 +678,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, else { struct value *v; @@ -1124,7 +1031,7 @@ index c5efdf1c1c..5912c6d016 100644 int bit_size = TYPE_FIELD_BITSIZE (type, i); struct value_print_options opts; -@@ -686,8 +687,8 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr, +@@ -722,8 +723,8 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr, { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); struct type *elttype = TYPE_TARGET_TYPE (type); @@ -1135,7 +1042,7 @@ index c5efdf1c1c..5912c6d016 100644 /* We know that ELTTYPE cannot possibly be null, because we assume that we're called only when TYPE is a string-like type. -@@ -706,7 +707,7 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr, +@@ -742,7 +743,7 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr, elements up to it. */ if (options->stop_print_at_null) { @@ -1144,7 +1051,7 @@ index c5efdf1c1c..5912c6d016 100644 /* Look for a NULL char. */ for (temp_len = 0; -@@ -1079,7 +1080,7 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr, +@@ -1115,7 +1116,7 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr, static void ada_val_print_1 (struct type *type, @@ -1153,7 +1060,7 @@ index c5efdf1c1c..5912c6d016 100644 struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options, -@@ -1163,7 +1164,7 @@ ada_val_print_1 (struct type *type, +@@ -1199,7 +1200,7 @@ ada_val_print_1 (struct type *type, void ada_val_print (struct type *type, @@ -1163,7 +1070,6 @@ index c5efdf1c1c..5912c6d016 100644 struct value *val, const struct value_print_options *options) diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c -index 7c70792b3f..651794a41f 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -727,7 +727,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, @@ -1175,24 +1081,20 @@ index 7c70792b3f..651794a41f 100644 static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM }; static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM }; int integer_reg = 0; -@@ -843,11 +843,13 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, - +@@ -844,10 +844,10 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, gdb_assert (regnum != -1); -+ LONGEST nlen = len < 8 ? len : 8; -+ if (readbuf) -- regcache_raw_read_part (regcache, regnum, offset, std::min (len, 8), -+ regcache_raw_read_part (regcache, regnum, offset, nlen, - readbuf + i * 8); +- regcache->raw_read_part (regnum, offset, std::min (len, 8), ++ regcache->raw_read_part (regnum, offset, std::min (len, (LONGEST) 8), + readbuf + i * 8); if (writebuf) -- regcache_raw_write_part (regcache, regnum, offset, std::min (len, 8), -+ regcache_raw_write_part (regcache, regnum, offset, nlen, - writebuf + i * 8); +- regcache->raw_write_part (regnum, offset, std::min (len, 8), ++ regcache->raw_write_part (regnum, offset, std::min (len, (LONGEST) 8), + writebuf + i * 8); } diff --git a/gdb/annotate.c b/gdb/annotate.c -index 0c70ff9553..6d169bfdae 100644 --- a/gdb/annotate.c +++ b/gdb/annotate.c @@ -531,21 +531,21 @@ annotate_frame_end (void) @@ -1222,7 +1124,6 @@ index 0c70ff9553..6d169bfdae 100644 void diff --git a/gdb/annotate.h b/gdb/annotate.h -index 1b9d9dd034..d79ccc56ed 100644 --- a/gdb/annotate.h +++ b/gdb/annotate.h @@ -102,8 +102,8 @@ extern void annotate_frame_source_end (void); @@ -1237,7 +1138,6 @@ index 1b9d9dd034..d79ccc56ed 100644 extern void annotate_elt (void); extern void annotate_array_section_end (void); diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c -index 693d7e3dc8..b701010019 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -228,7 +228,7 @@ legacy_virtual_frame_pointer (struct gdbarch *gdbarch, @@ -1250,7 +1150,6 @@ index 693d7e3dc8..b701010019 100644 const struct floatformat **format = NULL; diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h -index b51a4ec1ee..2d344e7b93 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -131,7 +131,7 @@ extern gdbarch_virtual_frame_pointer_ftype legacy_virtual_frame_pointer; @@ -1263,20 +1162,18 @@ index b51a4ec1ee..2d344e7b93 100644 extern CORE_ADDR generic_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc); diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c -index 484bd4e4c4..3b7aa40db8 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c -@@ -1067,7 +1067,7 @@ arm_linux_remove_hw_breakpoint (struct target_ops *self, +@@ -1098,7 +1098,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? */ - static int - arm_linux_region_ok_for_hw_watchpoint (struct target_ops *self, -- CORE_ADDR addr, int len) -+ CORE_ADDR addr, LONGEST len) + int +-arm_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) ++arm_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap (); CORE_ADDR max_wp_length, aligned_addr; diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c -index 9a44d4b750..9961d92042 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -82,12 +82,12 @@ static void gen_traced_pop (struct agent_expr *, struct axs_value *); @@ -1376,7 +1273,6 @@ index 9a44d4b750..9961d92042 100644 int i, rslt; int nbases = TYPE_N_BASECLASSES (type); diff --git a/gdb/ax-general.c b/gdb/ax-general.c -index 360e91bf31..0804f1f907 100644 --- a/gdb/ax-general.c +++ b/gdb/ax-general.c @@ -177,7 +177,7 @@ ax_zero_ext (struct agent_expr *x, int n) @@ -1389,7 +1285,6 @@ index 360e91bf31..0804f1f907 100644 /* N must fit in a byte. */ if (n < 0 || n > 255) diff --git a/gdb/ax.h b/gdb/ax.h -index 6066b77076..d1c9d35030 100644 --- a/gdb/ax.h +++ b/gdb/ax.h @@ -193,7 +193,7 @@ extern void ax_ext (struct agent_expr *EXPR, int N); @@ -1402,10 +1297,9 @@ index 6066b77076..d1c9d35030 100644 /* Append a goto op to EXPR. OP is the actual op (must be aop_goto or aop_if_goto). We assume we don't know the target offset yet, diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index 6a0c15b239..05d7ed3ea1 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -2064,9 +2064,9 @@ should_be_inserted (struct bp_location *bl) +@@ -2059,9 +2059,9 @@ should_be_inserted (struct bp_location *bl) { fprintf_unfiltered (gdb_stdlog, "infrun: stepping past non-steppable watchpoint. " @@ -1417,7 +1311,7 @@ index 6a0c15b239..05d7ed3ea1 100644 } return 0; } -@@ -6851,7 +6851,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1, +@@ -6822,7 +6822,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1, static int breakpoint_address_match_range (const address_space *aspace1, CORE_ADDR addr1, @@ -1426,7 +1320,7 @@ index 6a0c15b239..05d7ed3ea1 100644 CORE_ADDR addr2) { return ((gdbarch_has_global_breakpoints (target_gdbarch ()) -@@ -10978,7 +10978,7 @@ can_use_hardware_watchpoint (struct value *v) +@@ -10905,7 +10905,7 @@ can_use_hardware_watchpoint (const std::vector &vals) && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR vaddr = value_address (v); @@ -1436,7 +1330,6 @@ index 6a0c15b239..05d7ed3ea1 100644 len = (target_exact_watchpoints diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h -index 3fddbaa713..08463d4e5b 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -252,7 +252,7 @@ struct bp_target_info @@ -1458,10 +1351,9 @@ index 3fddbaa713..08463d4e5b 100644 /* Type of hardware watchpoint. */ target_hw_bp_type watchpoint_type {}; diff --git a/gdb/c-lang.c b/gdb/c-lang.c -index a0b553e741..0616208d1d 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c -@@ -184,7 +184,7 @@ c_printchar (int c, struct type *type, struct ui_file *stream) +@@ -185,7 +185,7 @@ c_printchar (int c, struct type *type, struct ui_file *stream) void c_printstr (struct ui_file *stream, struct type *type, @@ -1470,7 +1362,7 @@ index a0b553e741..0616208d1d 100644 const char *user_encoding, int force_ellipses, const struct value_print_options *options) { -@@ -666,7 +666,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, +@@ -664,7 +664,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, } else { @@ -1479,7 +1371,7 @@ index a0b553e741..0616208d1d 100644 /* Write the terminating character. */ for (i = 0; i < TYPE_LENGTH (type); ++i) -@@ -675,7 +675,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, +@@ -673,7 +673,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, if (satisfy_expected) { LONGEST low_bound, high_bound; @@ -1489,10 +1381,9 @@ index a0b553e741..0616208d1d 100644 if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type), &low_bound, &high_bound) < 0) diff --git a/gdb/c-lang.h b/gdb/c-lang.h -index 18dedcc1fa..8afd3ee784 100644 --- a/gdb/c-lang.h +++ b/gdb/c-lang.h -@@ -77,7 +77,7 @@ extern void c_print_typedef (struct type *, +@@ -82,7 +82,7 @@ extern void c_print_typedef (struct type *, struct ui_file *); extern void c_val_print (struct type *, @@ -1501,7 +1392,7 @@ index 18dedcc1fa..8afd3ee784 100644 struct ui_file *, int, struct value *, const struct value_print_options *); -@@ -97,7 +97,7 @@ extern void c_printchar (int, struct type *, struct ui_file *); +@@ -102,7 +102,7 @@ extern void c_printchar (int, struct type *, struct ui_file *); extern void c_printstr (struct ui_file * stream, struct type *elttype, const gdb_byte *string, @@ -1510,33 +1401,7 @@ index 18dedcc1fa..8afd3ee784 100644 const char *user_encoding, int force_ellipses, const struct value_print_options *options); -diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c -index 2e9ed1bc28..256b9c19e6 100644 ---- a/gdb/c-typeprint.c -+++ b/gdb/c-typeprint.c -@@ -933,7 +933,8 @@ c_print_type_union_field_offset (struct type *type, unsigned int field_idx, - { - struct type *ftype = check_typedef (TYPE_FIELD_TYPE (type, field_idx)); - -- fprintf_filtered (stream, "/* %4u */", TYPE_LENGTH (ftype)); -+ fprintf_filtered (stream, "/* %4s */", -+ pulongest (TYPE_LENGTH (ftype))); - } - - /* Print information about field at index FIELD_IDX of the struct type -@@ -1507,8 +1508,8 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream, - print_spaces_filtered_with_print_options (level + 4, - stream, - flags); -- fprintf_filtered (stream, "/* total size (bytes): %4u */\n", -- TYPE_LENGTH (type)); -+ fprintf_filtered (stream, "/* total size (bytes): %4s */\n", -+ pulongest (TYPE_LENGTH (type))); - } - - print_spaces_filtered (OFFSET_SPC_LEN, stream); diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c -index 3904fab260..a3b8e2551b 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -247,7 +247,7 @@ c_val_print_array (struct type *type, const gdb_byte *valaddr, @@ -1578,7 +1443,6 @@ index 3904fab260..a3b8e2551b 100644 struct value *original_value, const struct value_print_options *options) diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c -index 006d3f811c..accd9a54b2 100644 --- 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, @@ -1596,7 +1460,6 @@ index 006d3f811c..accd9a54b2 100644 fputs_unfiltered (";\n", stream); } diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c -index eb2f01444d..2f65bffa1d 100644 --- a/gdb/cp-abi.c +++ b/gdb/cp-abi.c @@ -64,12 +64,12 @@ is_operator_name (const char *name) @@ -1624,7 +1487,6 @@ index eb2f01444d..2f65bffa1d 100644 if ((current_cp_abi.virtual_fn_field) == NULL) return NULL; diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h -index 8f2e4d9a66..86490a2c46 100644 --- a/gdb/cp-abi.h +++ b/gdb/cp-abi.h @@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, @@ -1671,7 +1533,6 @@ index 8f2e4d9a66..86490a2c46 100644 struct type *type, struct ui_file *stream); diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c -index 486653f13f..db3ff338d1 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -335,7 +335,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, @@ -1684,10 +1545,9 @@ index 486653f13f..db3ff338d1 100644 if (valprint_check_validity (stream, i_type, i_offset, val)) diff --git a/gdb/d-lang.h b/gdb/d-lang.h -index 391ea8665b..a8e72ae506 100644 --- a/gdb/d-lang.h +++ b/gdb/d-lang.h -@@ -81,7 +81,7 @@ extern struct block_symbol d_lookup_nested_symbol (struct type *, const char *, +@@ -79,7 +79,7 @@ extern struct block_symbol d_lookup_nested_symbol (struct type *, const char *, /* Defined in d-valprint.c */ extern void d_val_print (struct type *type, @@ -1697,7 +1557,6 @@ index 391ea8665b..a8e72ae506 100644 struct value *val, const struct value_print_options *options); diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c -index e2d8431362..5143f75c06 100644 --- a/gdb/d-valprint.c +++ b/gdb/d-valprint.c @@ -73,7 +73,7 @@ dynamic_array_type (struct type *type, @@ -1710,7 +1569,6 @@ index e2d8431362..5143f75c06 100644 struct value *val, const struct value_print_options *options) diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index 5486e4dc12..1fe45f6069 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -1817,7 +1817,7 @@ rw_pieced_value (struct value *v, struct value *from) @@ -1774,10 +1632,9 @@ index 5486e4dc12..1fe45f6069 100644 if (subobj_byte_offset + len > max) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 6ebe00f542..fbaa0af64f 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -2268,12 +2268,12 @@ dwarf2_complex_location_expr_complaint (void) +@@ -2021,11 +2021,11 @@ dwarf2_complex_location_expr_complaint (void) } static void @@ -1786,15 +1643,14 @@ index 6ebe00f542..fbaa0af64f 100644 +dwarf2_const_value_length_mismatch_complaint (const char *arg1, LONGEST arg2, + LONGEST arg3) { - complaint (&symfile_complaints, -- _("const value length mismatch for '%s', got %d, expected %d"), +- complaint (_("const value length mismatch for '%s', got %d, expected %d"), - arg1, arg2, arg3); -+ _("const value length mismatch for '%s', got %s, expected %s"), ++ complaint (_("const value length mismatch for '%s', got %s, expected %s"), + arg1, plongest (arg2), plongest (arg3)); } static void -@@ -15084,8 +15084,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, +@@ -14953,8 +14953,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. */ @@ -1806,10 +1662,9 @@ index 6ebe00f542..fbaa0af64f 100644 attr = dwarf2_attr (die, DW_AT_byte_size, cu); if (attr) diff --git a/gdb/eval.c b/gdb/eval.c -index d9bca2791d..b42f14a406 100644 --- a/gdb/eval.c +++ b/gdb/eval.c -@@ -302,7 +302,8 @@ evaluate_struct_tuple (struct value *struct_val, +@@ -295,7 +295,8 @@ evaluate_struct_tuple (struct value *struct_val, while (--nargs >= 0) { struct value *val = NULL; @@ -1819,7 +1674,7 @@ index d9bca2791d..b42f14a406 100644 bfd_byte *addr; fieldno++; -@@ -363,7 +364,7 @@ init_array_element (struct value *array, struct value *element, +@@ -356,7 +357,7 @@ init_array_element (struct value *array, struct value *element, enum noside noside, LONGEST low_bound, LONGEST high_bound) { LONGEST index; @@ -1828,7 +1683,7 @@ index d9bca2791d..b42f14a406 100644 if (exp->elts[*pos].opcode == BINOP_COMMA) { -@@ -807,11 +808,11 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch, +@@ -800,11 +801,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); @@ -1843,7 +1698,7 @@ index d9bca2791d..b42f14a406 100644 int unsigned_operation; /* Determine type length and signedness after promotion for -@@ -1548,7 +1549,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1546,7 +1547,7 @@ evaluate_subexp_standard (struct type *expect_type, struct value **argvec; int code; int ix; @@ -1852,7 +1707,7 @@ index d9bca2791d..b42f14a406 100644 struct type **arg_types; pc = (*pos)++; -@@ -1731,7 +1732,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1729,7 +1730,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); @@ -1862,7 +1717,6 @@ index d9bca2791d..b42f14a406 100644 if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) diff --git a/gdb/f-lang.c b/gdb/f-lang.c -index 74f5622b6e..55fb97ceab 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -101,7 +101,7 @@ f_printchar (int c, struct type *type, struct ui_file *stream) @@ -1875,10 +1729,9 @@ index 74f5622b6e..55fb97ceab 100644 { const char *type_encoding = f_get_encoding (type); diff --git a/gdb/f-lang.h b/gdb/f-lang.h -index e9d0f3a857..9171a13bdf 100644 --- a/gdb/f-lang.h +++ b/gdb/f-lang.h -@@ -30,7 +30,7 @@ extern void f_yyerror (const char *); /* Defined in f-exp.y */ +@@ -28,7 +28,7 @@ extern int f_parse (struct parser_state *); extern void f_print_type (struct type *, const char *, struct ui_file *, int, int, const struct type_print_options *); @@ -1888,7 +1741,6 @@ index e9d0f3a857..9171a13bdf 100644 struct value *, const struct value_print_options *); diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c -index b4067a8460..0772f359f0 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -36,7 +36,7 @@ @@ -1948,7 +1800,6 @@ index b4067a8460..0772f359f0 100644 struct value *original_value, const struct value_print_options *options) diff --git a/gdb/findvar.c b/gdb/findvar.c -index ee8f57159d..fb4dfeca17 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -821,7 +821,7 @@ struct value * @@ -1979,10 +1830,9 @@ index ee8f57159d..fb4dfeca17 100644 /* If the register length is larger than the number of bytes remaining to copy, then only copy the appropriate bytes. */ diff --git a/gdb/frame.c b/gdb/frame.c -index 1384ecca4f..db52eb5780 100644 --- a/gdb/frame.c +++ b/gdb/frame.c -@@ -1386,7 +1386,7 @@ deprecated_frame_register_read (struct frame_info *frame, int regnum, +@@ -1396,7 +1396,7 @@ deprecated_frame_register_read (struct frame_info *frame, int regnum, int get_frame_register_bytes (struct frame_info *frame, int regnum, @@ -1991,7 +1841,7 @@ index 1384ecca4f..db52eb5780 100644 int *optimizedp, int *unavailablep) { struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -1415,7 +1415,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum, +@@ -1425,7 +1425,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum, } if (len > maxsize) error (_("Bad debug information detected: " @@ -2001,10 +1851,9 @@ index 1384ecca4f..db52eb5780 100644 /* Copy the data. */ while (len > 0) diff --git a/gdb/frame.h b/gdb/frame.h -index 8293a49ec2..a176873865 100644 --- a/gdb/frame.h +++ b/gdb/frame.h -@@ -601,7 +601,7 @@ extern void put_frame_register (struct frame_info *frame, int regnum, +@@ -620,7 +620,7 @@ extern void put_frame_register (struct frame_info *frame, int regnum, contents are optimized out or unavailable, set *OPTIMIZEDP, *UNAVAILABLEP accordingly. */ extern int get_frame_register_bytes (struct frame_info *frame, int regnum, @@ -2014,10 +1863,9 @@ index 8293a49ec2..a176873865 100644 int *optimizedp, int *unavailablep); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c -index fe3c12e295..f0cfb053b0 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c -@@ -1811,7 +1811,7 @@ set_gdbarch_wchar_signed (struct gdbarch *gdbarch, +@@ -1799,7 +1799,7 @@ set_gdbarch_wchar_signed (struct gdbarch *gdbarch, } const struct floatformat ** @@ -2027,10 +1875,9 @@ index fe3c12e295..f0cfb053b0 100644 gdb_assert (gdbarch != NULL); gdb_assert (gdbarch->floatformat_for_type != NULL); diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h -index 5664c4dc58..62b83974a1 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h -@@ -198,8 +198,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. */ @@ -2042,10 +1889,9 @@ index 5664c4dc58..62b83974a1 100644 /* For most targets, a pointer on the target and its representation as an diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh -index a929e13b81..cc1def6a3d 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh -@@ -388,7 +388,7 @@ v;int;wchar_signed;;;1;-1;1 +@@ -385,7 +385,7 @@ v;int;wchar_signed;;;1;-1;1 # Returns the floating-point format to be used for values of length LENGTH. # NAME, if non-NULL, is the type name, which may be used to distinguish # different target formats of the same length. @@ -2055,10 +1901,9 @@ index a929e13b81..cc1def6a3d 100755 # For most targets, a pointer on the target and its representation as an # address in GDB have the same size and "look the same". For such a diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c -index cb5524023f..7c2ae72cfc 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c -@@ -2920,7 +2920,7 @@ floatformat_from_type (const struct type *type) +@@ -2906,7 +2906,7 @@ floatformat_from_type (const struct type *type) least as long as OBJFILE. */ struct type * @@ -2067,7 +1912,7 @@ index cb5524023f..7c2ae72cfc 100644 const char *name) { struct type *type; -@@ -3252,8 +3252,8 @@ is_public_ancestor (struct type *base, struct type *dclass) +@@ -3360,8 +3360,8 @@ is_public_ancestor (struct type *base, struct type *dclass) static int is_unique_ancestor_worker (struct type *base, struct type *dclass, @@ -2078,7 +1923,7 @@ index cb5524023f..7c2ae72cfc 100644 CORE_ADDR address, struct value *val) { int i, count = 0; -@@ -3264,7 +3264,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, +@@ -3372,7 +3372,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; @@ -2087,7 +1932,7 @@ index cb5524023f..7c2ae72cfc 100644 iter = check_typedef (TYPE_BASECLASS (dclass, i)); -@@ -3305,7 +3305,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, +@@ -3413,7 +3413,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, int is_unique_ancestor (struct type *base, struct value *val) { @@ -2096,7 +1941,7 @@ index cb5524023f..7c2ae72cfc 100644 return is_unique_ancestor_worker (base, value_type (val), &offset, value_contents_for_printing (val), -@@ -4550,7 +4550,7 @@ recursive_dump_type (struct type *type, int spaces) +@@ -4642,7 +4642,7 @@ recursive_dump_type (struct type *type, int spaces) break; } puts_filtered ("\n"); @@ -2105,7 +1950,7 @@ index cb5524023f..7c2ae72cfc 100644 if (TYPE_OBJFILE_OWNED (type)) { printfi_filtered (spaces, "objfile "); -@@ -4991,7 +4991,7 @@ copy_type (const struct type *type) +@@ -5085,7 +5085,7 @@ copy_type (const struct type *type) struct type * arch_type (struct gdbarch *gdbarch, @@ -2115,10 +1960,9 @@ index cb5524023f..7c2ae72cfc 100644 struct type *type; diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h -index 5597038357..f6e0c3e8c1 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h -@@ -805,7 +805,7 @@ struct type +@@ -862,7 +862,7 @@ struct type type_length_units function should be used in order to get the length expressed in target addressable memory units. */ @@ -2127,7 +1971,7 @@ index 5597038357..f6e0c3e8c1 100644 /* * Core type, shared by a group of qualified types. */ -@@ -1707,7 +1707,7 @@ extern unsigned int type_length_units (struct type *type); +@@ -1783,7 +1783,7 @@ extern unsigned int type_length_units (struct type *type); /* * Helper function to construct objfile-owned types. */ @@ -2136,7 +1980,7 @@ index 5597038357..f6e0c3e8c1 100644 const char *); extern struct type *init_integer_type (struct objfile *, int, int, const char *); -@@ -1724,7 +1724,7 @@ extern struct type *init_pointer_type (struct objfile *, int, const char *, +@@ -1800,7 +1800,7 @@ extern struct type *init_pointer_type (struct objfile *, int, const char *, struct type *); /* Helper functions to construct architecture-owned types. */ @@ -2146,7 +1990,6 @@ index 5597038357..f6e0c3e8c1 100644 extern struct type *arch_integer_type (struct gdbarch *, int, int, const char *); diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c -index 8a64157c55..ef1f851a91 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -82,7 +82,7 @@ gnuv2_is_operator_name (const char *name) @@ -2187,7 +2030,6 @@ index 8a64157c55..ef1f851a91 100644 embedded_offset, address, val); diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c -index 0965846ce6..d443c29443 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -109,7 +109,7 @@ build_gdb_vtable_type (struct gdbarch *arch) @@ -2208,7 +2050,7 @@ index 0965846ce6..d443c29443 100644 vtable_address_point_offset (struct gdbarch *gdbarch) { struct type *vtable_type -@@ -408,7 +408,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, +@@ -409,7 +409,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, static struct value * gnuv3_virtual_fn_field (struct value **value_p, struct fn_field *f, int j, @@ -2217,7 +2059,7 @@ index 0965846ce6..d443c29443 100644 { struct type *values_type = check_typedef (value_type (*value_p)); struct gdbarch *gdbarch; -@@ -438,7 +438,7 @@ gnuv3_virtual_fn_field (struct value **value_p, +@@ -439,7 +439,7 @@ gnuv3_virtual_fn_field (struct value **value_p, -1 is returned on error. */ @@ -2226,7 +2068,7 @@ index 0965846ce6..d443c29443 100644 gnuv3_baseclass_offset (struct type *type, int index, const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) -@@ -447,7 +447,7 @@ gnuv3_baseclass_offset (struct type *type, int index, +@@ -448,7 +448,7 @@ gnuv3_baseclass_offset (struct type *type, int index, struct type *ptr_type; struct value *vtable; struct value *vbase_array; @@ -2235,7 +2077,7 @@ index 0965846ce6..d443c29443 100644 /* Determine architecture. */ gdbarch = get_type_arch (type); -@@ -470,7 +470,7 @@ gnuv3_baseclass_offset (struct type *type, int index, +@@ -471,7 +471,7 @@ gnuv3_baseclass_offset (struct type *type, int index, cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch); if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0) error (_("Misaligned vbase offset.")); @@ -2244,7 +2086,7 @@ index 0965846ce6..d443c29443 100644 vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset); gdb_assert (vtable != NULL); -@@ -514,7 +514,7 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, +@@ -515,7 +515,7 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, we're out of luck. */ for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) { @@ -2254,10 +2096,9 @@ index 0965846ce6..d443c29443 100644 if (BASETYPE_VIA_VIRTUAL (domain, i)) diff --git a/gdb/go-lang.h b/gdb/go-lang.h -index 84af9389e7..0691f3914e 100644 --- a/gdb/go-lang.h +++ b/gdb/go-lang.h -@@ -85,7 +85,7 @@ extern void go_print_type (struct type *type, const char *varstring, +@@ -83,7 +83,7 @@ extern void go_print_type (struct type *type, const char *varstring, /* Defined in go-valprint.c. */ extern void go_val_print (struct type *type, @@ -2267,7 +2108,6 @@ index 84af9389e7..0691f3914e 100644 struct value *val, const struct value_print_options *options); diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c -index eccf9a8181..4cca802e59 100644 --- a/gdb/go-valprint.c +++ b/gdb/go-valprint.c @@ -86,7 +86,7 @@ print_go_string (struct type *type, @@ -2280,10 +2120,9 @@ index eccf9a8181..4cca802e59 100644 struct value *val, const struct value_print_options *options) diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c -index d1b461b538..af4942ab2e 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c -@@ -8175,7 +8175,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, @@ -2293,10 +2132,9 @@ index d1b461b538..af4942ab2e 100644 if (len == 128 && name) if (strcmp (name, "__float128") == 0 diff --git a/gdb/language.c b/gdb/language.c -index 0d8604b826..7dca669b40 100644 --- a/gdb/language.c +++ b/gdb/language.c -@@ -773,7 +773,7 @@ unk_lang_printchar (int c, struct type *type, struct ui_file *stream) +@@ -766,7 +766,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, @@ -2305,7 +2143,7 @@ index 0d8604b826..7dca669b40 100644 const char *encoding, int force_ellipses, const struct value_print_options *options) { -@@ -792,7 +792,7 @@ unk_lang_print_type (struct type *type, const char *varstring, +@@ -785,7 +785,7 @@ unk_lang_print_type (struct type *type, const char *varstring, static void unk_lang_val_print (struct type *type, @@ -2315,10 +2153,9 @@ index 0d8604b826..7dca669b40 100644 struct value *val, const struct value_print_options *options) diff --git a/gdb/language.h b/gdb/language.h -index 06b42aeb5c..9e794f13a3 100644 --- a/gdb/language.h +++ b/gdb/language.h -@@ -188,7 +188,7 @@ struct language_defn +@@ -184,7 +184,7 @@ struct language_defn struct ui_file * stream); void (*la_printstr) (struct ui_file * stream, struct type *elttype, @@ -2327,7 +2164,7 @@ index 06b42aeb5c..9e794f13a3 100644 const char *encoding, int force_ellipses, const struct value_print_options *); -@@ -226,7 +226,7 @@ struct language_defn +@@ -222,7 +222,7 @@ struct language_defn printing. */ void (*la_val_print) (struct type *type, @@ -2337,7 +2174,6 @@ index 06b42aeb5c..9e794f13a3 100644 struct value *val, const struct value_print_options *options); diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c -index 11ccab30c8..9081d01987 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -103,10 +103,10 @@ m2_printchar (int c, struct type *type, struct ui_file *stream) @@ -2375,10 +2211,9 @@ index 11ccab30c8..9081d01987 100644 things_printed += options->repeat_count_threshold; need_comma = 1; diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h -index d7e1aec673..67f98f7d10 100644 --- a/gdb/m2-lang.h +++ b/gdb/m2-lang.h -@@ -34,7 +34,7 @@ extern void m2_print_typedef (struct type *, struct symbol *, +@@ -32,7 +32,7 @@ extern void m2_print_typedef (struct type *, struct symbol *, extern int m2_is_long_set (struct type *type); extern int m2_is_unbounded_array (struct type *type); @@ -2388,7 +2223,6 @@ index d7e1aec673..67f98f7d10 100644 struct value *, const struct value_print_options *); diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c -index 27e9429211..4578ca2954 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -234,9 +234,12 @@ static void m2_array (struct type *type, struct ui_file *stream, @@ -2408,7 +2242,6 @@ index 27e9429211..4578ca2954 100644 fprintf_filtered (stream, "] OF "); m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags); diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c -index 63c1560c6f..6991403f15 100644 --- a/gdb/m2-valprint.c +++ b/gdb/m2-valprint.c @@ -35,7 +35,7 @@ static int print_unpacked_pointer (struct type *type, @@ -2481,7 +2314,6 @@ index 63c1560c6f..6991403f15 100644 fputs_filtered ("{", stream); diff --git a/gdb/memrange.c b/gdb/memrange.c -index 2a337cc3cd..74f4c95ca9 100644 --- a/gdb/memrange.c +++ b/gdb/memrange.c @@ -22,8 +22,8 @@ @@ -2496,7 +2328,6 @@ index 2a337cc3cd..74f4c95ca9 100644 ULONGEST h, l; diff --git a/gdb/memrange.h b/gdb/memrange.h -index 46088ade53..038cd2f92c 100644 --- a/gdb/memrange.h +++ b/gdb/memrange.h @@ -28,7 +28,7 @@ struct mem_range @@ -2527,20 +2358,18 @@ index 46088ade53..038cd2f92c 100644 /* Returns true if ADDR is in RANGE. */ diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c -index 68fd1f83c3..ebb59dcc90 100644 --- a/gdb/mips-linux-nat.c +++ b/gdb/mips-linux-nat.c -@@ -579,7 +579,7 @@ mips_linux_stopped_data_address (struct target_ops *t, CORE_ADDR *paddr) +@@ -614,7 +614,7 @@ mips_linux_nat_target::stopped_data_address (CORE_ADDR *paddr) + the specified region can be covered by the watch registers. */ - static int - mips_linux_region_ok_for_hw_watchpoint (struct target_ops *self, -- CORE_ADDR addr, int len) -+ CORE_ADDR addr, LONGEST len) + int +-mips_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) ++mips_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { struct pt_watch_regs dummy_regs; int i; diff --git a/gdb/nat/x86-dregs.c b/gdb/nat/x86-dregs.c -index c816473628..05f3868759 100644 --- a/gdb/nat/x86-dregs.c +++ b/gdb/nat/x86-dregs.c @@ -380,7 +380,7 @@ x86_remove_aligned_watchpoint (struct x86_debug_reg_state *state, @@ -2562,7 +2391,6 @@ index c816473628..05f3868759 100644 int nregs; diff --git a/gdb/nat/x86-dregs.h b/gdb/nat/x86-dregs.h -index dd6242eda9..6508af93b3 100644 --- a/gdb/nat/x86-dregs.h +++ b/gdb/nat/x86-dregs.h @@ -116,7 +116,7 @@ extern int x86_dr_remove_watchpoint (struct x86_debug_reg_state *state, @@ -2575,7 +2403,6 @@ index dd6242eda9..6508af93b3 100644 /* If the inferior has some break/watchpoint that triggered, set the address associated with that break/watchpoint and return true. diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c -index 268c3c5c37..91f4d8412a 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -76,11 +76,11 @@ builtin_opencl_type (struct gdbarch *gdbarch) @@ -2647,7 +2474,6 @@ index 268c3c5c37..91f4d8412a 100644 if (!value_bits_synthetic_pointer (c->val, c->indices[i] * elsize + comp_offset, diff --git a/gdb/p-lang.c b/gdb/p-lang.c -index 03db2df2e5..9c9810e226 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -93,8 +93,8 @@ pascal_main_name (void) @@ -2698,10 +2524,9 @@ index 03db2df2e5..9c9810e226 100644 things_printed += options->repeat_count_threshold; need_comma = 1; diff --git a/gdb/p-lang.h b/gdb/p-lang.h -index 61ee752fe7..5510447e3f 100644 --- a/gdb/p-lang.h +++ b/gdb/p-lang.h -@@ -36,7 +36,7 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *, +@@ -34,7 +34,7 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *, extern void pascal_print_typedef (struct type *, struct symbol *, struct ui_file *); @@ -2710,7 +2535,7 @@ index 61ee752fe7..5510447e3f 100644 CORE_ADDR, struct ui_file *, int, struct value *, const struct value_print_options *); -@@ -50,13 +50,13 @@ extern void pascal_type_print_method_args (const char *, const char *, +@@ -48,13 +48,13 @@ extern void pascal_type_print_method_args (const char *, const char *, /* These are in p-lang.c: */ extern int @@ -2727,7 +2552,6 @@ index 61ee752fe7..5510447e3f 100644 extern struct type **const pascal_builtin_types[]; diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c -index 933dbfb6c4..e5c1b07040 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -60,7 +60,7 @@ static const struct generic_val_print_decorations p_decorations = @@ -2751,23 +2575,21 @@ index 933dbfb6c4..e5c1b07040 100644 CORE_ADDR addr; int want_space = 0; diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c -index 8418e4d35d..4a82434c0d 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c -@@ -1445,7 +1445,7 @@ ppc_linux_can_use_hw_breakpoint (struct target_ops *self, +@@ -1308,7 +1308,7 @@ ppc_linux_nat_target::can_use_hw_breakpoint (enum bptype type, int cnt, int ot) + } - static int - ppc_linux_region_ok_for_hw_watchpoint (struct target_ops *self, -- CORE_ADDR addr, int len) -+ CORE_ADDR addr, LONGEST len) + int +-ppc_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) ++ppc_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { /* Handle sub-8-byte quantities. */ if (len <= 0) diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c -index 286c02a26d..7242c7f89a 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c -@@ -1620,7 +1620,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, +@@ -1706,7 +1706,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, const struct floatformat ** ppc_floatformat_for_type (struct gdbarch *gdbarch, @@ -2777,10 +2599,9 @@ index 286c02a26d..7242c7f89a 100644 if (len == 128 && name) { diff --git a/gdb/printcmd.c b/gdb/printcmd.c -index ad80b1bebf..a126a0f8b9 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c -@@ -277,7 +277,7 @@ print_formatted (struct value *val, int size, +@@ -275,7 +275,7 @@ print_formatted (struct value *val, int size, struct ui_file *stream) { struct type *type = check_typedef (value_type (val)); @@ -2789,7 +2610,7 @@ index ad80b1bebf..a126a0f8b9 100644 if (VALUE_LVAL (val) == lval_memory) next_address = value_address (val) + len; -@@ -353,7 +353,7 @@ print_scalar_formatted (const gdb_byte *valaddr, struct type *type, +@@ -351,7 +351,7 @@ print_scalar_formatted (const gdb_byte *valaddr, struct type *type, int size, struct ui_file *stream) { struct gdbarch *gdbarch = get_type_arch (type); @@ -2799,56 +2620,49 @@ index ad80b1bebf..a126a0f8b9 100644 /* String printing should go through val_print_scalar_formatted. */ diff --git a/gdb/procfs.c b/gdb/procfs.c -index a939dedb00..887f1201fe 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c -@@ -3399,7 +3399,7 @@ procfs_remove_watchpoint (struct target_ops *self, +@@ -3358,7 +3358,7 @@ procfs_target::remove_watchpoint (CORE_ADDR addr, int len, + } - static int - procfs_region_ok_for_hw_watchpoint (struct target_ops *self, -- CORE_ADDR addr, int len) -+ CORE_ADDR addr, LONGEST len) + int +-procfs_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) ++procfs_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { /* The man page for proc(4) on Solaris 2.6 and up says that the system can support "thousands" of hardware watchpoints, but gives diff --git a/gdb/regcache.c b/gdb/regcache.c -index fb6a904dec..3694616069 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c -@@ -897,7 +897,7 @@ typedef void (regcache_write_ftype) (struct regcache *regcache, int regnum, - const void *buf); +@@ -795,7 +795,7 @@ regcache::cooked_write (int regnum, const gdb_byte *buf) + /* See regcache.h. */ enum register_status --regcache::xfer_part (int regnum, int offset, int len, void *in, -+regcache::xfer_part (int regnum, LONGEST offset, LONGEST len, void *in, - const void *out, bool is_raw) +-readable_regcache::read_part (int regnum, int offset, int len, ++readable_regcache::read_part (int regnum, LONGEST offset, LONGEST len, + gdb_byte *out, bool is_raw) { - struct gdbarch *gdbarch = arch (); -@@ -941,13 +941,13 @@ regcache::xfer_part (int regnum, int offset, int len, void *in, + int reg_size = register_size (arch (), regnum); +@@ -862,7 +862,7 @@ reg_buffer::raw_collect_part (int regnum, int offset, int len, + /* See regcache.h. */ enum register_status - regcache_raw_read_part (struct regcache *regcache, int regnum, -- int offset, int len, gdb_byte *buf) -+ int offset, LONGEST len, gdb_byte *buf) +-regcache::write_part (int regnum, int offset, int len, ++regcache::write_part (int regnum, LONGEST offset, LONGEST len, + const gdb_byte *in, bool is_raw) { - return regcache->raw_read_part (regnum, offset, len, buf); + int reg_size = register_size (arch (), regnum); +@@ -933,7 +933,7 @@ reg_buffer::raw_supply_part (int regnum, int offset, int len, } enum register_status --regcache::raw_read_part (int regnum, int offset, int len, gdb_byte *buf) -+regcache::raw_read_part (int regnum, int offset, LONGEST len, gdb_byte *buf) +-readable_regcache::raw_read_part (int regnum, int offset, int len, ++readable_regcache::raw_read_part (int regnum, int offset, LONGEST len, + gdb_byte *buf) { assert_regnum (regnum); - return xfer_part (regnum, offset, len, buf, NULL, true); -@@ -955,13 +955,13 @@ regcache::raw_read_part (int regnum, int offset, int len, gdb_byte *buf) - - void - regcache_raw_write_part (struct regcache *regcache, int regnum, -- int offset, int len, const gdb_byte *buf) -+ int offset, LONGEST len, const gdb_byte *buf) - { - regcache->raw_write_part (regnum, offset, len, buf); - } +@@ -943,7 +943,7 @@ readable_regcache::raw_read_part (int regnum, int offset, int len, + /* See regcache.h. */ void -regcache::raw_write_part (int regnum, int offset, int len, @@ -2856,33 +2670,17 @@ index fb6a904dec..3694616069 100644 const gdb_byte *buf) { assert_regnum (regnum); -@@ -970,14 +970,15 @@ regcache::raw_write_part (int regnum, int offset, int len, +@@ -953,7 +953,7 @@ regcache::raw_write_part (int regnum, int offset, int len, + /* See regcache.h. */ enum register_status - regcache_cooked_read_part (struct regcache *regcache, int regnum, -- int offset, int len, gdb_byte *buf) -+ LONGEST offset, LONGEST len, gdb_byte *buf) - { - return regcache->cooked_read_part (regnum, offset, len, buf); - } - - - enum register_status --regcache::cooked_read_part (int regnum, int offset, int len, gdb_byte *buf) -+regcache::cooked_read_part (int regnum, LONGEST offset, LONGEST len, -+ gdb_byte *buf) +-readable_regcache::cooked_read_part (int regnum, int offset, int len, ++readable_regcache::cooked_read_part (int regnum, LONGEST offset, LONGEST len, + gdb_byte *buf) { gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers); - return xfer_part (regnum, offset, len, buf, NULL, false); -@@ -985,13 +986,13 @@ regcache::cooked_read_part (int regnum, int offset, int len, gdb_byte *buf) - - void - regcache_cooked_write_part (struct regcache *regcache, int regnum, -- int offset, int len, const gdb_byte *buf) -+ LONGEST offset, LONGEST len, const gdb_byte *buf) - { - regcache->cooked_write_part (regnum, offset, len, buf); - } +@@ -963,7 +963,7 @@ readable_regcache::cooked_read_part (int regnum, int offset, int len, + /* See regcache.h. */ void -regcache::cooked_write_part (int regnum, int offset, int len, @@ -2891,85 +2689,88 @@ index fb6a904dec..3694616069 100644 { gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers); diff --git a/gdb/regcache.h b/gdb/regcache.h -index 9e3da8c3fc..a803b58516 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h -@@ -82,9 +82,9 @@ extern void regcache_raw_set_cached_value - - extern enum register_status - regcache_raw_read_part (struct regcache *regcache, int regnum, -- int offset, int len, gdb_byte *buf); -+ int offset, LONGEST len, gdb_byte *buf); - void regcache_raw_write_part (struct regcache *regcache, int regnum, -- int offset, int len, const gdb_byte *buf); -+ int offset, LONGEST len, const gdb_byte *buf); - - void regcache_invalidate (struct regcache *regcache, int regnum); - -@@ -121,10 +121,11 @@ extern void regcache_cooked_write_unsigned (struct regcache *regcache, - write style operations. */ - - enum register_status regcache_cooked_read_part (struct regcache *regcache, -- int regnum, int offset, -- int len, gdb_byte *buf); -+ int regnum, LONGEST offset, -+ LONGEST len, gdb_byte *buf); - void regcache_cooked_write_part (struct regcache *regcache, int regnum, -- int offset, int len, const gdb_byte *buf); -+ LONGEST offset, LONGEST len, -+ const gdb_byte *buf); - - /* Special routines to read/write the PC. */ - -@@ -302,15 +303,15 @@ public: - - void invalidate (int regnum); +@@ -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. */ - enum register_status raw_read_part (int regnum, int offset, int len, -+ enum register_status raw_read_part (int regnum, int offset, LONGEST len, - gdb_byte *buf); +- gdb_byte *buf); ++ enum register_status raw_read_part (int regnum, int offset, ++ LONGEST len, gdb_byte *buf); -- void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf); -+ void raw_write_part (int regnum, int offset, LONGEST len, const gdb_byte *buf); + /* Make certain that the register REGNUM is up-to-date. */ + virtual void raw_update (int regnum) = 0; +@@ -269,8 +269,8 @@ public: + enum register_status cooked_read (int regnum, T *val); + /* Partial transfer of a cooked register. */ - enum register_status cooked_read_part (int regnum, int offset, int len, -+ enum register_status cooked_read_part (int regnum, LONGEST offset, LONGEST len, - gdb_byte *buf); +- gdb_byte *buf); ++ enum register_status cooked_read_part (int regnum, LONGEST offset, ++ LONGEST len, gdb_byte *buf); + /* 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: + + /* Perform a partial register transfer using a read, modify, write + operation. Will fail if register is currently invalid. */ +- enum register_status read_part (int regnum, int offset, int len, ++ enum register_status read_part (int regnum, LONGEST offset, LONGEST len, + gdb_byte *out, bool is_raw); + }; + +@@ -338,11 +338,12 @@ public: + + /* Partial transfer of raw registers. Perform read, modify, write style + operations. */ +- void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf); ++ void raw_write_part (int regnum, int offset, LONGEST len, ++ const gdb_byte *buf); + + /* Partial transfer of a cooked register. Perform read, modify, write style + operations. */ - void cooked_write_part (int regnum, int offset, int len, + void cooked_write_part (int regnum, LONGEST offset, LONGEST len, const gdb_byte *buf); void supply_regset (const struct regset *regset, -@@ -349,8 +350,8 @@ private: +@@ -393,7 +394,7 @@ private: - void restore (struct regcache *src); + /* Perform a partial register transfer using a read, modify, write + operation. */ +- enum register_status write_part (int regnum, int offset, int len, ++ enum register_status write_part (int regnum, LONGEST offset, LONGEST len, + const gdb_byte *in, bool is_raw); -- enum register_status xfer_part (int regnum, int offset, int len, void *in, -- const void *out, bool is_raw); -+ enum register_status xfer_part (int regnum, LONGEST offset, LONGEST len, -+ void *in, const void *out, bool is_raw); - - void transfer_regset (const struct regset *regset, - struct regcache *out_regcache, + /* The address space of this register cache (for registers where it diff --git a/gdb/remote.c b/gdb/remote.c -index a426508723..94d5594175 100644 --- a/gdb/remote.c +++ b/gdb/remote.c -@@ -9969,7 +9969,7 @@ int remote_hw_breakpoint_limit = -1; +@@ -462,7 +462,7 @@ public: - static int - remote_region_ok_for_hw_watchpoint (struct target_ops *self, -- CORE_ADDR addr, int len) -+ CORE_ADDR addr, LONGEST len) + int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override; + +- int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; ++ int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override; + + 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; + int remote_hw_breakpoint_limit = -1; + + int +-remote_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) ++remote_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { if (remote_hw_watchpoint_length_limit == 0) return 0; diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c -index cb924e084d..c18f2d0ed5 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c -@@ -472,7 +472,7 @@ rust_printchar (int c, struct type *type, struct ui_file *stream) +@@ -288,7 +288,7 @@ rust_printchar (int c, struct type *type, struct ui_file *stream) static void rust_printstr (struct ui_file *stream, struct type *type, @@ -2978,7 +2779,7 @@ index cb924e084d..c18f2d0ed5 100644 const char *user_encoding, int force_ellipses, const struct value_print_options *options) { -@@ -618,7 +618,7 @@ static const struct generic_val_print_decorations rust_decorations = +@@ -497,7 +497,7 @@ static const struct generic_val_print_decorations rust_decorations = /* la_val_print implementation for Rust. */ static void @@ -2988,33 +2789,40 @@ index cb924e084d..c18f2d0ed5 100644 struct value *val, const struct value_print_options *options) diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c -index 8a3fcff9b6..a8b7d63938 100644 --- a/gdb/s390-linux-nat.c +++ b/gdb/s390-linux-nat.c -@@ -921,7 +921,7 @@ s390_remove_hw_breakpoint (struct target_ops *self, +@@ -952,7 +952,8 @@ s390_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch, + } - static int - s390_region_ok_for_hw_watchpoint (struct target_ops *self, -- CORE_ADDR addr, int cnt) -+ CORE_ADDR addr, LONGEST cnt) + int +-s390_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int cnt) ++s390_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, ++ LONGEST cnt) { return 1; } diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c -index 7152ddabbd..1cfa7780af 100644 --- a/gdb/spu-multiarch.c +++ b/gdb/spu-multiarch.c -@@ -128,7 +128,7 @@ spu_thread_architecture (struct target_ops *ops, ptid_t ptid) - /* Override the to_region_ok_for_hw_watchpoint routine. */ - static int - spu_region_ok_for_hw_watchpoint (struct target_ops *self, -- CORE_ADDR addr, int len) -+ CORE_ADDR addr, LONGEST len) - { - struct target_ops *ops_beneath = find_target_beneath (self); +@@ -66,7 +66,7 @@ struct spu_multiarch_target final : public target_ops + const gdb_byte *pattern, ULONGEST pattern_len, + CORE_ADDR *found_addrp) override; +- int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; ++ int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override; + + struct gdbarch *thread_architecture (ptid_t) override; + }; +@@ -163,7 +163,7 @@ spu_multiarch_target::thread_architecture (ptid_t ptid) + /* Override the to_region_ok_for_hw_watchpoint routine. */ + + int +-spu_multiarch_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) ++spu_multiarch_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) + { + /* We cannot watch SPU local store. */ + if (SPUADDR_SPU (addr) != -1) diff --git a/gdb/stack.c b/gdb/stack.c -index 9993ae654a..6e1336da02 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -190,7 +190,7 @@ print_stack_frame (struct frame_info *frame, int print_level, @@ -3056,10 +2864,9 @@ index 9993ae654a..6e1336da02 100644 if (highest_offset == -1) start = gdbarch_frame_args_skip (get_frame_arch (frame)); diff --git a/gdb/symmisc.c b/gdb/symmisc.c -index 9adde044cd..2bd1464a01 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c -@@ -585,11 +585,11 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, +@@ -586,11 +586,11 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, case LOC_CONST_BYTES: { @@ -3075,40 +2882,62 @@ index 9adde044cd..2bd1464a01 100644 fprintf_filtered (outfile, " %02x", (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]); diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c -index aaf11d81b8..2b449cbf01 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c -@@ -760,14 +760,14 @@ debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, COR +@@ -39,7 +39,7 @@ struct dummy_target : public target_ops + 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; +- int region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) override; ++ int region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) override; + 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; + 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; ++ int region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) override; + 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 } - static int --delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2) -+delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2) + int +-target_ops::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) ++target_ops::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) { - self = self->beneath; - return self->to_region_ok_for_hw_watchpoint (self, arg1, arg2); + return this->beneath ()->region_ok_for_hw_watchpoint (arg0, arg1); } - static int --debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2) -+debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2) + int +-dummy_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) ++dummy_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) + { + return default_region_ok_for_hw_watchpoint (this, arg0, arg1); + } + + int +-debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) ++debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) { int result; - fprintf_unfiltered (gdb_stdlog, "-> %s->to_region_ok_for_hw_watchpoint (...)\n", debug_target.to_shortname); -@@ -777,7 +777,7 @@ debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int + 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) + fprintf_unfiltered (gdb_stdlog, "<- %s->region_ok_for_hw_watchpoint (", this->beneath ()->shortname ()); + target_debug_print_CORE_ADDR (arg0); fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_CORE_ADDR (arg1); - fputs_unfiltered (", ", gdb_stdlog); -- target_debug_print_int (arg2); -+ target_debug_print_LONGEST (arg2); +- target_debug_print_int (arg1); ++ target_debug_print_LONGEST (arg1); fputs_unfiltered (") = ", gdb_stdlog); target_debug_print_int (result); fputs_unfiltered ("\n", gdb_stdlog); diff --git a/gdb/target.c b/gdb/target.c -index 748d5bb7a2..a1ac6d0697 100644 --- a/gdb/target.c +++ b/gdb/target.c -@@ -56,7 +56,7 @@ static int default_watchpoint_addr_within_range (struct target_ops *, +@@ -59,7 +59,7 @@ static int default_watchpoint_addr_within_range (struct target_ops *, CORE_ADDR, CORE_ADDR, int); static int default_region_ok_for_hw_watchpoint (struct target_ops *, @@ -3117,7 +2946,7 @@ index 748d5bb7a2..a1ac6d0697 100644 static void default_rcmd (struct target_ops *, const char *, struct ui_file *); -@@ -3112,7 +3112,7 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename) +@@ -3181,7 +3181,7 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename) static int default_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -3127,23 +2956,21 @@ index 748d5bb7a2..a1ac6d0697 100644 return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT); } diff --git a/gdb/target.h b/gdb/target.h -index e3a2882fe5..7a70c3f6da 100644 --- a/gdb/target.h +++ b/gdb/target.h -@@ -541,7 +541,7 @@ struct target_ops +@@ -562,7 +562,7 @@ struct target_ops + /* Documentation of this routine is provided with the corresponding target_* macro. */ - int (*to_region_ok_for_hw_watchpoint) (struct target_ops *, -- CORE_ADDR, int) -+ CORE_ADDR, LONGEST) +- virtual int region_ok_for_hw_watchpoint (CORE_ADDR, int) ++ virtual int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint); - int (*to_can_accel_watchpoint_condition) (struct target_ops *, + virtual bool can_accel_watchpoint_condition (CORE_ADDR, int, int, diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c -index b0f855a6f4..23033fa9de 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c -@@ -852,10 +852,10 @@ collection_list::add_register (unsigned int regno) +@@ -829,10 +829,10 @@ collection_list::add_register (unsigned int regno) void collection_list::add_memrange (struct gdbarch *gdbarch, int type, bfd_signed_vma base, @@ -3156,7 +2983,7 @@ index b0f855a6f4..23033fa9de 100644 /* type: memrange_absolute == memory, other n == basereg */ /* base: addr if memory, offset if reg relative. */ -@@ -875,7 +875,7 @@ collection_list::collect_symbol (struct symbol *sym, +@@ -852,7 +852,7 @@ collection_list::collect_symbol (struct symbol *sym, CORE_ADDR scope, int trace_string) { @@ -3165,7 +2992,7 @@ index b0f855a6f4..23033fa9de 100644 unsigned int reg; bfd_signed_vma offset; int treat_as_expr = 0; -@@ -896,8 +896,8 @@ collection_list::collect_symbol (struct symbol *sym, +@@ -873,8 +873,8 @@ collection_list::collect_symbol (struct symbol *sym, offset = SYMBOL_VALUE_ADDRESS (sym); if (info_verbose) { @@ -3176,7 +3003,7 @@ index b0f855a6f4..23033fa9de 100644 paddress (gdbarch, offset)); } /* A struct may be a C++ class with static fields, go to general -@@ -929,9 +929,9 @@ collection_list::collect_symbol (struct symbol *sym, +@@ -906,9 +906,9 @@ collection_list::collect_symbol (struct symbol *sym, offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { @@ -3188,7 +3015,7 @@ index b0f855a6f4..23033fa9de 100644 paddress (gdbarch, offset), reg); } add_memrange (gdbarch, reg, offset, len); -@@ -941,9 +941,9 @@ collection_list::collect_symbol (struct symbol *sym, +@@ -918,9 +918,9 @@ collection_list::collect_symbol (struct symbol *sym, offset = 0; if (info_verbose) { @@ -3200,7 +3027,7 @@ index b0f855a6f4..23033fa9de 100644 paddress (gdbarch, offset), reg); } add_memrange (gdbarch, reg, offset, len); -@@ -953,9 +953,9 @@ collection_list::collect_symbol (struct symbol *sym, +@@ -930,9 +930,9 @@ collection_list::collect_symbol (struct symbol *sym, offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { @@ -3212,7 +3039,7 @@ index b0f855a6f4..23033fa9de 100644 paddress (gdbarch, offset), reg); } add_memrange (gdbarch, reg, offset, len); -@@ -2500,7 +2500,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; @@ -3222,7 +3049,7 @@ index b0f855a6f4..23033fa9de 100644 struct gdbarch *gdbarch; int regno; const char *args = args_in; -@@ -2644,8 +2645,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)) @@ -3237,10 +3064,9 @@ index b0f855a6f4..23033fa9de 100644 if (BLOCK_FUNCTION (block)) break; diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h -index 9f4596ecd1..8554cad3ba 100644 --- a/gdb/tracepoint.h +++ b/gdb/tracepoint.h -@@ -255,7 +255,7 @@ public: +@@ -265,7 +265,7 @@ public: void add_register (unsigned int regno); void add_memrange (struct gdbarch *gdbarch, int type, bfd_signed_vma base, @@ -3249,11 +3075,34 @@ index 9f4596ecd1..8554cad3ba 100644 void collect_symbol (struct symbol *sym, struct gdbarch *gdbarch, long frame_regno, long frame_offset, +diff --git a/gdb/typeprint.c b/gdb/typeprint.c +--- a/gdb/typeprint.c ++++ b/gdb/typeprint.c +@@ -120,7 +120,8 @@ print_offset_data::update (struct type *type, unsigned int field_idx, + { + /* Since union fields don't have the concept of offsets, we just + print their sizes. */ +- fprintf_filtered (stream, "/* %4u */", TYPE_LENGTH (ftype)); ++ fprintf_filtered (stream, "/* %4s */", ++ pulongest (TYPE_LENGTH (ftype))); + return; + } + +@@ -183,8 +184,8 @@ print_offset_data::finish (struct type *type, int level, + + fputs_filtered ("\n", stream); + print_spaces_filtered (level + 4 + print_offset_data::indentation, stream); +- fprintf_filtered (stream, "/* total size (bytes): %4u */\n", +- TYPE_LENGTH (type)); ++ fprintf_filtered (stream, "/* total size (bytes): %4s */\n", ++ pulongest (TYPE_LENGTH (type))); + } + + diff --git a/gdb/valarith.c b/gdb/valarith.c -index 035def5466..67bd7cf03a 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c -@@ -184,7 +184,7 @@ value_subscript (struct value *array, LONGEST index) +@@ -182,7 +182,7 @@ value_subscript (struct value *array, LONGEST index) to doubles, but no longer does. */ struct value * @@ -3262,7 +3111,7 @@ index 035def5466..67bd7cf03a 100644 { struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); -@@ -661,7 +661,7 @@ value_concat (struct value *arg1, struct value *arg2) +@@ -659,7 +659,7 @@ value_concat (struct value *arg1, struct value *arg2) struct value *inval1; struct value *inval2; struct value *outval = NULL; @@ -3271,7 +3120,7 @@ index 035def5466..67bd7cf03a 100644 int count, idx; char inchar; struct type *type1 = check_typedef (value_type (arg1)); -@@ -1421,7 +1421,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) +@@ -1419,7 +1419,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) int value_logical_not (struct value *arg1) { @@ -3280,7 +3129,7 @@ index 035def5466..67bd7cf03a 100644 const gdb_byte *p; struct type *type1; -@@ -1449,11 +1449,11 @@ value_logical_not (struct value *arg1) +@@ -1447,11 +1447,11 @@ value_logical_not (struct value *arg1) static int value_strcmp (struct value *arg1, struct value *arg2) { @@ -3296,10 +3145,9 @@ index 035def5466..67bd7cf03a 100644 for (i = 0; i < len; i++) { diff --git a/gdb/valops.c b/gdb/valops.c -index 7aacd17d70..fdcb7e49e6 100644 --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -80,7 +80,7 @@ oload_classification classify_oload_match (struct badness_vector *, +@@ -81,7 +81,7 @@ oload_classification classify_oload_match (struct badness_vector *, int, int); static struct value *value_struct_elt_for_reference (struct type *, @@ -3308,7 +3156,7 @@ index 7aacd17d70..fdcb7e49e6 100644 const char *, struct type *, int, enum noside); -@@ -182,7 +182,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) +@@ -183,7 +183,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) space. */ struct value * @@ -3317,7 +3165,7 @@ index 7aacd17d70..fdcb7e49e6 100644 { struct objfile *objf; struct value *val = find_function_in_inferior ("malloc", &objf); -@@ -397,12 +397,12 @@ value_cast (struct type *type, struct value *arg2) +@@ -398,12 +398,12 @@ value_cast (struct type *type, struct value *arg2) if (code1 == TYPE_CODE_ARRAY) { struct type *element_type = TYPE_TARGET_TYPE (type); @@ -3332,7 +3180,7 @@ index 7aacd17d70..fdcb7e49e6 100644 LONGEST low_bound, high_bound, new_length; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -@@ -1054,7 +1054,7 @@ value_assign (struct value *toval, struct value *fromval) +@@ -1055,7 +1055,7 @@ value_assign (struct value *toval, struct value *fromval) { const gdb_byte *dest_buffer; CORE_ADDR changed_addr; @@ -3341,7 +3189,7 @@ index 7aacd17d70..fdcb7e49e6 100644 gdb_byte buffer[sizeof (LONGEST)]; if (value_bitsize (toval)) -@@ -3325,7 +3325,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) +@@ -3357,7 +3357,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) the form "DOMAIN::NAME". */ static struct value * @@ -3350,7 +3198,7 @@ index 7aacd17d70..fdcb7e49e6 100644 struct type *curtype, const char *name, struct type *intype, int want_address, -@@ -3359,7 +3359,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, +@@ -3391,7 +3391,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), @@ -3359,7 +3207,7 @@ index 7aacd17d70..fdcb7e49e6 100644 else if (noside != EVAL_NORMAL) return allocate_value (TYPE_FIELD_TYPE (t, i)); else -@@ -3532,7 +3532,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, +@@ -3564,7 +3564,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) { struct value *v; @@ -3368,7 +3216,7 @@ index 7aacd17d70..fdcb7e49e6 100644 if (BASETYPE_VIA_VIRTUAL (t, i)) base_offset = 0; -@@ -3681,7 +3681,7 @@ value_rtti_indirect_type (struct value *v, int *full, +@@ -3713,7 +3713,7 @@ value_rtti_indirect_type (struct value *v, int *full, struct value * value_full_object (struct value *argp, struct type *rtype, @@ -3378,10 +3226,9 @@ index 7aacd17d70..fdcb7e49e6 100644 { struct type *real_type; diff --git a/gdb/valprint.c b/gdb/valprint.c -index d01d02fc09..e2d87c05bc 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c -@@ -882,7 +882,7 @@ generic_val_print_complex (struct type *type, +@@ -879,7 +879,7 @@ generic_val_print_complex (struct type *type, void generic_val_print (struct type *type, @@ -3390,7 +3237,7 @@ index d01d02fc09..e2d87c05bc 100644 struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options, -@@ -1776,7 +1776,7 @@ print_decimal_chars (struct ui_file *stream, const gdb_byte *valaddr, +@@ -1773,7 +1773,7 @@ print_decimal_chars (struct ui_file *stream, const gdb_byte *valaddr, void print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr, @@ -3399,7 +3246,7 @@ index d01d02fc09..e2d87c05bc 100644 bool zero_pad) { const gdb_byte *p; -@@ -1929,17 +1929,17 @@ val_print_array_elements (struct type *type, +@@ -1926,17 +1926,17 @@ val_print_array_elements (struct type *type, int recurse, struct value *val, const struct value_print_options *options, @@ -3422,7 +3269,7 @@ index d01d02fc09..e2d87c05bc 100644 LONGEST low_bound, high_bound; LONGEST low_pos, high_pos; -@@ -2029,7 +2029,7 @@ val_print_array_elements (struct type *type, +@@ -2026,7 +2026,7 @@ val_print_array_elements (struct type *type, address, stream, recurse + 1, val, options, current_language); annotate_elt_rep (reps); @@ -3431,7 +3278,7 @@ index d01d02fc09..e2d87c05bc 100644 annotate_elt_rep_end (); i = rep1 - 1; -@@ -2675,7 +2675,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, @@ -3441,7 +3288,6 @@ index d01d02fc09..e2d87c05bc 100644 int quote_char, int c_style_terminator, const struct value_print_options *options) diff --git a/gdb/valprint.h b/gdb/valprint.h -index f005c31f87..6ffb58c04e 100644 --- a/gdb/valprint.h +++ b/gdb/valprint.h @@ -119,7 +119,7 @@ extern void val_print_array_elements (struct type *, LONGEST, @@ -3462,7 +3308,7 @@ index f005c31f87..6ffb58c04e 100644 extern void print_char_chars (struct ui_file *, struct type *, const gdb_byte *, unsigned int, enum bfd_endian); -@@ -191,7 +191,7 @@ struct generic_val_print_decorations +@@ -192,7 +192,7 @@ struct generic_val_print_decorations extern void generic_val_print (struct type *type, @@ -3471,7 +3317,7 @@ index f005c31f87..6ffb58c04e 100644 struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options, -@@ -201,7 +201,7 @@ extern void generic_emit_char (int c, struct type *type, struct ui_file *stream, +@@ -202,7 +202,7 @@ extern void generic_emit_char (int c, struct type *type, struct ui_file *stream, int quoter, const char *encoding); extern void generic_printstr (struct ui_file *stream, struct type *type, @@ -3481,10 +3327,9 @@ index f005c31f87..6ffb58c04e 100644 int quote_char, int c_style_terminator, const struct value_print_options *options); diff --git a/gdb/value.c b/gdb/value.c -index 558d0bbd7a..b6406fedc9 100644 --- a/gdb/value.c +++ b/gdb/value.c -@@ -363,7 +363,8 @@ value_bytes_available (const struct value *value, +@@ -383,7 +383,8 @@ value_bytes_available (const struct value *value, } int @@ -3494,7 +3339,7 @@ index 558d0bbd7a..b6406fedc9 100644 { gdb_assert (!value->lazy); -@@ -809,8 +810,8 @@ find_first_range_overlap_and_match (struct ranges_and_idx *rp1, +@@ -831,8 +832,8 @@ find_first_range_overlap_and_match (struct ranges_and_idx *rp1, Return true if the available bits match. */ static bool @@ -3505,7 +3350,7 @@ index 558d0bbd7a..b6406fedc9 100644 int length) { /* Each array element corresponds to a ranges source (unavailable, -@@ -1445,7 +1446,8 @@ value_optimized_out (struct value *value) +@@ -1423,7 +1424,8 @@ value_optimized_out (struct value *value) the following LENGTH bytes. */ void @@ -3516,10 +3361,9 @@ index 558d0bbd7a..b6406fedc9 100644 mark_value_bits_optimized_out (value, offset * TARGET_CHAR_BIT, diff --git a/gdb/value.h b/gdb/value.h -index 03ca06448f..9c73464cf0 100644 --- a/gdb/value.h +++ b/gdb/value.h -@@ -245,7 +245,7 @@ struct lval_funcs +@@ -274,7 +274,7 @@ struct lval_funcs /* If non-NULL, this is used to determine whether the indicated bits of VALUE are a synthetic pointer. */ int (*check_synthetic_pointer) (const struct value *value, @@ -3528,7 +3372,7 @@ index 03ca06448f..9c73464cf0 100644 /* Return a duplicate of VALUE's closure, for use in a new value. This may simply return the same closure, if VALUE's is -@@ -376,7 +376,8 @@ extern int value_optimized_out (struct value *value); +@@ -405,7 +405,8 @@ extern int value_optimized_out (struct value *value); otherwise. */ extern int value_bits_any_optimized_out (const struct value *value, @@ -3538,7 +3382,7 @@ index 03ca06448f..9c73464cf0 100644 /* Like value_optimized_out, but return true iff the whole value is optimized out. */ -@@ -386,7 +387,7 @@ extern int value_entirely_optimized_out (struct value *value); +@@ -415,7 +416,7 @@ extern int value_entirely_optimized_out (struct value *value); LENGTH bytes as optimized out. */ extern void mark_value_bytes_optimized_out (struct value *value, @@ -3547,7 +3391,7 @@ index 03ca06448f..9c73464cf0 100644 /* Mark VALUE's content bits starting at OFFSET and extending for LENGTH bits as optimized out. */ -@@ -820,12 +821,11 @@ extern struct value *value_primitive_field (struct value *arg1, LONGEST offset, +@@ -849,12 +850,11 @@ extern struct value *value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type); @@ -3561,7 +3405,7 @@ index 03ca06448f..9c73464cf0 100644 extern struct value *value_cast_pointers (struct type *, struct value *, int); -@@ -1136,10 +1136,11 @@ extern struct value *value_literal_complex (struct value *, struct value *, +@@ -1147,10 +1147,11 @@ extern struct value *value_literal_complex (struct value *, struct value *, extern struct value *find_function_in_inferior (const char *, struct objfile **); @@ -3576,18 +3420,35 @@ index 03ca06448f..9c73464cf0 100644 /* User function handler. */ diff --git a/gdb/x86-nat.c b/gdb/x86-nat.c -index b126c47c94..825b487a9a 100644 --- a/gdb/x86-nat.c +++ b/gdb/x86-nat.c -@@ -174,7 +174,7 @@ x86_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, +@@ -173,7 +173,7 @@ x86_remove_watchpoint (CORE_ADDR addr, int len, + address ADDR and whose length is LEN bytes. */ - static int - x86_region_ok_for_watchpoint (struct target_ops *self, -- CORE_ADDR addr, int len) -+ CORE_ADDR addr, LONGEST len) + int +-x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) ++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)); --- -2.14.3 - + = 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 +@@ -49,7 +49,7 @@ extern void x86_forget_process (pid_t pid); + definitions. */ + + extern int x86_can_use_hw_breakpoint (enum bptype type, int cnt, int othertype); +-extern int x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len); ++extern int x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len); + 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 + int can_use_hw_breakpoint (enum bptype type, int cnt, int othertype) override + { return x86_can_use_hw_breakpoint (type, cnt, othertype); } + +- int region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) override ++ int region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) override + { return x86_region_ok_for_hw_watchpoint (addr, len); } + + int insert_watchpoint (CORE_ADDR addr, int len, diff --git a/gdb-rhbz795424-bitpos-21of25.patch b/gdb-rhbz795424-bitpos-21of25.patch index e4d1771..f3c2bd5 100644 --- a/gdb-rhbz795424-bitpos-21of25.patch +++ b/gdb-rhbz795424-bitpos-21of25.patch @@ -1,9 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: Add a check to ensure that a type may fit into host memory - -FileName: gdb-rhbz795424-bitpos-21of25.patch +Subject: gdb-rhbz795424-bitpos-21of25.patch ;; Fix `GDB cannot access struct member whose offset is larger than 256MB' ;; (RH BZ 795424). @@ -60,22 +58,11 @@ gdb/ChangeLog Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-ensure-size_t.patch ---- - gdb/alpha-tdep.c | 7 +++++++ - gdb/cp-valprint.c | 1 + - gdb/defs.h | 2 ++ - gdb/p-valprint.c | 1 + - gdb/utils.c | 12 ++++++++++++ - gdb/valops.c | 1 + - gdb/value.c | 4 ++++ - gdb/vax-tdep.c | 1 + - 8 files changed, 29 insertions(+) diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c -index 52a46d96ea..ea53b9ee10 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c -@@ -415,6 +415,13 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -413,6 +413,13 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, accumulate_size = 0; else accumulate_size -= sizeof(arg_reg_buffer); @@ -90,7 +77,6 @@ index 52a46d96ea..ea53b9ee10 100644 /* Keep sp aligned to a multiple of 16 as the ABI requires. */ diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c -index db3ff338d1..4d06680239 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -529,6 +529,7 @@ cp_print_value (struct type *type, struct type *real_type, @@ -102,10 +88,9 @@ index db3ff338d1..4d06680239 100644 if (target_read_memory (address + boffset, buf.data (), diff --git a/gdb/defs.h b/gdb/defs.h -index 4fb2129b30..0c156d56c3 100644 --- a/gdb/defs.h +++ b/gdb/defs.h -@@ -705,4 +705,6 @@ DEF_ENUM_FLAGS_TYPE (enum user_selected_what_flag, user_selected_what); +@@ -665,4 +665,6 @@ DEF_ENUM_FLAGS_TYPE (enum user_selected_what_flag, user_selected_what); #include "utils.h" @@ -113,7 +98,6 @@ index 4fb2129b30..0c156d56c3 100644 + #endif /* #ifndef DEFS_H */ diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c -index e5c1b07040..06fb3b77c9 100644 --- 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, @@ -125,10 +109,9 @@ index e5c1b07040..06fb3b77c9 100644 base_valaddr = buf.data (); diff --git a/gdb/utils.c b/gdb/utils.c -index 0066bfcc4b..6f0abc98a2 100644 --- a/gdb/utils.c +++ b/gdb/utils.c -@@ -2836,6 +2836,18 @@ string_to_core_addr (const char *my_string) +@@ -2834,6 +2834,17 @@ string_to_core_addr (const char *my_string) return addr; } @@ -143,15 +126,13 @@ index 0066bfcc4b..6f0abc98a2 100644 + "maximum allowed %s bytes."), pulongest (num), + pulongest (SIZE_MAX / 8)); +} -+ - gdb::unique_xmalloc_ptr - gdb_realpath (const char *filename) - { + #if GDB_SELF_TEST + + static void diff --git a/gdb/valops.c b/gdb/valops.c -index fdcb7e49e6..ddc53f131e 100644 --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -2087,6 +2087,7 @@ search_struct_method (const char *name, struct value **arg1p, +@@ -2088,6 +2088,7 @@ search_struct_method (const char *name, struct value **arg1p, { CORE_ADDR address; @@ -160,18 +141,17 @@ index fdcb7e49e6..ddc53f131e 100644 address = value_address (*arg1p); diff --git a/gdb/value.c b/gdb/value.c -index b6406fedc9..ac7d07a7b5 100644 --- a/gdb/value.c +++ b/gdb/value.c -@@ -926,6 +926,7 @@ allocate_value_lazy (struct type *type) +@@ -933,6 +933,7 @@ allocate_value_lazy (struct type *type) description correctly. */ check_typedef (type); + ulongest_fits_host_or_error (TYPE_LENGTH (type)); - val = XCNEW (struct value); - val->contents = NULL; - val->next = all_values; -@@ -1023,6 +1024,8 @@ check_type_length_before_alloc (const struct type *type) + val = new struct value (type); + + /* Values start out on the all_values chain. */ +@@ -1015,6 +1016,8 @@ check_type_length_before_alloc (const struct type *type) static void allocate_value_contents (struct value *val) { @@ -180,16 +160,15 @@ index b6406fedc9..ac7d07a7b5 100644 if (!val->contents) { check_type_length_before_alloc (val->enclosing_type); -@@ -3015,6 +3018,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type) +@@ -2876,6 +2879,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); + ulongest_fits_host_or_error (TYPE_LENGTH (new_encl_type)); val->contents - = (gdb_byte *) xrealloc (val->contents, TYPE_LENGTH (new_encl_type)); - } + .reset ((gdb_byte *) xrealloc (val->contents.release (), + TYPE_LENGTH (new_encl_type))); diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c -index 4c1ab2e73e..bd69fd2f48 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -218,6 +218,7 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function, @@ -200,6 +179,3 @@ index 4c1ab2e73e..bd69fd2f48 100644 read_memory (addr, readbuf, len); } --- -2.14.3 - diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch index 996debe..700214c 100644 --- a/gdb-rhbz795424-bitpos-22of25.patch +++ b/gdb-rhbz795424-bitpos-22of25.patch @@ -1,9 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: Expand watchpoint lengths to LONGEST - -FileName: gdb-rhbz795424-bitpos-22of25.patch +Subject: gdb-rhbz795424-bitpos-22of25.patch ;; Fix `GDB cannot access struct member whose offset is larger than 256MB' ;; (RH BZ 795424). @@ -104,50 +102,71 @@ gdb/ChangeLog: Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-wp.patch ---- - gdb/aarch64-linux-nat.c | 2 +- - gdb/arm-linux-nat.c | 2 +- - gdb/nat/aarch64-linux-hw-point.c | 21 +++++++++++---------- - gdb/nat/aarch64-linux-hw-point.h | 4 ++-- - gdb/ppc-linux-nat.c | 14 +++++++------- - gdb/procfs.c | 4 ++-- - gdb/remote.c | 6 +++--- - gdb/target-delegates.c | 14 +++++++------- - gdb/target.c | 4 ++-- - gdb/target.h | 4 ++-- - 10 files changed, 38 insertions(+), 37 deletions(-) diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c -index 08e6f4d4fd..f08bf039e4 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c -@@ -767,7 +767,7 @@ aarch64_linux_stopped_by_watchpoint (struct target_ops *ops) - static int - aarch64_linux_watchpoint_addr_within_range (struct target_ops *target, - CORE_ADDR addr, -- CORE_ADDR start, int length) -+ CORE_ADDR start, LONGEST length) +@@ -63,14 +63,14 @@ public: + int can_use_hw_breakpoint (enum bptype, int, int) override; + int insert_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override; + int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override; +- int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; ++ int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override; + int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, + struct expression *) override; + int remove_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, + struct expression *) override; + bool stopped_by_watchpoint () override; + bool stopped_data_address (CORE_ADDR *) override; +- bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override; ++ bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) override; + + int can_do_single_step () override; + +@@ -887,7 +887,8 @@ aarch64_linux_nat_target::stopped_by_watchpoint () + + bool + aarch64_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr, +- CORE_ADDR start, int length) ++ CORE_ADDR start, ++ LONGEST length) { return start <= addr && start + length - 1 >= addr; } diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c -index 3b7aa40db8..48dfe22ce1 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c -@@ -1177,7 +1177,7 @@ arm_linux_stopped_by_watchpoint (struct target_ops *ops) - static int - arm_linux_watchpoint_addr_within_range (struct target_ops *target, - CORE_ADDR addr, -- CORE_ADDR start, int length) -+ CORE_ADDR start, LONGEST length) +@@ -80,7 +80,7 @@ public: + + int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override; + +- int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; ++ int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override; + + int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, + struct expression *) override; +@@ -91,7 +91,7 @@ public: + + bool stopped_data_address (CORE_ADDR *) override; + +- bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override; ++ bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) override; + + const struct target_desc *read_description () override; + +@@ -1207,7 +1207,7 @@ arm_linux_nat_target::stopped_by_watchpoint () + bool + arm_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr, + CORE_ADDR start, +- int length) ++ LONGEST length) { return start <= addr && start + length - 1 >= addr; } diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c -index ce26f28fad..e9ebc5fba8 100644 --- a/gdb/nat/aarch64-linux-hw-point.c +++ b/gdb/nat/aarch64-linux-hw-point.c -@@ -111,7 +111,7 @@ aarch64_point_encode_ctrl_reg (enum target_hw_bp_type type, int len) +@@ -137,7 +137,7 @@ aarch64_point_encode_ctrl_reg (enum target_hw_bp_type type, int offset, int len) Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise. */ static int @@ -156,20 +175,20 @@ index ce26f28fad..e9ebc5fba8 100644 { unsigned int alignment = 0; -@@ -180,9 +180,10 @@ aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len) - limitations can be largely relaxed with some further work. */ +@@ -212,9 +212,10 @@ aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len) + an address within the latter. */ static void -aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p, +aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len, + CORE_ADDR *aligned_addr_p, - int *aligned_len_p, CORE_ADDR *next_addr_p, -- int *next_len_p) -+ LONGEST *next_len_p) + int *aligned_offset_p, int *aligned_len_p, +- CORE_ADDR *next_addr_p, int *next_len_p, ++ CORE_ADDR *next_addr_p, LONGEST *next_len_p, + CORE_ADDR *next_addr_orig_p) { int aligned_len; - unsigned int offset; -@@ -501,7 +502,7 @@ aarch64_handle_aligned_watchpoint (enum target_hw_bp_type type, +@@ -611,7 +612,7 @@ aarch64_handle_aligned_watchpoint (enum target_hw_bp_type type, static int aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, @@ -177,20 +196,23 @@ index ce26f28fad..e9ebc5fba8 100644 + CORE_ADDR addr, LONGEST len, int is_insert, struct aarch64_debug_reg_state *state) { - while (len > 0) -@@ -524,9 +525,9 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, - " " - "aligned_addr: %s, aligned_len: %d\n" + CORE_ADDR addr_orig = addr; +@@ -641,12 +642,12 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, " " -- "next_addr: %s, next_len: %d\n", -+ "next_addr: %s, next_len: %s\n", + "addr_orig: %s\n" + " " +- "next_addr: %s, next_len: %d\n" ++ "next_addr: %s, next_len: %s\n" + " " + "addr_orig_next: %s\n", is_insert, core_addr_to_string_nz (aligned_addr), -- aligned_len, core_addr_to_string_nz (addr), len); -+ aligned_len, core_addr_to_string_nz (addr), plongest (len)); + aligned_len, core_addr_to_string_nz (addr_orig), +- core_addr_to_string_nz (addr), len, ++ core_addr_to_string_nz (addr), plongest (len), + core_addr_to_string_nz (addr_orig_next)); - if (ret != 0) - return ret; -@@ -537,7 +538,7 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, + addr_orig = addr_orig_next; +@@ -660,7 +661,7 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, int aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr, @@ -199,7 +221,7 @@ index ce26f28fad..e9ebc5fba8 100644 struct aarch64_debug_reg_state *state) { if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len)) -@@ -588,14 +589,14 @@ aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state, +@@ -722,14 +723,14 @@ aarch64_linux_set_debug_regs (struct aarch64_debug_reg_state *state, void aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state, const char *func, CORE_ADDR addr, @@ -217,11 +239,19 @@ index ce26f28fad..e9ebc5fba8 100644 type == hw_write ? "hw-write-watchpoint" : (type == hw_read ? "hw-read-watchpoint" : (type == hw_access ? "hw-access-watchpoint" +@@ -812,7 +813,7 @@ aarch64_linux_get_debug_reg_capacity (int tid) + ADDR and whose length is LEN in bytes. */ + + int +-aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, int len) ++aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, LONGEST len) + { + CORE_ADDR aligned_addr; + diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h -index 7c42b96d1b..e1d4fc8dbc 100644 --- a/gdb/nat/aarch64-linux-hw-point.h +++ b/gdb/nat/aarch64-linux-hw-point.h -@@ -172,7 +172,7 @@ int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr, +@@ -176,7 +176,7 @@ int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr, int len, int is_insert, struct aarch64_debug_reg_state *state); int aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr, @@ -229,8 +259,8 @@ index 7c42b96d1b..e1d4fc8dbc 100644 + LONGEST len, int is_insert, struct aarch64_debug_reg_state *state); - void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state, -@@ -180,7 +180,7 @@ void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state, + void aarch64_linux_set_debug_regs (struct aarch64_debug_reg_state *state, +@@ -184,12 +184,12 @@ void aarch64_linux_set_debug_regs (struct aarch64_debug_reg_state *state, void aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state, const char *func, CORE_ADDR addr, @@ -239,11 +269,37 @@ index 7c42b96d1b..e1d4fc8dbc 100644 void aarch64_linux_get_debug_reg_capacity (int tid); + struct aarch64_debug_reg_state *aarch64_get_debug_reg_state (pid_t pid); + +-int aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, int len); ++int aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, LONGEST len); + + #endif /* AARCH64_LINUX_HW_POINT_H */ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c -index 4a82434c0d..49a27d8daa 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c -@@ -1798,11 +1798,11 @@ can_use_watchpoint_cond_accel (void) +@@ -282,7 +282,7 @@ struct ppc_linux_nat_target final : public linux_nat_target + int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) + override; + +- int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; ++ int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override; + + 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 + + bool stopped_data_address (CORE_ADDR *) override; + +- bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override; ++ bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) override; + +- bool can_accel_watchpoint_condition (CORE_ADDR, int, int, struct expression *) ++ bool can_accel_watchpoint_condition (CORE_ADDR, LONGEST, int, struct expression *) + override; + + int masked_watch_num_registers (CORE_ADDR, CORE_ADDR) override; +@@ -1659,11 +1659,11 @@ can_use_watchpoint_cond_accel (void) CONDITION_VALUE will hold the value which should be put in the DVC register. */ static void @@ -258,7 +314,7 @@ index 4a82434c0d..49a27d8daa 100644 CORE_ADDR addr_end_data, addr_end_dvc; /* The DVC register compares bytes within fixed-length windows which -@@ -1889,7 +1889,7 @@ num_memory_accesses (struct value *v) +@@ -1751,7 +1751,7 @@ num_memory_accesses (const std::vector &chain) of the constant. */ static int check_condition (CORE_ADDR watch_addr, struct expression *cond, @@ -266,17 +322,18 @@ index 4a82434c0d..49a27d8daa 100644 + CORE_ADDR *data_value, LONGEST *len) { int pc = 1, num_accesses_left, num_accesses_right; - struct value *left_val, *right_val, *left_chain, *right_chain; -@@ -1957,7 +1957,7 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond, + struct value *left_val, *right_val; +@@ -1802,7 +1802,8 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond, + the condition expression, thus only triggering the watchpoint when it is true. */ - static int - ppc_linux_can_accel_watchpoint_condition (struct target_ops *self, -- CORE_ADDR addr, int len, int rw, -+ CORE_ADDR addr, LONGEST len, int rw, - struct expression *cond) + bool +-ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr, int len, ++ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr, ++ LONGEST len, + int rw, + struct expression *cond) { - CORE_ADDR data_value; -@@ -1974,7 +1974,7 @@ ppc_linux_can_accel_watchpoint_condition (struct target_ops *self, +@@ -1820,7 +1821,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, @@ -285,20 +342,19 @@ index 4a82434c0d..49a27d8daa 100644 struct expression *cond, int insert) { if (len == 1 -@@ -2240,7 +2240,7 @@ ppc_linux_stopped_by_watchpoint (struct target_ops *ops) - static int - ppc_linux_watchpoint_addr_within_range (struct target_ops *target, - CORE_ADDR addr, -- CORE_ADDR start, int length) -+ CORE_ADDR start, LONGEST length) +@@ -2086,7 +2087,7 @@ ppc_linux_nat_target::stopped_by_watchpoint () + bool + ppc_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr, + CORE_ADDR start, +- int length) ++ LONGEST length) { int mask; diff --git a/gdb/procfs.c b/gdb/procfs.c -index 887f1201fe..edd1be632a 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c -@@ -1563,7 +1563,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr) +@@ -1561,7 +1561,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr) } static int @@ -307,7 +363,7 @@ index 887f1201fe..edd1be632a 100644 { struct { procfs_ctl_t cmd; -@@ -3250,7 +3250,7 @@ procfs_pid_to_str (struct target_ops *ops, ptid_t ptid) +@@ -3214,7 +3214,7 @@ procfs_target::pid_to_str (ptid_t ptid) /* Insert a watchpoint. */ static int @@ -317,10 +373,18 @@ index 887f1201fe..edd1be632a 100644 { int pflags = 0; diff --git a/gdb/remote.c b/gdb/remote.c -index 94d5594175..86777f1e5e 100644 --- a/gdb/remote.c +++ b/gdb/remote.c -@@ -9897,7 +9897,7 @@ remote_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, +@@ -454,7 +454,7 @@ public: + + bool stopped_data_address (CORE_ADDR *) override; + +- bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override; ++ bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) override; + + int can_use_hw_breakpoint (enum bptype, int, int) override; + +@@ -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); @@ -329,16 +393,16 @@ index 94d5594175..86777f1e5e 100644 putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); -@@ -9917,7 +9917,7 @@ remote_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, +@@ -10362,7 +10362,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, - static int - remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, -- CORE_ADDR start, int length) -+ CORE_ADDR start, LONGEST length) + bool + remote_target::watchpoint_addr_within_range (CORE_ADDR addr, +- CORE_ADDR start, int length) ++ CORE_ADDR start, LONGEST length) { CORE_ADDR diff = remote_address_masked (addr - start); -@@ -9946,7 +9946,7 @@ remote_remove_watchpoint (struct target_ops *self, 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); @@ -347,74 +411,113 @@ index 94d5594175..86777f1e5e 100644 putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); +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 +@@ -121,7 +121,7 @@ public: + override; + int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) + 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, diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c -index 2b449cbf01..f725215fff 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c -@@ -733,14 +733,14 @@ debug_stopped_data_address (struct target_ops *self, CORE_ADDR *arg1) +@@ -38,9 +38,9 @@ struct dummy_target : public target_ops + 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; + int region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) override; +- bool can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) override; ++ bool can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST 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; + bool supports_terminal_ours () override; +@@ -206,9 +206,9 @@ struct debug_target : public target_ops + 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; + int region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) override; +- bool can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) override; ++ bool can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST 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; + bool supports_terminal_ours () override; +@@ -1068,19 +1068,19 @@ debug_target::stopped_data_address (CORE_ADDR *arg0) } - static int --delegate_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3) -+delegate_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, LONGEST arg3) + bool +-target_ops::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) ++target_ops::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2) { - self = self->beneath; - return self->to_watchpoint_addr_within_range (self, arg1, arg2, arg3); + return this->beneath ()->watchpoint_addr_within_range (arg0, arg1, arg2); } - static int --debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3) -+debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, LONGEST arg3) + bool +-dummy_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) ++dummy_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2) { - int result; - fprintf_unfiltered (gdb_stdlog, "-> %s->to_watchpoint_addr_within_range (...)\n", debug_target.to_shortname); -@@ -752,7 +752,7 @@ debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, COR - fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_CORE_ADDR (arg2); - fputs_unfiltered (", ", gdb_stdlog); -- target_debug_print_int (arg3); -+ target_debug_print_LONGEST (arg3); - fputs_unfiltered (") = ", gdb_stdlog); - target_debug_print_int (result); - fputs_unfiltered ("\n", gdb_stdlog); -@@ -785,20 +785,20 @@ debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONG + return default_watchpoint_addr_within_range (this, arg0, arg1, arg2); } - static int --delegate_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4) -+delegate_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2, int arg3, struct expression *arg4) + bool +-debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) ++debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2) { - self = self->beneath; - return self->to_can_accel_watchpoint_condition (self, arg1, arg2, arg3, arg4); - } - - static int --tdefault_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4) -+tdefault_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2, int arg3, struct expression *arg4) - { - return 0; - } - - static int --debug_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4) -+debug_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2, int arg3, struct expression *arg4) - { - int result; - fprintf_unfiltered (gdb_stdlog, "-> %s->to_can_accel_watchpoint_condition (...)\n", debug_target.to_shortname); -@@ -808,7 +808,7 @@ debug_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, i + 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 fputs_unfiltered (", ", gdb_stdlog); target_debug_print_CORE_ADDR (arg1); fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_int (arg2); + target_debug_print_LONGEST (arg2); + 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) + } + + bool +-target_ops::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) ++target_ops::can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3) + { + return this->beneath ()->can_accel_watchpoint_condition (arg0, arg1, arg2, arg3); + } + + bool +-dummy_target::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) ++dummy_target::can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3) + { + return false; + } + + bool +-debug_target::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) ++debug_target::can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3) + { + 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 + fprintf_unfiltered (gdb_stdlog, "<- %s->can_accel_watchpoint_condition (", this->beneath ()->shortname ()); + target_debug_print_CORE_ADDR (arg0); fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_int (arg3); +- target_debug_print_int (arg1); ++ target_debug_print_LONGEST (arg1); + fputs_unfiltered (", ", gdb_stdlog); + target_debug_print_int (arg2); fputs_unfiltered (", ", gdb_stdlog); diff --git a/gdb/target.c b/gdb/target.c -index a1ac6d0697..eb0538cb82 100644 --- a/gdb/target.c +++ b/gdb/target.c -@@ -53,7 +53,7 @@ static void generic_tls_error (void) ATTRIBUTE_NORETURN; +@@ -56,7 +56,7 @@ static void generic_tls_error (void) ATTRIBUTE_NORETURN; static void default_terminal_info (struct target_ops *, const char *, int); static int default_watchpoint_addr_within_range (struct target_ops *, @@ -423,7 +526,7 @@ index a1ac6d0697..eb0538cb82 100644 static int default_region_ok_for_hw_watchpoint (struct target_ops *, CORE_ADDR, LONGEST); -@@ -3120,7 +3120,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self, +@@ -3189,7 +3189,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, @@ -433,27 +536,23 @@ index a1ac6d0697..eb0538cb82 100644 return addr >= start && addr < start + length; } diff --git a/gdb/target.h b/gdb/target.h -index 7a70c3f6da..35eee91a83 100644 --- a/gdb/target.h +++ b/gdb/target.h -@@ -535,7 +535,7 @@ struct target_ops - int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *) - TARGET_DEFAULT_RETURN (0); - int (*to_watchpoint_addr_within_range) (struct target_ops *, -- CORE_ADDR, CORE_ADDR, int) -+ CORE_ADDR, CORE_ADDR, LONGEST) +@@ -557,7 +557,7 @@ struct target_ops + TARGET_DEFAULT_RETURN (false); + virtual bool stopped_data_address (CORE_ADDR *) + TARGET_DEFAULT_RETURN (false); +- virtual bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) ++ virtual bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range); /* Documentation of this routine is provided with the corresponding -@@ -545,7 +545,7 @@ struct target_ops +@@ -565,7 +565,7 @@ struct target_ops + virtual int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint); - int (*to_can_accel_watchpoint_condition) (struct target_ops *, -- CORE_ADDR, int, int, -+ CORE_ADDR, LONGEST, int, - struct expression *) - TARGET_DEFAULT_RETURN (0); - int (*to_masked_watch_num_registers) (struct target_ops *, --- -2.14.3 - +- virtual bool can_accel_watchpoint_condition (CORE_ADDR, int, int, ++ virtual bool can_accel_watchpoint_condition (CORE_ADDR, LONGEST, int, + struct expression *) + TARGET_DEFAULT_RETURN (false); + virtual int masked_watch_num_registers (CORE_ADDR, CORE_ADDR) diff --git a/gdb-rhbz795424-bitpos-23of25.patch b/gdb-rhbz795424-bitpos-23of25.patch index 2b58bc3..b030e30 100644 --- a/gdb-rhbz795424-bitpos-23of25.patch +++ b/gdb-rhbz795424-bitpos-23of25.patch @@ -1,9 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: Bitpos expansion - tdep changes - -FileName: gdb-rhbz795424-bitpos-23of25.patch +Subject: gdb-rhbz795424-bitpos-23of25.patch ;; Fix `GDB cannot access struct member whose offset is larger than 256MB' ;; (RH BZ 795424). @@ -145,48 +143,11 @@ gdb/ChangeLog Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-tdep.patch ---- - gdb/alpha-tdep.c | 14 +++++++------- - gdb/amd64-tdep.c | 8 ++++---- - gdb/amd64-windows-tdep.c | 2 +- - gdb/arm-tdep.c | 20 +++++++++++--------- - gdb/avr-tdep.c | 10 +++++----- - gdb/bfin-tdep.c | 4 ++-- - gdb/cris-tdep.c | 12 ++++++------ - gdb/h8300-tdep.c | 8 ++++---- - gdb/hppa-tdep.c | 4 ++-- - gdb/i386-darwin-tdep.c | 2 +- - gdb/i386-tdep.c | 14 +++++++------- - gdb/iq2000-tdep.c | 5 +++-- - gdb/m32r-tdep.c | 2 +- - gdb/m68k-tdep.c | 8 ++++---- - gdb/m88k-tdep.c | 8 ++++---- - gdb/mep-tdep.c | 2 +- - gdb/mips-tdep.c | 48 ++++++++++++++++++++++++------------------------ - gdb/mn10300-tdep.c | 2 +- - gdb/mt-tdep.c | 4 ++-- - gdb/ppc-sysv-tdep.c | 23 ++++++++++++----------- - gdb/rl78-tdep.c | 4 ++-- - gdb/rs6000-aix-tdep.c | 6 +++--- - gdb/s390-linux-tdep.c | 6 +++--- - gdb/score-tdep.c | 2 +- - gdb/sh-tdep.c | 10 ++++++---- - gdb/sh64-tdep.c | 4 ++-- - gdb/sparc64-tdep.c | 12 ++++++------ - gdb/spu-tdep.c | 4 ++-- - gdb/tic6x-tdep.c | 9 +++++---- - gdb/tilegx-tdep.c | 2 +- - gdb/v850-tdep.c | 4 ++-- - gdb/vax-tdep.c | 4 ++-- - gdb/xstormy16-tdep.c | 5 +++-- - gdb/xtensa-tdep.c | 22 +++++++++++----------- - 34 files changed, 151 insertions(+), 143 deletions(-) diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c -index ea53b9ee10..34dfb661f8 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c -@@ -301,17 +301,17 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -299,17 +299,17 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int i; @@ -208,7 +169,7 @@ index ea53b9ee10..34dfb661f8 100644 CORE_ADDR func_addr = find_function_addr (function, NULL); /* The ABI places the address of the called function in T12. */ -@@ -431,8 +431,8 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -429,8 +429,8 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = nargs; m_arg--, --i >= 0;) { const gdb_byte *contents = m_arg->contents; @@ -219,7 +180,7 @@ index ea53b9ee10..34dfb661f8 100644 /* Copy the bytes destined for registers into arg_reg_buffer. */ if (offset < sizeof(arg_reg_buffer)) -@@ -444,7 +444,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -442,7 +442,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else { @@ -229,10 +190,9 @@ index ea53b9ee10..34dfb661f8 100644 offset += tlen; contents += tlen; diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c -index 651794a41f..c96790a6af 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c -@@ -880,8 +880,8 @@ amd64_push_arguments (struct regcache *regcache, int nargs, +@@ -878,8 +878,8 @@ amd64_push_arguments (struct regcache *regcache, int nargs, }; struct value **stack_args = XALLOCAVEC (struct value *, nargs); int num_stack_args = 0; @@ -243,7 +203,7 @@ index 651794a41f..c96790a6af 100644 int integer_reg = 0; int sse_reg = 0; int i; -@@ -893,7 +893,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, +@@ -891,7 +891,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); @@ -252,17 +212,16 @@ index 651794a41f..c96790a6af 100644 enum amd64_reg_class theclass[2]; int needed_integer_regs = 0; int needed_sse_regs = 0; -@@ -957,7 +957,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, +@@ -955,7 +955,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, gdb_assert (regnum != -1); memset (buf, 0, sizeof buf); - memcpy (buf, valbuf + j * 8, std::min (len, 8)); + memcpy (buf, valbuf + j * 8, std::min (len, (LONGEST) 8)); - regcache_raw_write_part (regcache, regnum, offset, 8, buf); + regcache->raw_write_part (regnum, offset, 8, buf); } } diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c -index 32ebead05d..2e388f2440 100644 --- a/gdb/amd64-windows-tdep.c +++ b/gdb/amd64-windows-tdep.c @@ -291,7 +291,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function, @@ -275,10 +234,9 @@ index 32ebead05d..2e388f2440 100644 /* See if our value is returned through a register. If it is, then diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c -index bc83326ae7..d38dd4918b 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c -@@ -3477,7 +3477,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc_base_type b) +@@ -3468,7 +3468,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. */ @@ -287,7 +245,7 @@ index bc83326ae7..d38dd4918b 100644 arm_vfp_cprc_sub_candidate (struct type *t, enum arm_vfp_cprc_base_type *base_type) { -@@ -3560,7 +3560,7 @@ arm_vfp_cprc_sub_candidate (struct type *t, +@@ -3551,7 +3551,7 @@ arm_vfp_cprc_sub_candidate (struct type *t, } else { @@ -296,7 +254,7 @@ index bc83326ae7..d38dd4918b 100644 unsigned unitlen; count = arm_vfp_cprc_sub_candidate (TYPE_TARGET_TYPE (t), -@@ -3583,12 +3583,12 @@ arm_vfp_cprc_sub_candidate (struct type *t, +@@ -3574,12 +3574,12 @@ arm_vfp_cprc_sub_candidate (struct type *t, case TYPE_CODE_STRUCT: { @@ -311,7 +269,7 @@ index bc83326ae7..d38dd4918b 100644 if (!field_is_static (&TYPE_FIELD (t, i))) sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i), -@@ -3612,13 +3612,15 @@ arm_vfp_cprc_sub_candidate (struct type *t, +@@ -3603,13 +3603,15 @@ arm_vfp_cprc_sub_candidate (struct type *t, case TYPE_CODE_UNION: { @@ -330,7 +288,7 @@ index bc83326ae7..d38dd4918b 100644 if (sub_count == -1) return -1; count = (count > sub_count ? count : sub_count); -@@ -3654,7 +3656,7 @@ arm_vfp_call_candidate (struct type *t, enum arm_vfp_cprc_base_type *base_type, +@@ -3645,7 +3647,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; @@ -339,7 +297,7 @@ index bc83326ae7..d38dd4918b 100644 if (c <= 0 || c > 4) return 0; *base_type = b; -@@ -3735,7 +3737,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -3726,7 +3728,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { @@ -349,10 +307,9 @@ index bc83326ae7..d38dd4918b 100644 struct type *target_type; enum type_code typecode; diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c -index aa65a76e07..f74b927854 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c -@@ -1191,13 +1191,13 @@ avr_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) +@@ -1192,13 +1192,13 @@ avr_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) struct stack_item { @@ -368,7 +325,7 @@ index aa65a76e07..f74b927854 100644 { struct stack_item *si; si = XNEW (struct stack_item); -@@ -1285,12 +1285,12 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -1286,12 +1286,12 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < nargs; i++) { @@ -385,7 +342,6 @@ index aa65a76e07..f74b927854 100644 /* Calculate the potential last register needed. E.g. For length 2, registers regnum and regnum-1 (say 25 and 24) diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c -index d87fd4d896..f8b02daf29 100644 --- a/gdb/bfin-tdep.c +++ b/gdb/bfin-tdep.c @@ -504,7 +504,7 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, @@ -407,7 +363,6 @@ index d87fd4d896..f8b02daf29 100644 sp -= container_len; write_memory (sp, value_contents (args[i]), container_len); diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c -index 5fa79ef2cf..1c99356746 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -663,13 +663,13 @@ static CORE_ADDR cris_unwind_sp (struct gdbarch *gdbarch, @@ -445,7 +400,6 @@ index 5fa79ef2cf..1c99356746 100644 /* How may registers worth of storage do we need for this argument? */ reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0); diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c -index 809a647984..6c7059fff4 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -637,7 +637,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, @@ -481,10 +435,9 @@ index 809a647984..6c7059fff4 100644 for (offset = 0; offset < padded_len; offset += wordsize) { diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c -index 513f0e0391..0872d5e809 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c -@@ -989,7 +989,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -984,7 +984,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = value_type (arg); @@ -493,7 +446,7 @@ index 513f0e0391..0872d5e809 100644 const bfd_byte *valbuf; bfd_byte fptrbuf[8]; int regnum; -@@ -1184,7 +1184,7 @@ hppa64_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -1177,7 +1177,7 @@ hppa64_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { @@ -503,7 +456,6 @@ index 513f0e0391..0872d5e809 100644 if (len > 16) diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c -index 7ee2f4cf2a..b811296b0d 100644 --- a/gdb/i386-darwin-tdep.c +++ b/gdb/i386-darwin-tdep.c @@ -166,7 +166,7 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, @@ -516,10 +468,9 @@ index 7ee2f4cf2a..b811296b0d 100644 if (struct_return) diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c -index af4942ab2e..6b1586a9e3 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c -@@ -2677,7 +2677,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -2678,7 +2678,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte buf[4]; int i; int write_pass; @@ -528,7 +479,7 @@ index af4942ab2e..6b1586a9e3 100644 /* BND registers can be in arbitrary values at the moment of the inferior call. This can cause boundary violations that are not -@@ -2692,7 +2692,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -2693,7 +2693,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (write_pass = 0; write_pass < 2; write_pass++) { @@ -537,7 +488,7 @@ index af4942ab2e..6b1586a9e3 100644 if (struct_return) { -@@ -2709,7 +2709,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -2710,7 +2710,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < nargs; i++) { @@ -546,7 +497,7 @@ index af4942ab2e..6b1586a9e3 100644 if (write_pass) { -@@ -2916,7 +2916,7 @@ i386_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type) +@@ -2917,7 +2917,7 @@ i386_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum type_code code = TYPE_CODE (type); @@ -555,7 +506,7 @@ index af4942ab2e..6b1586a9e3 100644 gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION -@@ -3738,7 +3738,7 @@ static int +@@ -3703,7 +3703,7 @@ static int i386_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) { @@ -564,7 +515,7 @@ index af4942ab2e..6b1586a9e3 100644 /* Values may be spread across multiple registers. Most debugging formats aren't expressive enough to specify the locations, so -@@ -3771,7 +3771,7 @@ i386_register_to_value (struct frame_info *frame, int regnum, +@@ -3736,7 +3736,7 @@ i386_register_to_value (struct frame_info *frame, int regnum, int *optimizedp, int *unavailablep) { struct gdbarch *gdbarch = get_frame_arch (frame); @@ -573,7 +524,7 @@ index af4942ab2e..6b1586a9e3 100644 if (i386_fp_regnum_p (gdbarch, regnum)) return i387_register_to_value (frame, regnum, type, to, -@@ -3807,7 +3807,7 @@ static void +@@ -3772,7 +3772,7 @@ static void i386_value_to_register (struct frame_info *frame, int regnum, struct type *type, const gdb_byte *from) { @@ -583,7 +534,6 @@ index af4942ab2e..6b1586a9e3 100644 if (i386_fp_regnum_p (get_frame_arch (frame), regnum)) { diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c -index f8e2f234e0..b703c2cae4 100644 --- a/gdb/iq2000-tdep.c +++ b/gdb/iq2000-tdep.c @@ -651,8 +651,9 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, @@ -599,10 +549,9 @@ index f8e2f234e0..b703c2cae4 100644 CORE_ADDR struct_ptr; diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c -index 0fe6754412..9a27740691 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c -@@ -679,7 +679,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -671,7 +671,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, CORE_ADDR regval; gdb_byte *val; gdb_byte valbuf[M32R_ARG_REGISTER_SIZE]; @@ -612,10 +561,9 @@ index 0fe6754412..9a27740691 100644 /* First force sp to a 4-byte alignment. */ sp = sp & ~3; diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c -index b9fa5e6d4c..2320e61a69 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c -@@ -373,7 +373,7 @@ m68k_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type) +@@ -372,7 +372,7 @@ m68k_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum type_code code = TYPE_CODE (type); @@ -624,7 +572,7 @@ index b9fa5e6d4c..2320e61a69 100644 gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION || code == TYPE_CODE_COMPLEX); -@@ -505,9 +505,9 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -504,9 +504,9 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); @@ -637,42 +585,10 @@ index b9fa5e6d4c..2320e61a69 100644 /* Non-scalars bigger than 4 bytes are left aligned, others are right aligned. */ -diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c -index 6a50126548..5a3a67a06a 100644 ---- a/gdb/m88k-tdep.c -+++ b/gdb/m88k-tdep.c -@@ -254,13 +254,13 @@ m88k_store_arguments (struct regcache *regcache, int nargs, - { - struct gdbarch *gdbarch = regcache->arch (); - int num_register_words = 0; -- int num_stack_words = 0; -+ LONGEST num_stack_words = 0; - int i; - - for (i = 0; i < nargs; i++) - { - struct type *type = value_type (args[i]); -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - - if (m88k_integral_or_pointer_p (type) && len < 4) - { -@@ -302,8 +302,8 @@ m88k_store_arguments (struct regcache *regcache, int nargs, - { - const bfd_byte *valbuf = value_contents (args[i]); - struct type *type = value_type (args[i]); -- int len = TYPE_LENGTH (type); -- int stack_word = num_stack_words; -+ LONGEST len = TYPE_LENGTH (type); -+ LONGEST stack_word = num_stack_words; - - if (m88k_in_register_p (type)) - { diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c -index ecfd4f36db..0cc4574425 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c -@@ -2253,7 +2253,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv, +@@ -2239,7 +2239,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv, for (i = 0; i < argc; i++) { @@ -682,10 +598,9 @@ index ecfd4f36db..0cc4574425 100644 if (arg_len > MEP_GPR_SIZE) { diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c -index 981959ad4b..9572f92f65 100644 --- 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, @@ -694,7 +609,7 @@ index 981959ad4b..9572f92f65 100644 { 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, @@ -705,7 +620,7 @@ index 981959ad4b..9572f92f65 100644 if (mips_debug && out != NULL) { int i; -@@ -4533,13 +4533,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)); @@ -722,7 +637,7 @@ index 981959ad4b..9572f92f65 100644 /* The EABI passes structures that do not fit in a register by reference. */ -@@ -4809,7 +4809,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, @@ -731,7 +646,7 @@ index 981959ad4b..9572f92f65 100644 { int i; -@@ -4824,7 +4824,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++) { @@ -740,7 +655,7 @@ index 981959ad4b..9572f92f65 100644 struct type *field_type; /* We're only looking at normal fields. */ -@@ -4866,7 +4866,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; @@ -749,7 +664,7 @@ index 981959ad4b..9572f92f65 100644 int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5217,11 +5217,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) { @@ -765,7 +680,7 @@ index 981959ad4b..9572f92f65 100644 if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) { /* A 16-byte long double field goes in two consecutive -@@ -5263,8 +5263,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) @@ -776,7 +691,7 @@ index 981959ad4b..9572f92f65 100644 mips_xfer_register (gdbarch, regcache, gdbarch_num_regs (gdbarch) + regnum, xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf, -@@ -5322,7 +5322,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; @@ -785,7 +700,7 @@ index 981959ad4b..9572f92f65 100644 int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5386,13 +5386,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)); @@ -802,7 +717,7 @@ index 981959ad4b..9572f92f65 100644 val = value_contents (arg); -@@ -5846,8 +5846,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; @@ -813,7 +728,7 @@ index 981959ad4b..9572f92f65 100644 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5907,13 +5907,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)); @@ -831,10 +746,9 @@ index 981959ad4b..9572f92f65 100644 val = value_contents (arg); diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c -index 93c02d67b4..17ce536a90 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c -@@ -1212,7 +1212,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, +@@ -1197,7 +1197,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); const int push_size = register_size (gdbarch, E_PC_REGNUM); int regs_used; @@ -843,24 +757,7 @@ index 93c02d67b4..17ce536a90 100644 int stack_offset = 0; int argnum; const gdb_byte *val; -diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c -index a4ad0c65f1..953002a7c6 100644 ---- a/gdb/mt-tdep.c -+++ b/gdb/mt-tdep.c -@@ -789,9 +789,9 @@ mt_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - gdb_byte buf[MT_MAX_STRUCT_SIZE]; - int argreg = MT_1ST_ARGREG; - int split_param_len = 0; -- int stack_dest = sp; -+ LONGEST stack_dest = sp; - int slacklen; -- int typelen; -+ LONGEST typelen; - int i, j; - - /* First handle however many args we can fit into MT_1ST_ARGREG thru diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c -index a6ba5d0ffd..184b7d6261 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -68,7 +68,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, @@ -893,7 +790,7 @@ index a6ba5d0ffd..184b7d6261 100644 const bfd_byte *val = value_contents (arg); if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8 -@@ -1285,11 +1285,11 @@ struct ppc64_sysv_argpos +@@ -1246,11 +1246,11 @@ struct ppc64_sysv_argpos static void ppc64_sysv_abi_push_val (struct gdbarch *gdbarch, @@ -907,16 +804,16 @@ index a6ba5d0ffd..184b7d6261 100644 /* Enforce alignment of stack location, if requested. */ if (align > tdep->wordsize) -@@ -1327,7 +1327,7 @@ ppc64_sysv_abi_push_val (struct gdbarch *gdbarch, +@@ -1287,7 +1287,7 @@ ppc64_sysv_abi_push_val (struct gdbarch *gdbarch, + { if (argpos->regcache && argpos->greg <= 10) - regcache_cooked_write_part (argpos->regcache, - tdep->ppc_gp0_regnum + argpos->greg, -- offset, len, val); -+ offset, (LONGEST) len, val); + argpos->regcache->cooked_write_part +- (tdep->ppc_gp0_regnum + argpos->greg, offset, len, val); ++ (tdep->ppc_gp0_regnum + argpos->greg, offset, (LONGEST) len, val); argpos->greg++; } } -@@ -1386,7 +1386,7 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch, +@@ -1346,7 +1346,7 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch, if (argpos->regcache && argpos->freg <= 13) { int regnum = tdep->ppc_fp0_regnum + argpos->freg; @@ -925,7 +822,7 @@ index a6ba5d0ffd..184b7d6261 100644 if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) offset = 8 - TYPE_LENGTH (type); -@@ -1836,7 +1836,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, +@@ -1795,7 +1795,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, && TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT) { int regnum = tdep->ppc_fp0_regnum + 1 + index; @@ -934,7 +831,7 @@ index a6ba5d0ffd..184b7d6261 100644 if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) offset = 8 - TYPE_LENGTH (valtype); -@@ -1912,7 +1912,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, +@@ -1871,7 +1871,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, && TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype)) { int regnum = tdep->ppc_gp0_regnum + 3 + index; @@ -943,7 +840,7 @@ index a6ba5d0ffd..184b7d6261 100644 if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) offset = 8 - TYPE_LENGTH (valtype); -@@ -2020,7 +2020,8 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, +@@ -1979,7 +1979,8 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1) { int regnum = tdep->ppc_gp0_regnum + 3; @@ -952,12 +849,11 @@ index a6ba5d0ffd..184b7d6261 100644 + = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype)); if (writebuf != NULL) - regcache_cooked_write_part (regcache, regnum, + regcache->cooked_write_part (regnum, offset, TYPE_LENGTH (valtype), diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c -index 3db72a1e96..0f4172d553 100644 --- a/gdb/rl78-tdep.c +++ b/gdb/rl78-tdep.c -@@ -1347,8 +1347,8 @@ rl78_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -1346,8 +1346,8 @@ rl78_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); @@ -969,10 +865,9 @@ index 3db72a1e96..0f4172d553 100644 sp -= container_len; write_memory (rl78_make_data_address (sp), diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c -index 38c86d4cd8..f6d4816401 100644 --- a/gdb/rs6000-aix-tdep.c +++ b/gdb/rs6000-aix-tdep.c -@@ -187,9 +187,9 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -177,9 +177,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; @@ -984,7 +879,7 @@ index 38c86d4cd8..f6d4816401 100644 gdb_byte tmp_buffer[50]; int f_argno = 0; /* current floating point argno */ int wordsize = gdbarch_tdep (gdbarch)->wordsize; -@@ -319,7 +319,7 @@ ran_out_of_registers_for_arguments: +@@ -307,7 +307,7 @@ ran_out_of_registers_for_arguments: if ((argno < nargs) || argbytes) { @@ -993,39 +888,7 @@ index 38c86d4cd8..f6d4816401 100644 if (argbytes) { -diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c -index bdde5c34c8..975b072b39 100644 ---- a/gdb/s390-linux-tdep.c -+++ b/gdb/s390-linux-tdep.c -@@ -3132,7 +3132,7 @@ s390_function_arg_vector (struct type *type) - /* Determine whether N is a power of two. */ - - static int --is_power_of_two (unsigned int n) -+is_power_of_two (ULONGEST n) - { - return n && ((n & (n - 1)) == 0); - } -@@ -3189,7 +3189,7 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg, - enum bfd_endian byte_order, int is_unnamed) - { - struct type *type = check_typedef (value_type (arg)); -- unsigned int length = TYPE_LENGTH (type); -+ LONGEST length = TYPE_LENGTH (type); - int write_mode = as->regcache != NULL; - - if (s390_function_arg_float (type)) -@@ -3452,7 +3452,7 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type, - { - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int word_size = gdbarch_ptr_bit (gdbarch) / 8; -- int length = TYPE_LENGTH (type); -+ LONGEST length = TYPE_LENGTH (type); - int code = TYPE_CODE (type); - - if (code == TYPE_CODE_FLT || code == TYPE_CODE_DECFLOAT) diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c -index a167932327..4674eb7900 100644 --- a/gdb/score-tdep.c +++ b/gdb/score-tdep.c @@ -516,7 +516,7 @@ score_push_dummy_call (struct gdbarch *gdbarch, struct value *function, @@ -1038,10 +901,9 @@ index a167932327..4674eb7900 100644 CORE_ADDR addr = 0; diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c -index fbc5c9f1d0..1f6052fa97 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c -@@ -813,7 +813,7 @@ sh_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) +@@ -812,7 +812,7 @@ sh_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) static int sh_use_struct_convention (int renesas_abi, struct type *type) { @@ -1050,7 +912,7 @@ index fbc5c9f1d0..1f6052fa97 100644 int nelem = TYPE_NFIELDS (type); /* The Renesas ABI returns aggregate types always on stack. */ -@@ -915,7 +915,7 @@ sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp) +@@ -914,7 +914,7 @@ sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp) /* Helper function to justify value in register according to endianess. */ static const gdb_byte * @@ -1059,7 +921,7 @@ index fbc5c9f1d0..1f6052fa97 100644 { static gdb_byte valbuf[4]; -@@ -1075,7 +1075,8 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch, +@@ -1074,7 +1074,8 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch, struct type *type; CORE_ADDR regval; const gdb_byte *val; @@ -1069,7 +931,7 @@ index fbc5c9f1d0..1f6052fa97 100644 int pass_on_stack = 0; int treat_as_flt; int last_reg_arg = INT_MAX; -@@ -1216,7 +1217,8 @@ sh_push_dummy_call_nofpu (struct gdbarch *gdbarch, +@@ -1215,7 +1216,8 @@ sh_push_dummy_call_nofpu (struct gdbarch *gdbarch, struct type *type; CORE_ADDR regval; const gdb_byte *val; @@ -1079,30 +941,7 @@ index fbc5c9f1d0..1f6052fa97 100644 int pass_on_stack = 0; int last_reg_arg = INT_MAX; -diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c -index ad533c9d79..7700e68402 100644 ---- a/gdb/sh64-tdep.c -+++ b/gdb/sh64-tdep.c -@@ -1079,7 +1079,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, - CORE_ADDR struct_addr) - { - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); -- int stack_offset, stack_alloc; -+ LONGEST stack_offset, stack_alloc; - int int_argreg; - int float_arg_index = 0; - int double_arg_index = 0; -@@ -1088,7 +1088,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, - CORE_ADDR regval; - const gdb_byte *val; - gdb_byte valbuf[8]; -- int len; -+ LONGEST len; - int argreg_size; - int fp_args[12]; - diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c -index 7400c24fc5..39db22947c 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -1205,7 +1205,7 @@ sparc64_16_byte_align_p (struct type *type) @@ -1160,10 +999,9 @@ index 7400c24fc5..39db22947c 100644 gdb_byte buf[16]; diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c -index b82bb0ebc3..f87e6f57e1 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c -@@ -1430,7 +1430,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -1431,7 +1431,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); const gdb_byte *contents = value_contents (arg); @@ -1172,7 +1010,7 @@ index b82bb0ebc3..f87e6f57e1 100644 /* If the argument doesn't wholly fit into registers, it and all subsequent arguments go to the stack. */ -@@ -1462,7 +1462,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -1463,7 +1463,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); @@ -1182,10 +1020,9 @@ index b82bb0ebc3..f87e6f57e1 100644 if (spu_scalar_value_p (type)) diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c -index f11763d992..6192692a00 100644 --- a/gdb/tic6x-tdep.c +++ b/gdb/tic6x-tdep.c -@@ -883,7 +883,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -881,7 +881,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg = 0; int argnum; int stack_offset = 4; @@ -1194,7 +1031,7 @@ index f11763d992..6192692a00 100644 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); -@@ -917,7 +917,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -915,7 +915,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++) { @@ -1203,7 +1040,7 @@ index f11763d992..6192692a00 100644 if (argnum >= 10 - argreg) references_offset += len; stack_offset += len; -@@ -936,7 +936,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -934,7 +934,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)); @@ -1212,7 +1049,7 @@ index f11763d992..6192692a00 100644 enum type_code typecode = TYPE_CODE (arg_type); val = value_contents (arg); -@@ -1096,7 +1096,8 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, +@@ -1090,7 +1090,8 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else internal_error (__FILE__, __LINE__, @@ -1223,7 +1060,6 @@ index f11763d992..6192692a00 100644 addr = sp + stack_offset; write_memory (addr, val, len); diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c -index 8f688b16cf..5152c9eece 100644 --- a/gdb/tilegx-tdep.c +++ b/gdb/tilegx-tdep.c @@ -288,7 +288,7 @@ tilegx_push_dummy_call (struct gdbarch *gdbarch, @@ -1236,7 +1072,6 @@ index 8f688b16cf..5152c9eece 100644 /* If struct_return is 1, then the struct return address will diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c -index ac7d6aa424..6e440e533f 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -1019,7 +1019,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch, @@ -1258,7 +1093,6 @@ index ac7d6aa424..6e440e533f 100644 gdb_byte valbuf[v850_reg_size]; diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c -index bd69fd2f48..5755c91eff 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -110,7 +110,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, @@ -1280,7 +1114,6 @@ index bd69fd2f48..5755c91eff 100644 sp -= (len + 3) & ~3; count += (len + 3) / 4; diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c -index 31650ac3a9..91b088251c 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -232,8 +232,9 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch, @@ -1296,10 +1129,9 @@ index 31650ac3a9..91b088251c 100644 gdb_byte buf[xstormy16_pc_size]; diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c -index e09592a94e..95133a5871 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c -@@ -1628,8 +1628,7 @@ xtensa_store_return_value (struct type *type, +@@ -1626,8 +1626,7 @@ xtensa_store_return_value (struct type *type, if (len > (callsize > 8 ? 8 : 16)) internal_error (__FILE__, __LINE__, @@ -1309,7 +1141,7 @@ index e09592a94e..95133a5871 100644 areg = arreg_number (gdbarch, gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb); -@@ -1703,18 +1702,18 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1701,18 +1700,18 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int i; @@ -1331,7 +1163,7 @@ index e09592a94e..95133a5871 100644 int regno; /* regno if in register. */ } u; }; -@@ -1738,9 +1737,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1736,9 +1735,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); @@ -1345,7 +1177,7 @@ index e09592a94e..95133a5871 100644 switch (TYPE_CODE (arg_type)) { case TYPE_CODE_INT: -@@ -1810,8 +1810,8 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1808,8 +1808,8 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long); break; } @@ -1355,7 +1187,7 @@ index e09592a94e..95133a5871 100644 /* Align size and onstack_size. */ size = (size + info->align - 1) & ~(info->align - 1); -@@ -1856,7 +1856,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1854,7 +1854,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, if (info->onstack) { @@ -1364,7 +1196,7 @@ index e09592a94e..95133a5871 100644 CORE_ADDR offset = sp + info->u.offset; /* Odd-sized structs are aligned to the lower side of a memory -@@ -1872,7 +1872,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, +@@ -1870,7 +1870,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, } else { @@ -1373,6 +1205,3 @@ index e09592a94e..95133a5871 100644 const bfd_byte *cp = info->contents; int r = info->u.regno; --- -2.14.3 - diff --git a/gdb-rhbz795424-bitpos-25of25-test.patch b/gdb-rhbz795424-bitpos-25of25-test.patch index 50a25d2..7a376ee 100644 --- a/gdb-rhbz795424-bitpos-25of25-test.patch +++ b/gdb-rhbz795424-bitpos-25of25-test.patch @@ -1,9 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: Expand fortran array bounds sizes to LONGEST - -FileName: gdb-rhbz795424-bitpos-25of25-test.patch +Subject: gdb-rhbz795424-bitpos-25of25-test.patch ;; Fix `GDB cannot access struct member whose offset is larger than 256MB' ;; (RH BZ 795424). @@ -28,18 +26,9 @@ Jan * gdb.fortran/array-bounds.exp: New test file. * gdb.fortran/array-bounds.f: New test file. * gdb.fortran/array-bounds.S: New test file. ---- - gdb/testsuite/gdb.fortran/array-bounds.S | 529 +++++++++++++++++++++++++++++ - gdb/testsuite/gdb.fortran/array-bounds.exp | 43 +++ - gdb/testsuite/gdb.fortran/array-bounds.f | 22 ++ - 3 files changed, 594 insertions(+) - create mode 100644 gdb/testsuite/gdb.fortran/array-bounds.S - create mode 100644 gdb/testsuite/gdb.fortran/array-bounds.exp - create mode 100644 gdb/testsuite/gdb.fortran/array-bounds.f diff --git a/gdb/testsuite/gdb.fortran/array-bounds.S b/gdb/testsuite/gdb.fortran/array-bounds.S new file mode 100644 -index 0000000000..463a427650 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/array-bounds.S @@ -0,0 +1,529 @@ @@ -574,7 +563,6 @@ index 0000000000..463a427650 + .section .note.GNU-stack,"",@progbits diff --git a/gdb/testsuite/gdb.fortran/array-bounds.exp b/gdb/testsuite/gdb.fortran/array-bounds.exp new file mode 100644 -index 0000000000..ba0ebe13b8 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/array-bounds.exp @@ -0,0 +1,43 @@ @@ -623,7 +611,6 @@ index 0000000000..ba0ebe13b8 +gdb_test "print &bar" {.*\(-4294967297:-4294967296\).*} diff --git a/gdb/testsuite/gdb.fortran/array-bounds.f b/gdb/testsuite/gdb.fortran/array-bounds.f new file mode 100644 -index 0000000000..78b36e6c27 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/array-bounds.f @@ -0,0 +1,22 @@ @@ -649,6 +636,3 @@ index 0000000000..78b36e6c27 + stop + end + --- -2.14.3 - diff --git a/gdb-rhbz795424-bitpos-25of25.patch b/gdb-rhbz795424-bitpos-25of25.patch index b94d180..87d1cbc 100644 --- a/gdb-rhbz795424-bitpos-25of25.patch +++ b/gdb-rhbz795424-bitpos-25of25.patch @@ -1,9 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: Expand fortran array bounds sizes to LONGEST - -FileName: gdb-rhbz795424-bitpos-25of25.patch +Subject: gdb-rhbz795424-bitpos-25of25.patch ;; Fix `GDB cannot access struct member whose offset is larger than 256MB' ;; (RH BZ 795424). @@ -55,17 +53,11 @@ testsuite/ChangeLog: Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=f77-bounds.patch ---- - gdb/f-lang.h | 4 ++-- - gdb/f-typeprint.c | 10 +++++----- - gdb/f-valprint.c | 4 ++-- - 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gdb/f-lang.h b/gdb/f-lang.h -index 9171a13bdf..9ec58f808e 100644 --- a/gdb/f-lang.h +++ b/gdb/f-lang.h -@@ -49,9 +49,9 @@ struct common_block +@@ -47,9 +47,9 @@ struct common_block struct symbol *contents[1]; }; @@ -78,7 +70,6 @@ index 9171a13bdf..9ec58f808e 100644 extern void f77_get_dynamic_array_length (struct type *); diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c -index 4f6a0ed09a..c330522913 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -149,7 +149,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, @@ -117,7 +108,7 @@ index 4f6a0ed09a..c330522913 100644 int index; QUIT; -@@ -365,7 +365,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, +@@ -370,7 +370,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, else { upper_bound = f77_get_upperbound (type); @@ -127,7 +118,6 @@ index 4f6a0ed09a..c330522913 100644 break; diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c -index 0772f359f0..03400ae431 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -41,7 +41,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; @@ -148,6 +138,3 @@ index 0772f359f0..03400ae431 100644 f77_get_upperbound (struct type *type) { if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) --- -2.14.3 - diff --git a/gdb-rhbz795424-bitpos-lazyvalue.patch b/gdb-rhbz795424-bitpos-lazyvalue.patch index 807d33a..d87e308 100644 --- a/gdb-rhbz795424-bitpos-lazyvalue.patch +++ b/gdb-rhbz795424-bitpos-lazyvalue.patch @@ -3,25 +3,12 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz795424-bitpos-lazyvalue.patch -FileName: gdb-rhbz795424-bitpos-lazyvalue.patch - ;; Fix `GDB cannot access struct member whose offset is larger than 256MB' ;; (RH BZ 795424). ;;=push ---- - gdb/testsuite/gdb.base/longest-types-64bit.S | 249 ++++++++++++++++++++++ - gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu | 67 ++++++ - gdb/testsuite/gdb.base/longest-types-64bit.c | 28 +++ - gdb/testsuite/gdb.base/longest-types-64bit.exp | 59 +++++ - 4 files changed, 403 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.S - create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu - create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.c - create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.exp diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.S b/gdb/testsuite/gdb.base/longest-types-64bit.S new file mode 100644 -index 0000000000..336d3fdb7a --- /dev/null +++ b/gdb/testsuite/gdb.base/longest-types-64bit.S @@ -0,0 +1,249 @@ @@ -276,7 +263,6 @@ index 0000000000..336d3fdb7a + .section .note.GNU-stack,"",@progbits diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu b/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu new file mode 100644 -index 0000000000..4007da2917 --- /dev/null +++ b/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu @@ -0,0 +1,67 @@ @@ -349,7 +335,6 @@ index 0000000000..4007da2917 +end diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.c b/gdb/testsuite/gdb.base/longest-types-64bit.c new file mode 100644 -index 0000000000..1394c08bdc --- /dev/null +++ b/gdb/testsuite/gdb.base/longest-types-64bit.c @@ -0,0 +1,28 @@ @@ -383,7 +368,6 @@ index 0000000000..1394c08bdc +} diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.exp b/gdb/testsuite/gdb.base/longest-types-64bit.exp new file mode 100644 -index 0000000000..4871dec72f --- /dev/null +++ b/gdb/testsuite/gdb.base/longest-types-64bit.exp @@ -0,0 +1,59 @@ @@ -446,6 +430,3 @@ index 0000000000..4871dec72f +} + +test "native" --- -2.14.3 - diff --git a/gdb-rhbz881849-ipv6-1of3.patch b/gdb-rhbz881849-ipv6-1of3.patch new file mode 100644 index 0000000..9e84f19 --- /dev/null +++ b/gdb-rhbz881849-ipv6-1of3.patch @@ -0,0 +1,1934 @@ +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-08-21 Alan Hayward + + * gdb.texinfo (AArch64 SVE): New subsubsection. +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-08-26 Simon Marchi + + PR gdb/23374 +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-08-31 Tom Tromey + + * gdb.rust/simple.rs: Rename second variable "v". +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 new file mode 100644 index 0000000..52dad20 --- /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..bea46f7 --- /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-09-05 Joel Brobecker + + * version.in: Set GDB version number to 8.2. +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-rhbz947564-findvar-assertion-frame-failed-testcase.patch b/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch index 53e5515..c4b1a01 100644 --- a/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +++ b/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch @@ -3,21 +3,12 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -FileName: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.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 ---- - gdb/testsuite/gdb.threads/tls-rhbz947564.cc | 53 ++++++++++++++++++++ - gdb/testsuite/gdb.threads/tls-rhbz947564.exp | 75 ++++++++++++++++++++++++++++ - 2 files changed, 128 insertions(+) - create mode 100644 gdb/testsuite/gdb.threads/tls-rhbz947564.cc - create mode 100644 gdb/testsuite/gdb.threads/tls-rhbz947564.exp diff --git a/gdb/testsuite/gdb.threads/tls-rhbz947564.cc b/gdb/testsuite/gdb.threads/tls-rhbz947564.cc new file mode 100644 -index 0000000000..efb25ab926 --- /dev/null +++ b/gdb/testsuite/gdb.threads/tls-rhbz947564.cc @@ -0,0 +1,53 @@ @@ -76,7 +67,6 @@ index 0000000000..efb25ab926 +} diff --git a/gdb/testsuite/gdb.threads/tls-rhbz947564.exp b/gdb/testsuite/gdb.threads/tls-rhbz947564.exp new file mode 100644 -index 0000000000..e8112e965d --- /dev/null +++ b/gdb/testsuite/gdb.threads/tls-rhbz947564.exp @@ -0,0 +1,75 @@ @@ -155,6 +145,3 @@ index 0000000000..e8112e965d +} else { + fail "different values for TLS variable" +} --- -2.14.3 - diff --git a/gdb-rhel5.9-testcase-xlf-var-inside-mod.patch b/gdb-rhel5.9-testcase-xlf-var-inside-mod.patch index f752546..1512653 100644 --- a/gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +++ b/gdb-rhel5.9-testcase-xlf-var-inside-mod.patch @@ -3,22 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch -FileName: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch - ;; Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789). ;;=fedoratest ---- - gdb/testsuite/gdb.fortran/xlf-variable.S | 638 +++++++++++++++++++++++++++++ - gdb/testsuite/gdb.fortran/xlf-variable.exp | 37 ++ - gdb/testsuite/gdb.fortran/xlf-variable.f | 33 ++ - 3 files changed, 708 insertions(+) - create mode 100644 gdb/testsuite/gdb.fortran/xlf-variable.S - create mode 100644 gdb/testsuite/gdb.fortran/xlf-variable.exp - create mode 100644 gdb/testsuite/gdb.fortran/xlf-variable.f diff --git a/gdb/testsuite/gdb.fortran/xlf-variable.S b/gdb/testsuite/gdb.fortran/xlf-variable.S new file mode 100644 -index 0000000000..e826c844c7 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/xlf-variable.S @@ -0,0 +1,638 @@ @@ -662,7 +651,6 @@ index 0000000000..e826c844c7 + .comm __N__mod1,4,16 diff --git a/gdb/testsuite/gdb.fortran/xlf-variable.exp b/gdb/testsuite/gdb.fortran/xlf-variable.exp new file mode 100644 -index 0000000000..085da12567 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/xlf-variable.exp @@ -0,0 +1,37 @@ @@ -705,7 +693,6 @@ index 0000000000..085da12567 +gdb_test "ptype z" "= REAL" "z is REAL" diff --git a/gdb/testsuite/gdb.fortran/xlf-variable.f b/gdb/testsuite/gdb.fortran/xlf-variable.f new file mode 100644 -index 0000000000..0b458f8b0c --- /dev/null +++ b/gdb/testsuite/gdb.fortran/xlf-variable.f @@ -0,0 +1,33 @@ @@ -742,6 +729,3 @@ index 0000000000..0b458f8b0c + use mod1 + call sub1 + end --- -2.14.3 - diff --git a/gdb-runtest-pie-override.patch b/gdb-runtest-pie-override.patch index 0ff9cd5..a0b3863 100644 --- a/gdb-runtest-pie-override.patch +++ b/gdb-runtest-pie-override.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-runtest-pie-override.patch -FileName: gdb-runtest-pie-override.patch - ;; Hack for proper PIE run of the testsuite. ;;=fedoratest @@ -23,12 +21,8 @@ make check//unix RUNTESTFLAGS='CC_FOR_TARGET=gcc\ -fPIC\ -pie CXX_FOR_TARGET=g++ But there is a problem with testsuite.unix non-unique subdir name and also a problem with make -j parallelization of the testsuite. ---- - gdb/testsuite/lib/future.exp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp -index 547ca5fb7b..93c770820c 100644 --- a/gdb/testsuite/lib/future.exp +++ b/gdb/testsuite/lib/future.exp @@ -185,6 +185,10 @@ proc gdb_default_target_compile {source destfile type options} { @@ -53,6 +47,3 @@ index 547ca5fb7b..93c770820c 100644 verbose "doing compile" set sources "" --- -2.14.3 - diff --git a/gdb-simultaneous-step-resume-breakpoint-test.patch b/gdb-simultaneous-step-resume-breakpoint-test.patch index 3ae1244..ad4a1f2 100644 --- a/gdb-simultaneous-step-resume-breakpoint-test.patch +++ b/gdb-simultaneous-step-resume-breakpoint-test.patch @@ -3,20 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-simultaneous-step-resume-breakpoint-test.patch -FileName: gdb-simultaneous-step-resume-breakpoint-test.patch - ;; New test for step-resume breakpoint placed in multiple threads at once. ;;=fedoratest ---- - .../simultaneous-step-resume-breakpoint.c | 79 ++++++++++++++++++++++ - .../simultaneous-step-resume-breakpoint.exp | 65 ++++++++++++++++++ - 2 files changed, 144 insertions(+) - create mode 100644 gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c - create mode 100644 gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp diff --git a/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c new file mode 100644 -index 0000000000..1f32bbf889 --- /dev/null +++ b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c @@ -0,0 +1,79 @@ @@ -101,7 +92,6 @@ index 0000000000..1f32bbf889 +} diff --git a/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp new file mode 100644 -index 0000000000..ac5111c5ce --- /dev/null +++ b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp @@ -0,0 +1,65 @@ @@ -170,6 +160,3 @@ index 0000000000..ac5111c5ce + +gdb_test "continue" "sleep-after.*" "second continue" +gdb_test "continue" "final-exit.*" "third continue" --- -2.14.3 - diff --git a/gdb-stale-frame_info.patch b/gdb-stale-frame_info.patch deleted file mode 100644 index 622c409..0000000 --- a/gdb-stale-frame_info.patch +++ /dev/null @@ -1,84 +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: workaround stale frame_info * (PR 13866) - -FileName: gdb-stale-frame_info.patch - -;; Workaround crashes from stale frame_info pointer (BZ 804256). -;;=push+jan - -http://sourceware.org/ml/gdb-patches/2012-04/msg00058.html - -Hi, - -I did not look at which commit caused this regression but apparently it was -introduced at least with multi-inferiors. - -I understand this fix is not right fix of the crash; but in most GDB cases one -does not use multi-inferior so why to regress single-inferior by it. -Some more simple solutions still fix the single-inferior mode but they -regressed the multi-inferior mode - gdb.threads/no-unwaited-for-left.exp - gdb.multi/base.exp -so I had to put there that sorting magic. - -With proper C++ sanity check of stale live frame_info references the testcase -would be simple without the "frame_garbage_collection" reproducer below. -It is also reproducible just with valgrind but regularly running the whole -testsuite under valgrind I did not find feasible. - -No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu. - -Thanks, -Jan - -gdb/ -2012-04-04 Jan Kratochvil - - Workaround PR backtrace/13866. - * progspace.c (switch_to_program_space_and_thread): Try not to call - switch_to_thread. ---- - gdb/progspace-and-thread.c | 18 ++++++++++++++++-- - 1 file changed, 16 insertions(+), 2 deletions(-) - -diff --git a/gdb/progspace-and-thread.c b/gdb/progspace-and-thread.c -index 27d626b05f..ee6342d96a 100644 ---- a/gdb/progspace-and-thread.c -+++ b/gdb/progspace-and-thread.c -@@ -23,15 +23,29 @@ - void - switch_to_program_space_and_thread (program_space *pspace) - { -- inferior *inf = find_inferior_for_program_space (pspace); -+ inferior *inf = current_inferior (); -+ -+ if (inf->pspace != pspace) -+ inf = find_inferior_for_program_space (pspace); - - if (inf != NULL && inf->pid != 0) - { - thread_info *tp = any_live_thread_of_process (inf->pid); -+ thread_info *current_tp = NULL; -+ -+ if (ptid_get_pid (inferior_ptid) == inf->pid) -+ current_tp = find_thread_ptid (inferior_ptid); - - if (tp != NULL) - { -- switch_to_thread (tp->ptid); -+ /* Prefer primarily thread not THREAD_EXITED and secondarily thread -+ not EXECUTING. */ -+ if (current_tp == NULL -+ || (tp->state != THREAD_EXITED -+ && current_tp->state == THREAD_EXITED) -+ || (!tp->executing && current_tp->executing)) -+ switch_to_thread (tp->ptid); -+ - /* Switching thread switches pspace implicitly. We're - done. */ - return; --- -2.14.3 - diff --git a/gdb-test-bt-cfi-without-die.patch b/gdb-test-bt-cfi-without-die.patch index f6b2a5c..29b6bc0 100644 --- a/gdb-test-bt-cfi-without-die.patch +++ b/gdb-test-bt-cfi-without-die.patch @@ -1,9 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: Fix a regression on CFI without DIE [Re: - -FileName: gdb-test-bt-cfi-without-die.patch +Subject: gdb-test-bt-cfi-without-die.patch ;; [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604). ;;=fedoratest @@ -67,18 +65,9 @@ gdb/ gdb/testsuite/ * gdb.base/cfi-without-die.exp, gdb.base/cfi-without-die-main.c, gdb.base/cfi-without-die-caller.c: New files. ---- - gdb/testsuite/gdb.base/cfi-without-die-caller.c | 28 ++++++++++ - gdb/testsuite/gdb.base/cfi-without-die-main.c | 32 +++++++++++ - gdb/testsuite/gdb.base/cfi-without-die.exp | 71 +++++++++++++++++++++++++ - 3 files changed, 131 insertions(+) - create mode 100644 gdb/testsuite/gdb.base/cfi-without-die-caller.c - create mode 100644 gdb/testsuite/gdb.base/cfi-without-die-main.c - create mode 100644 gdb/testsuite/gdb.base/cfi-without-die.exp diff --git a/gdb/testsuite/gdb.base/cfi-without-die-caller.c b/gdb/testsuite/gdb.base/cfi-without-die-caller.c new file mode 100644 -index 0000000000..afdfd5331a --- /dev/null +++ b/gdb/testsuite/gdb.base/cfi-without-die-caller.c @@ -0,0 +1,28 @@ @@ -112,7 +101,6 @@ index 0000000000..afdfd5331a +} diff --git a/gdb/testsuite/gdb.base/cfi-without-die-main.c b/gdb/testsuite/gdb.base/cfi-without-die-main.c new file mode 100644 -index 0000000000..8451c4be70 --- /dev/null +++ b/gdb/testsuite/gdb.base/cfi-without-die-main.c @@ -0,0 +1,32 @@ @@ -150,7 +138,6 @@ index 0000000000..8451c4be70 +} diff --git a/gdb/testsuite/gdb.base/cfi-without-die.exp b/gdb/testsuite/gdb.base/cfi-without-die.exp new file mode 100644 -index 0000000000..5880d46f6d --- /dev/null +++ b/gdb/testsuite/gdb.base/cfi-without-die.exp @@ -0,0 +1,71 @@ @@ -225,6 +212,3 @@ index 0000000000..5880d46f6d +# #1 0x00000000004004e9 in caller () +# #2 0x00000000004004cd in main () at ... +gdb_test "bt" "#0 +callback \[^\r\n\]+\r\n#1 \[^\r\n\]+ in caller \[^\r\n\]+\r\n#2 \[^\r\n\]+ in main \[^\r\n\]+" "verify unwindin works for CFI without DIEs" --- -2.14.3 - diff --git a/gdb-test-dw2-aranges.patch b/gdb-test-dw2-aranges.patch index f3bae97..d470c1c 100644 --- a/gdb-test-dw2-aranges.patch +++ b/gdb-test-dw2-aranges.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-test-dw2-aranges.patch -FileName: gdb-test-dw2-aranges.patch - ;; [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp. ;;=fedoratest @@ -29,16 +27,9 @@ Date: Sat Aug 15 15:05:54 2009 +0200 Floating point exception * gdb.dwarf2/dw2-aranges.exp, gdb.dwarf2/dw2-aranges.S: New files. ---- - gdb/testsuite/gdb.dwarf2/dw2-aranges.S | 140 +++++++++++++++++++++++++++++++ - gdb/testsuite/gdb.dwarf2/dw2-aranges.exp | 40 +++++++++ - 2 files changed, 180 insertions(+) - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-aranges.S - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-aranges.exp diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S new file mode 100644 -index 0000000000..d5b9ca5a3c --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S @@ -0,0 +1,140 @@ @@ -184,7 +175,6 @@ index 0000000000..d5b9ca5a3c +.Laranges_end: diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp new file mode 100644 -index 0000000000..f95bde4c35 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp @@ -0,0 +1,40 @@ @@ -228,6 +218,3 @@ index 0000000000..f95bde4c35 + +# Failed gdb_load would abort the testcase execution earlier. +pass "file loaded" --- -2.14.3 - diff --git a/gdb-test-expr-cumulative-archer.patch b/gdb-test-expr-cumulative-archer.patch index 4bbf5e4..2c3fc1f 100644 --- a/gdb-test-expr-cumulative-archer.patch +++ b/gdb-test-expr-cumulative-archer.patch @@ -3,27 +3,14 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-test-expr-cumulative-archer.patch -FileName: gdb-test-expr-cumulative-archer.patch - ;; [archer-keiths-expr-cumulative+upstream] Import C++ testcases. ;;=fedoratest archer archer-keiths-expr-cumulative b5a7497340b24199f0c7ba7fdf0d54d4df44d6bc ---- - gdb/testsuite/gdb.cp/namespace-nested-imports.cc | 36 ++++++++++++ - gdb/testsuite/gdb.cp/namespace-nested-imports.exp | 50 ++++++++++++++++ - gdb/testsuite/gdb.cp/namespace-no-imports.cc | 37 ++++++++++++ - gdb/testsuite/gdb.cp/namespace-no-imports.exp | 69 +++++++++++++++++++++++ - 4 files changed, 192 insertions(+) - create mode 100644 gdb/testsuite/gdb.cp/namespace-nested-imports.cc - create mode 100644 gdb/testsuite/gdb.cp/namespace-nested-imports.exp - create mode 100644 gdb/testsuite/gdb.cp/namespace-no-imports.cc - create mode 100644 gdb/testsuite/gdb.cp/namespace-no-imports.exp diff --git a/gdb/testsuite/gdb.cp/namespace-nested-imports.cc b/gdb/testsuite/gdb.cp/namespace-nested-imports.cc new file mode 100644 -index 0000000000..9723f874d9 --- /dev/null +++ b/gdb/testsuite/gdb.cp/namespace-nested-imports.cc @@ -0,0 +1,36 @@ @@ -65,7 +52,6 @@ index 0000000000..9723f874d9 +} diff --git a/gdb/testsuite/gdb.cp/namespace-nested-imports.exp b/gdb/testsuite/gdb.cp/namespace-nested-imports.exp new file mode 100644 -index 0000000000..a606c43cb3 --- /dev/null +++ b/gdb/testsuite/gdb.cp/namespace-nested-imports.exp @@ -0,0 +1,50 @@ @@ -121,7 +107,6 @@ index 0000000000..a606c43cb3 +gdb_test "print ab" "= 11" diff --git a/gdb/testsuite/gdb.cp/namespace-no-imports.cc b/gdb/testsuite/gdb.cp/namespace-no-imports.cc new file mode 100644 -index 0000000000..d1c68abaea --- /dev/null +++ b/gdb/testsuite/gdb.cp/namespace-no-imports.cc @@ -0,0 +1,37 @@ @@ -164,7 +149,6 @@ index 0000000000..d1c68abaea +} diff --git a/gdb/testsuite/gdb.cp/namespace-no-imports.exp b/gdb/testsuite/gdb.cp/namespace-no-imports.exp new file mode 100644 -index 0000000000..a4ae9b3cd2 --- /dev/null +++ b/gdb/testsuite/gdb.cp/namespace-no-imports.exp @@ -0,0 +1,69 @@ @@ -237,6 +221,3 @@ index 0000000000..a4ae9b3cd2 +gdb_test "print _a" "= 11" +gdb_test "print ab" "= 22" +gdb_test "print abc" "= 33" --- -2.14.3 - diff --git a/gdb-test-ivy-bridge.patch b/gdb-test-ivy-bridge.patch index b053380..1c36c21 100644 --- a/gdb-test-ivy-bridge.patch +++ b/gdb-test-ivy-bridge.patch @@ -3,24 +3,11 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-test-ivy-bridge.patch -FileName: gdb-test-ivy-bridge.patch - ;; Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890). ;;=fedoratest ---- - gdb/testsuite/gdb.arch/amd64-ivy-bridge.S | 98 ++++++++++++++++ - gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp | 170 ++++++++++++++++++++++++++++ - gdb/testsuite/gdb.arch/i386-ivy-bridge.S | 67 +++++++++++ - gdb/testsuite/gdb.arch/i386-ivy-bridge.exp | 106 +++++++++++++++++ - 4 files changed, 441 insertions(+) - create mode 100644 gdb/testsuite/gdb.arch/amd64-ivy-bridge.S - create mode 100644 gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp - create mode 100644 gdb/testsuite/gdb.arch/i386-ivy-bridge.S - create mode 100644 gdb/testsuite/gdb.arch/i386-ivy-bridge.exp diff --git a/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S new file mode 100644 -index 0000000000..24e41c0e02 --- /dev/null +++ b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S @@ -0,0 +1,98 @@ @@ -124,7 +111,6 @@ index 0000000000..24e41c0e02 + wrgsbase r8 diff --git a/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp new file mode 100644 -index 0000000000..d1b1f27db4 --- /dev/null +++ b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp @@ -0,0 +1,170 @@ @@ -300,7 +286,6 @@ index 0000000000..d1b1f27db4 +End of assembler dump\\." "intel" diff --git a/gdb/testsuite/gdb.arch/i386-ivy-bridge.S b/gdb/testsuite/gdb.arch/i386-ivy-bridge.S new file mode 100644 -index 0000000000..ff9608d389 --- /dev/null +++ b/gdb/testsuite/gdb.arch/i386-ivy-bridge.S @@ -0,0 +1,67 @@ @@ -373,7 +358,6 @@ index 0000000000..ff9608d389 + diff --git a/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp b/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp new file mode 100644 -index 0000000000..4ea93edb06 --- /dev/null +++ b/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp @@ -0,0 +1,106 @@ @@ -483,6 +467,3 @@ index 0000000000..4ea93edb06 +\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r +\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r +End of assembler dump\\." "intel" --- -2.14.3 - diff --git a/gdb-test-pid0-core.patch b/gdb-test-pid0-core.patch index 0c68d3b..e9e89a4 100644 --- a/gdb-test-pid0-core.patch +++ b/gdb-test-pid0-core.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-test-pid0-core.patch -FileName: gdb-test-pid0-core.patch - ;; New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435). ;;=fedoratest @@ -15,16 +13,9 @@ Re: [RFA]corelow.c: Add tid to add_to_thread_list http://sourceware.org/ml/gdb-patches/2010-08/msg00085.html http://sourceware.org/ml/gdb-cvs/2010-08/msg00026.html 2e5bcfdef1ec3883d48c3f87a4be5c0dff25e17e ---- - .../gdb.arch/x86_64-pid0-core.core.bz2.uu | 20 ++++++++++ - gdb/testsuite/gdb.arch/x86_64-pid0-core.exp | 46 ++++++++++++++++++++++ - 2 files changed, 66 insertions(+) - create mode 100644 gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu - create mode 100644 gdb/testsuite/gdb.arch/x86_64-pid0-core.exp diff --git a/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu b/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu new file mode 100644 -index 0000000000..4c8200c243 --- /dev/null +++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu @@ -0,0 +1,20 @@ @@ -50,7 +41,6 @@ index 0000000000..4c8200c243 +end diff --git a/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp new file mode 100644 -index 0000000000..7a5a1cac19 --- /dev/null +++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp @@ -0,0 +1,46 @@ @@ -100,6 +90,3 @@ index 0000000000..7a5a1cac19 +# Former crash was: +# thread.c:884: internal-error: switch_to_thread: Assertion `inf != NULL' failed. +gdb_test "core-file ${corefile}" "Program terminated with signal (11|SIGSEGV), Segmentation fault\\.\r\n.*" --- -2.14.3 - diff --git a/gdb-testsuite-readline63-sigint.patch b/gdb-testsuite-readline63-sigint.patch index a67bcd0..6a7e93a 100644 --- a/gdb-testsuite-readline63-sigint.patch +++ b/gdb-testsuite-readline63-sigint.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-testsuite-readline63-sigint.patch -FileName: gdb-testsuite-readline63-sigint.patch - ;; [testsuite] Fix false selftest.exp FAIL from system readline-6.3+ (Patrick Palka). ;;=fedoratest @@ -13,15 +11,11 @@ commit 379059215e823555a37a8dc7e02cef8fd86566e4 https://sourceware.org/ml/gdb-patches/2015-07/msg00422.html Message-Id: <1436927724-4059-1-git-send-email-patrick@parcs.ath.cx> https://bugzilla.redhat.com/show_bug.cgi?id=1301175 ---- - gdb/testsuite/gdb.gdb/selftest.exp | 22 +++++++++++++++++++--- - 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp -index 4108e088a9..4dbd583ce7 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp -@@ -104,9 +104,25 @@ proc test_with_self { } { +@@ -113,9 +113,25 @@ proc test_with_self { } { } set description "send SIGINT signal to child process" @@ -50,6 +44,3 @@ index 4108e088a9..4dbd583ce7 100644 # Switch back to the GDB thread if Guile support is linked in. # "signal SIGINT" could also switch the current thread. --- -2.14.3 - diff --git a/gdb-use-pulongest-aarch64-linux-tdep.patch b/gdb-use-pulongest-aarch64-linux-tdep.patch new file mode 100644 index 0000000..e135302 --- /dev/null +++ b/gdb-use-pulongest-aarch64-linux-tdep.patch @@ -0,0 +1,44 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Sergio Durigan Junior +Date: Thu, 6 Sep 2018 00:22:18 -0400 +Subject: gdb-use-pulongest-aarch64-linux-tdep.patch + +;; Use pulongest in aarch64-linux-tdep.c. +;; This patch was forgotten during the 8.2 release process, and is +;; needed to unbreak GDB when compiling on 32-bit arches. + +Use pulongest in aarch64-linux-tdep.c + +While testing a patch on the buildbot, I got this error: + +../../binutils-gdb/gdb/aarch64-linux-tdep.c: In function uint64_t aarch64_linux_core_read_vq(gdbarch*, bfd*): +../../binutils-gdb/gdb/aarch64-linux-tdep.c:285:29: error: format %ld expects argument of type long int, but argument 2 has type uint64_t {aka long long unsigned int} [-Werror=format=] + +This patch avoids the problem by using pulongest rather than %ld. +This seems safe to me because, if aarch64-linux-tdep.c is included in +the build, then ULONGEST must be a 64-bit type. + +gdb/ChangeLog +2018-08-15 Tom Tromey + + * aarch64-linux-tdep.c (aarch64_linux_core_read_vq): Use pulongest. + +diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c +--- a/gdb/aarch64-linux-tdep.c ++++ b/gdb/aarch64-linux-tdep.c +@@ -282,12 +282,13 @@ aarch64_linux_core_read_vq (struct gdbarch *gdbarch, bfd *abfd) + if (vq > AARCH64_MAX_SVE_VQ) + { + warning (_("SVE Vector length in core file not supported by this version" +- " of GDB. (VQ=%ld)"), vq); ++ " of GDB. (VQ=%s)"), pulongest (vq)); + return 0; + } + else if (vq == 0) + { +- warning (_("SVE Vector length in core file is invalid. (VQ=%ld"), vq); ++ warning (_("SVE Vector length in core file is invalid. (VQ=%s"), ++ pulongest (vq)); + return 0; + } + diff --git a/gdb-vla-intel-fix-print-char-array.patch b/gdb-vla-intel-fix-print-char-array.patch index 5328561..3644f45 100644 --- a/gdb-vla-intel-fix-print-char-array.patch +++ b/gdb-vla-intel-fix-print-char-array.patch @@ -3,8 +3,6 @@ From: Sergio Durigan Junior Date: Thu, 7 Dec 2017 16:20:31 -0500 Subject: gdb-vla-intel-fix-print-char-array.patch -FileName: gdb-vla-intel-fix-print-char-array.patch - ;; Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd Revert commit (only the part touching gdb/f-valprint.c): @@ -20,13 +18,8 @@ Revert commit (only the part touching gdb/f-valprint.c): This does not change the output. And adjust its testcase. ---- - gdb/f-valprint.c | 18 ++++++++++++++++-- - gdb/testsuite/gdb.fortran/printing-types.exp | 2 +- - 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c -index 03400ae431..aa33d848d6 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -313,8 +313,22 @@ f_val_print (struct type *type, LONGEST embedded_offset, @@ -55,7 +48,6 @@ index 03400ae431..aa33d848d6 100644 case TYPE_CODE_STRUCT: diff --git a/gdb/testsuite/gdb.fortran/printing-types.exp b/gdb/testsuite/gdb.fortran/printing-types.exp -index 9237907ed6..dbd0666422 100644 --- a/gdb/testsuite/gdb.fortran/printing-types.exp +++ b/gdb/testsuite/gdb.fortran/printing-types.exp @@ -29,7 +29,7 @@ if {![runto MAIN__]} then { @@ -67,6 +59,3 @@ index 9237907ed6..dbd0666422 100644 gdb_test "print twobytes" " = 2" gdb_test "print chvalue" " = \'a\'" gdb_test "print logvalue" " = \.TRUE\." --- -2.14.3 - diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch index 5ef181b..3042eb5 100644 --- a/gdb-vla-intel-fortran-strides.patch +++ b/gdb-vla-intel-fortran-strides.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-vla-intel-fortran-strides.patch -FileName: gdb-vla-intel-fortran-strides.patch - ;; VLA (Fortran dynamic arrays) from Intel + archer-jankratochvil-vla tests. ;;=push @@ -35,41 +33,11 @@ dbfd7140bf4c0500d1f5d192be781f83f78f7922 gdb/valops.c | 197 +++++++++++-- gdb/value.h | 2 + 23 files changed, 1242 insertions(+), 183 deletions(-) ---- - gdb/dwarf2loc.c | 46 ++- - gdb/dwarf2loc.h | 6 + - gdb/dwarf2read.c | 13 +- - gdb/eval.c | 391 +++++++++++++++++++++----- - gdb/expprint.c | 20 +- - gdb/expression.h | 18 +- - gdb/f-exp.y | 42 ++- - gdb/f-valprint.c | 8 +- - gdb/gdbtypes.c | 34 ++- - gdb/gdbtypes.h | 18 +- - gdb/parse.c | 24 +- - gdb/rust-exp.y | 12 +- - gdb/rust-lang.c | 17 +- - gdb/testsuite/gdb.fortran/static-arrays.exp | 421 ++++++++++++++++++++++++++++ - gdb/testsuite/gdb.fortran/static-arrays.f90 | 55 ++++ - gdb/testsuite/gdb.fortran/vla-ptype.exp | 4 + - gdb/testsuite/gdb.fortran/vla-sizeof.exp | 4 + - gdb/testsuite/gdb.fortran/vla-stride.exp | 44 +++ - gdb/testsuite/gdb.fortran/vla-stride.f90 | 29 ++ - gdb/testsuite/gdb.fortran/vla.f90 | 10 + - gdb/valarith.c | 10 +- - gdb/valops.c | 199 +++++++++++-- - gdb/value.h | 2 + - 23 files changed, 1245 insertions(+), 182 deletions(-) - create mode 100644 gdb/testsuite/gdb.fortran/static-arrays.exp - create mode 100644 gdb/testsuite/gdb.fortran/static-arrays.f90 - create mode 100644 gdb/testsuite/gdb.fortran/vla-stride.exp - create mode 100644 gdb/testsuite/gdb.fortran/vla-stride.f90 diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index 51f133f1b5..5105c8d23a 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c -@@ -2601,11 +2601,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, +@@ -2600,11 +2600,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, /* See dwarf2loc.h. */ int @@ -86,7 +54,7 @@ index 51f133f1b5..5105c8d23a 100644 if (prop == NULL) return 0; -@@ -2629,7 +2632,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, +@@ -2628,7 +2631,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, *value = value_as_address (val); } @@ -95,7 +63,7 @@ index 51f133f1b5..5105c8d23a 100644 } } break; -@@ -2651,7 +2654,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, +@@ -2650,7 +2653,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, if (!value_optimized_out (val)) { *value = value_as_address (val); @@ -104,7 +72,7 @@ index 51f133f1b5..5105c8d23a 100644 } } } -@@ -2659,8 +2662,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, +@@ -2658,8 +2661,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, case PROP_CONST: *value = prop->data.const_val; @@ -115,7 +83,7 @@ index 51f133f1b5..5105c8d23a 100644 case PROP_ADDR_OFFSET: { struct dwarf2_property_baton *baton -@@ -2681,11 +2684,38 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, +@@ -2680,11 +2683,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); @@ -157,7 +125,6 @@ index 51f133f1b5..5105c8d23a 100644 /* See dwarf2loc.h. */ diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h -index f82e7b2d11..74f0597359 100644 --- a/gdb/dwarf2loc.h +++ b/gdb/dwarf2loc.h @@ -143,6 +143,12 @@ int dwarf2_evaluate_property (const struct dynamic_prop *prop, @@ -174,10 +141,9 @@ index f82e7b2d11..74f0597359 100644 property to C code. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 58da0fc1f9..8fc1f7ec45 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -17551,7 +17551,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17566,7 +17566,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; @@ -186,7 +152,7 @@ index 58da0fc1f9..8fc1f7ec45 100644 int low_default_is_valid; int high_bound_is_count = 0; const char *name; -@@ -17571,7 +17571,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17586,7 +17586,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) low.kind = PROP_CONST; high.kind = PROP_CONST; @@ -196,21 +162,22 @@ index 58da0fc1f9..8fc1f7ec45 100644 /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow omitting DW_AT_lower_bound. */ -@@ -17604,6 +17606,13 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17619,6 +17621,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) break; } + attr = dwarf2_attr (die, DW_AT_byte_stride, cu); + if (attr) + if (!attr_to_dynamic_prop (attr, die, cu, &stride)) -+ complaint (&symfile_complaints, _("Missing DW_AT_byte_stride " -+ "- DIE at 0x%x [in module %s]"), -+ to_underlying (die->sect_off), objfile_name (cu->objfile)); ++ complaint (_("Missing DW_AT_byte_stride " ++ "- DIE at 0x%s [in module %s]"), ++ sect_offset_str (die->sect_off), ++ objfile_name (cu->per_cu->dwarf2_per_objfile->objfile)); + attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) attr_to_dynamic_prop (attr, die, cu, &low); -@@ -17680,7 +17689,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17696,7 +17706,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; @@ -220,10 +187,9 @@ index 58da0fc1f9..8fc1f7ec45 100644 if (high_bound_is_count) TYPE_RANGE_DATA (range_type)->flag_upper_bound_is_count = 1; diff --git a/gdb/eval.c b/gdb/eval.c -index 6f74c41b9f..d9bca2791d 100644 --- a/gdb/eval.c +++ b/gdb/eval.c -@@ -384,29 +384,325 @@ init_array_element (struct value *array, struct value *element, +@@ -377,29 +377,325 @@ init_array_element (struct value *array, struct value *element, return index; } @@ -567,7 +533,7 @@ index 6f74c41b9f..d9bca2791d 100644 } -@@ -1928,19 +2224,8 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1926,19 +2222,8 @@ evaluate_subexp_standard (struct type *expect_type, switch (code) { case TYPE_CODE_ARRAY: @@ -588,7 +554,7 @@ index 6f74c41b9f..d9bca2791d 100644 case TYPE_CODE_PTR: case TYPE_CODE_FUNC: -@@ -2336,49 +2621,6 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2334,49 +2619,6 @@ evaluate_subexp_standard (struct type *expect_type, } return (arg1); @@ -638,7 +604,7 @@ index 6f74c41b9f..d9bca2791d 100644 case BINOP_LOGICAL_AND: arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); if (noside == EVAL_SKIP) -@@ -3282,6 +3524,9 @@ calc_f77_array_dims (struct type *array_type) +@@ -3293,6 +3535,9 @@ calc_f77_array_dims (struct type *array_type) int ndimen = 1; struct type *tmp_type; @@ -649,15 +615,21 @@ index 6f74c41b9f..d9bca2791d 100644 error (_("Can't get dimensions for a non-array type")); diff --git a/gdb/expprint.c b/gdb/expprint.c -index ac5ae0fea1..41bb357a27 100644 --- a/gdb/expprint.c +++ b/gdb/expprint.c -@@ -581,12 +581,10 @@ print_subexp_standard (struct expression *exp, int *pos, +@@ -578,17 +578,14 @@ print_subexp_standard (struct expression *exp, int *pos, + longest_to_int (exp->elts[pc + 1].longconst); *pos += 2; +- if (range_type == NONE_BOUND_DEFAULT_EXCLUSIVE +- || range_type == LOW_BOUND_DEFAULT_EXCLUSIVE) ++ if ((range_type & SUBARRAY_HIGH_BOUND_EXCLUSIVE) ++ == SUBARRAY_HIGH_BOUND_EXCLUSIVE) + fputs_filtered ("EXCLUSIVE_", stream); fputs_filtered ("RANGE(", stream); - if (range_type == HIGH_BOUND_DEFAULT -- || range_type == NONE_BOUND_DEFAULT) +- || range_type == NONE_BOUND_DEFAULT +- || range_type == NONE_BOUND_DEFAULT_EXCLUSIVE) + if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND) print_subexp (exp, pos, stream, PREC_ABOVE_COMMA); fputs_filtered ("..", stream); @@ -667,7 +639,7 @@ index ac5ae0fea1..41bb357a27 100644 print_subexp (exp, pos, stream, PREC_ABOVE_COMMA); fputs_filtered (")", stream); return; -@@ -1094,16 +1092,16 @@ dump_subexp_body_standard (struct expression *exp, +@@ -1098,22 +1095,24 @@ dump_subexp_body_standard (struct expression *exp, switch (range_type) { @@ -679,16 +651,28 @@ index ac5ae0fea1..41bb357a27 100644 + case SUBARRAY_HIGH_BOUND: fputs_filtered ("Range '..EXP'", stream); break; +- case LOW_BOUND_DEFAULT_EXCLUSIVE: +- fputs_filtered ("ExclusiveRange '..EXP'", stream); +- break; - case HIGH_BOUND_DEFAULT: + case SUBARRAY_LOW_BOUND: fputs_filtered ("Range 'EXP..'", stream); break; - case NONE_BOUND_DEFAULT: ++ case (SUBARRAY_LOW_BOUND ++ | SUBARRAY_HIGH_BOUND ++ | SUBARRAY_HIGH_BOUND_EXCLUSIVE): ++ fputs_filtered ("ExclusiveRange '..EXP'", stream); ++ break; + case (SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND): fputs_filtered ("Range 'EXP..EXP'", stream); break; +- case NONE_BOUND_DEFAULT_EXCLUSIVE: ++ case (SUBARRAY_HIGH_BOUND | SUBARRAY_HIGH_BOUND_EXCLUSIVE): + fputs_filtered ("ExclusiveRange 'EXP..EXP'", stream); + break; default: -@@ -1111,11 +1109,9 @@ dump_subexp_body_standard (struct expression *exp, +@@ -1121,11 +1120,9 @@ dump_subexp_body_standard (struct expression *exp, break; } @@ -703,38 +687,58 @@ index ac5ae0fea1..41bb357a27 100644 } break; diff --git a/gdb/expression.h b/gdb/expression.h -index a783ea5fef..be24792eb6 100644 --- a/gdb/expression.h +++ b/gdb/expression.h -@@ -153,17 +153,17 @@ extern void dump_raw_expression (struct expression *, +@@ -148,28 +148,27 @@ extern void dump_raw_expression (struct expression *, struct ui_file *, const char *); extern void dump_prefix_expression (struct expression *, struct ui_file *); -/* In an OP_RANGE expression, either bound could be empty, indicating - that its value is by default that of the corresponding bound of the -- array or string. So we have four sorts of subrange. This -- enumeration type is to identify this. */ -- -+/* In an OP_RANGE expression, either bound can be provided by the user, or not. -+ In addition to this, the user can also specify a stride value to indicated -+ only certain elements of the array. This enumeration type is to identify -+ this. */ -+ +- array or string. Also, the upper end of the range can be exclusive +- or inclusive. So we have six sorts of subrange. This enumeration +- type is to identify this. */ ++/* In an OP_RANGE expression, either bound can be provided by the ++ user, or not. In addition to this, the user can also specify a ++ stride value to indicated only certain elements of the array. ++ Also, the upper end of the range can be exclusive or inclusive. ++ This enumeration type is to identify this. */ + enum range_type - { -- BOTH_BOUND_DEFAULT, /* "(:)" */ -- LOW_BOUND_DEFAULT, /* "(:high)" */ -- HIGH_BOUND_DEFAULT, /* "(low:)" */ -- NONE_BOUND_DEFAULT /* "(low:high)" */ +-{ +- /* Neither the low nor the high bound was given -- so this refers to +- the entire available range. */ +- BOTH_BOUND_DEFAULT, +- /* The low bound was not given and the high bound is inclusive. */ +- LOW_BOUND_DEFAULT, +- /* The high bound was not given and the low bound in inclusive. */ +- HIGH_BOUND_DEFAULT, +- /* Both bounds were given and both are inclusive. */ +- NONE_BOUND_DEFAULT, +- /* The low bound was not given and the high bound is exclusive. */ +- NONE_BOUND_DEFAULT_EXCLUSIVE, +- /* Both bounds were given. The low bound is inclusive and the high +- bound is exclusive. */ +- LOW_BOUND_DEFAULT_EXCLUSIVE, +-}; ++ { + SUBARRAY_NONE_BOUND = 0x0, /* "( : )" */ + SUBARRAY_LOW_BOUND = 0x1, /* "(low:)" */ + SUBARRAY_HIGH_BOUND = 0x2, /* "(:high)" */ -+ SUBARRAY_STRIDE = 0x4 /* "(::stride)" */ - }; ++ SUBARRAY_STRIDE = 0x4, /* "(::stride)" */ ++ /* The low bound was not given and the high bound is exclusive. ++ In this case we always use (SUBARRAY_HIGH_BOUND | ++ SUBARRAY_HIGH_BOUND_EXCLUSIVE). */ ++ SUBARRAY_HIGH_BOUND_EXCLUSIVE = 0x8, ++ /* Both bounds were given. The low bound is inclusive and the high ++ bound is exclusive. In this case, we use (SUBARRAY_LOW_BOUND | ++ SUBARRAY_HIGH_BOUND | SUBARRAY_HIGH_BOUND_EXCLUSIVE). */ ++ // SUBARRAY_LOW_BOUND_EXCLUSIVE = (SUBARRAY_LOW_BOUND ++ // | SUBARRAY_HIGH_BOUND_EXCLUSIVE), ++ }; #endif /* !defined (EXPRESSION_H) */ diff --git a/gdb/f-exp.y b/gdb/f-exp.y -index 6495e03cc5..cd89bb7ca2 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -257,31 +257,63 @@ arglist : subrange @@ -807,7 +811,6 @@ index 6495e03cc5..cd89bb7ca2 100644 ; diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c -index 903f2af638..b4067a8460 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -119,8 +119,14 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, @@ -827,7 +830,6 @@ index 903f2af638..b4067a8460 100644 for (i = lowerbound; (i < upperbound + 1 && (*elts) < options->print_max); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c -index 43fe56e487..a72e2b3e0a 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -902,7 +902,8 @@ operator== (const range_bounds &l, const range_bounds &r) @@ -892,7 +894,7 @@ index 43fe56e487..a72e2b3e0a 100644 else if (bit_stride > 0) TYPE_LENGTH (result_type) = (bit_stride * (high_bound - low_bound + 1) + 7) / 8; -@@ -1992,12 +2002,12 @@ resolve_dynamic_range (struct type *dyn_range_type, +@@ -1981,12 +1991,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; @@ -907,7 +909,7 @@ index 43fe56e487..a72e2b3e0a 100644 { low_bound.kind = PROP_CONST; low_bound.data.const_val = value; -@@ -2009,7 +2019,7 @@ resolve_dynamic_range (struct type *dyn_range_type, +@@ -1998,7 +2008,7 @@ resolve_dynamic_range (struct type *dyn_range_type, } prop = &TYPE_RANGE_DATA (dyn_range_type)->high; @@ -916,7 +918,7 @@ index 43fe56e487..a72e2b3e0a 100644 { high_bound.kind = PROP_CONST; high_bound.data.const_val = value; -@@ -2024,12 +2034,20 @@ resolve_dynamic_range (struct type *dyn_range_type, +@@ -2013,12 +2023,20 @@ resolve_dynamic_range (struct type *dyn_range_type, high_bound.data.const_val = 0; } @@ -939,10 +941,9 @@ index 43fe56e487..a72e2b3e0a 100644 return static_range_type; } diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h -index 92ca85c295..179238ce82 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h -@@ -560,6 +560,10 @@ struct range_bounds +@@ -612,6 +612,10 @@ struct range_bounds struct dynamic_prop high; @@ -953,7 +954,7 @@ index 92ca85c295..179238ce82 100644 /* True if HIGH range bound contains the number of elements in the subrange. This affects how the final hight bound is computed. */ -@@ -731,7 +735,6 @@ struct main_type +@@ -776,7 +780,6 @@ struct main_type /* * Union member used for range types. */ struct range_bounds *bounds; @@ -961,7 +962,7 @@ index 92ca85c295..179238ce82 100644 } flds_bnds; /* * Slot to point to additional language-specific fields of this -@@ -1253,6 +1256,15 @@ extern void allocate_gnat_aux_type (struct type *); +@@ -1329,6 +1332,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 @@ -977,7 +978,7 @@ index 92ca85c295..179238ce82 100644 /* Property accessors for the type data location. */ #define TYPE_DATA_LOCATION(thistype) \ -@@ -1287,6 +1299,9 @@ extern void allocate_gnat_aux_type (struct type *); +@@ -1363,6 +1375,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)) @@ -987,7 +988,7 @@ index 92ca85c295..179238ce82 100644 #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype)))) -@@ -1818,6 +1833,7 @@ extern struct type *create_array_type_with_stride +@@ -1892,6 +1907,7 @@ extern struct type *create_array_type_with_stride struct dynamic_prop *, unsigned int); extern struct type *create_range_type (struct type *, struct type *, @@ -996,10 +997,9 @@ index 92ca85c295..179238ce82 100644 const struct dynamic_prop *); diff --git a/gdb/parse.c b/gdb/parse.c -index 8b2bb22c76..e1bf3edbe2 100644 --- a/gdb/parse.c +++ b/gdb/parse.c -@@ -984,22 +984,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; @@ -1010,6 +1010,7 @@ index 8b2bb22c76..e1bf3edbe2 100644 - switch (range_type) - { - case LOW_BOUND_DEFAULT: +- case LOW_BOUND_DEFAULT_EXCLUSIVE: - case HIGH_BOUND_DEFAULT: - args = 1; - break; @@ -1017,6 +1018,7 @@ index 8b2bb22c76..e1bf3edbe2 100644 - args = 0; - break; - case NONE_BOUND_DEFAULT: +- case NONE_BOUND_DEFAULT_EXCLUSIVE: - args = 2; - break; - } @@ -1034,10 +1036,9 @@ index 8b2bb22c76..e1bf3edbe2 100644 break; diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y -index 199e87671e..397a92dfdb 100644 --- a/gdb/rust-exp.y +++ b/gdb/rust-exp.y -@@ -2448,23 +2448,17 @@ convert_ast_to_expression (struct parser_state *state, +@@ -2478,24 +2478,28 @@ convert_ast_to_expression (struct parser_state *state, case OP_RANGE: { @@ -1054,33 +1055,47 @@ index 199e87671e..397a92dfdb 100644 { convert_ast_to_expression (state, operation->right.op, top); - if (kind == BOTH_BOUND_DEFAULT) -- kind = LOW_BOUND_DEFAULT; -- else -- { +- kind = (operation->inclusive +- ? LOW_BOUND_DEFAULT : LOW_BOUND_DEFAULT_EXCLUSIVE); ++ if (kind == SUBARRAY_NONE_BOUND) ++ { ++ kind = (range_type) SUBARRAY_HIGH_BOUND; ++ if (!operation->inclusive) ++ kind = (range_type) (kind | SUBARRAY_HIGH_BOUND_EXCLUSIVE); ++ } + else + { - gdb_assert (kind == HIGH_BOUND_DEFAULT); -- kind = NONE_BOUND_DEFAULT; -- } -+ kind = (range_type) (kind | SUBARRAY_HIGH_BOUND); +- kind = (operation->inclusive +- ? NONE_BOUND_DEFAULT : NONE_BOUND_DEFAULT_EXCLUSIVE); ++ gdb_assert (kind == SUBARRAY_LOW_BOUND); ++ kind = (range_type) (kind | SUBARRAY_HIGH_BOUND); ++ if (!operation->inclusive) ++ kind = (range_type) (kind | SUBARRAY_HIGH_BOUND_EXCLUSIVE); + } } - write_exp_elt_opcode (state, OP_RANGE); - write_exp_elt_longcst (state, kind); + else diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c -index f7bec33a42..cb924e084d 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c -@@ -1366,9 +1366,9 @@ rust_range (struct expression *exp, int *pos, enum noside noside) +@@ -1149,13 +1149,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; -- if (kind == HIGH_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT) +- if (kind == HIGH_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT +- || kind == NONE_BOUND_DEFAULT_EXCLUSIVE) + if ((kind & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND) low = evaluate_subexp (NULL_TYPE, exp, pos, noside); -- if (kind == LOW_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT) +- if (kind == LOW_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT_EXCLUSIVE +- || kind == NONE_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT_EXCLUSIVE) + if ((kind & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND) high = evaluate_subexp (NULL_TYPE, exp, pos, noside); +- bool inclusive = (kind == NONE_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT); ++ bool inclusive = (!((kind & SUBARRAY_HIGH_BOUND_EXCLUSIVE) == SUBARRAY_HIGH_BOUND_EXCLUSIVE)); if (noside == EVAL_SKIP) -@@ -1457,7 +1457,7 @@ rust_compute_range (struct type *type, struct value *range, + return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1); +@@ -1244,7 +1242,7 @@ rust_compute_range (struct type *type, struct value *range, *low = 0; *high = 0; @@ -1089,7 +1104,7 @@ index f7bec33a42..cb924e084d 100644 if (TYPE_NFIELDS (type) == 0) return; -@@ -1465,15 +1465,14 @@ rust_compute_range (struct type *type, struct value *range, +@@ -1252,15 +1250,14 @@ rust_compute_range (struct type *type, struct value *range, i = 0; if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0) { @@ -1105,9 +1120,9 @@ index f7bec33a42..cb924e084d 100644 - ? LOW_BOUND_DEFAULT : NONE_BOUND_DEFAULT); + *kind = (range_type) (*kind | SUBARRAY_HIGH_BOUND); *high = value_as_long (value_field (range, i)); - } - } -@@ -1488,7 +1487,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, + + if (rust_inclusive_range_type_p (type)) +@@ -1278,7 +1275,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, struct type *rhstype; LONGEST low, high_bound; /* Initialized to appease the compiler. */ @@ -1116,7 +1131,7 @@ index f7bec33a42..cb924e084d 100644 LONGEST high = 0; int want_slice = 0; -@@ -1586,7 +1585,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, +@@ -1376,7 +1373,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, error (_("Cannot subscript non-array type")); if (want_slice @@ -1125,7 +1140,7 @@ index f7bec33a42..cb924e084d 100644 low = low_bound; if (low < 0) error (_("Index less than zero")); -@@ -1604,7 +1603,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, +@@ -1394,7 +1391,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, CORE_ADDR addr; struct value *addrval, *tem; @@ -1136,7 +1151,6 @@ index f7bec33a42..cb924e084d 100644 error (_("High index less than zero")); diff --git a/gdb/testsuite/gdb.fortran/static-arrays.exp b/gdb/testsuite/gdb.fortran/static-arrays.exp new file mode 100644 -index 0000000000..cc9ecc04ab --- /dev/null +++ b/gdb/testsuite/gdb.fortran/static-arrays.exp @@ -0,0 +1,421 @@ @@ -1563,7 +1577,6 @@ index 0000000000..cc9ecc04ab + "Assignment of value to subarray" diff --git a/gdb/testsuite/gdb.fortran/static-arrays.f90 b/gdb/testsuite/gdb.fortran/static-arrays.f90 new file mode 100644 -index 0000000000..f22fcbe124 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/static-arrays.f90 @@ -0,0 +1,55 @@ @@ -1623,7 +1636,6 @@ index 0000000000..f22fcbe124 + call sub +end diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp -index 5f367348b0..5351a0aa2e 100644 --- a/gdb/testsuite/gdb.fortran/vla-ptype.exp +++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp @@ -98,3 +98,7 @@ gdb_test "ptype vla2" "type = " "ptype vla2 not allocated" @@ -1635,7 +1647,6 @@ index 5f367348b0..5351a0aa2e 100644 +gdb_continue_to_breakpoint "vla1-neg-bounds" +gdb_test "ptype vla1" "type = $real \\(-2:1,-5:4,-3:-1\\)" "ptype vla1 negative bounds" diff --git a/gdb/testsuite/gdb.fortran/vla-sizeof.exp b/gdb/testsuite/gdb.fortran/vla-sizeof.exp -index 3113983ba4..83bc849619 100644 --- a/gdb/testsuite/gdb.fortran/vla-sizeof.exp +++ b/gdb/testsuite/gdb.fortran/vla-sizeof.exp @@ -44,3 +44,7 @@ gdb_test "print sizeof(pvla)" " = 0" "print sizeof non-associated pvla" @@ -1648,7 +1659,6 @@ index 3113983ba4..83bc849619 100644 +gdb_test "print sizeof(vla1)" " = 480" "print sizeof vla1 negative bounds" diff --git a/gdb/testsuite/gdb.fortran/vla-stride.exp b/gdb/testsuite/gdb.fortran/vla-stride.exp new file mode 100644 -index 0000000000..dcf15e5daf --- /dev/null +++ b/gdb/testsuite/gdb.fortran/vla-stride.exp @@ -0,0 +1,44 @@ @@ -1698,7 +1708,6 @@ index 0000000000..dcf15e5daf +gdb_test "print pvla(1)" " = 5" "print one single-element" diff --git a/gdb/testsuite/gdb.fortran/vla-stride.f90 b/gdb/testsuite/gdb.fortran/vla-stride.f90 new file mode 100644 -index 0000000000..8d2425222e --- /dev/null +++ b/gdb/testsuite/gdb.fortran/vla-stride.f90 @@ -0,0 +1,29 @@ @@ -1732,7 +1741,6 @@ index 0000000000..8d2425222e + pvla => null() ! single-element +end program vla_stride diff --git a/gdb/testsuite/gdb.fortran/vla.f90 b/gdb/testsuite/gdb.fortran/vla.f90 -index 508290a36e..d87f59b92b 100644 --- a/gdb/testsuite/gdb.fortran/vla.f90 +++ b/gdb/testsuite/gdb.fortran/vla.f90 @@ -54,4 +54,14 @@ program vla @@ -1751,10 +1759,9 @@ index 508290a36e..d87f59b92b 100644 + end program vla diff --git a/gdb/valarith.c b/gdb/valarith.c -index 58e3a09c37..035def5466 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c -@@ -189,10 +189,16 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) +@@ -187,10 +187,16 @@ 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,10 +1781,9 @@ index 58e3a09c37..035def5466 100644 if (type_not_associated (array_type)) error (_("no such vector element (vector not associated)")); diff --git a/gdb/valops.c b/gdb/valops.c -index 9525dc8499..4cd4fd96ae 100644 --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -3776,56 +3776,195 @@ value_of_this_silent (const struct language_defn *lang) +@@ -3808,56 +3808,195 @@ value_of_this_silent (const struct language_defn *lang) struct value * value_slice (struct value *array, int lowbound, int length) @@ -2004,10 +2010,9 @@ index 9525dc8499..4cd4fd96ae 100644 /* Create a value for a FORTRAN complex number. Currently most of the diff --git a/gdb/value.h b/gdb/value.h -index 7dc67dc721..03ca06448f 100644 --- a/gdb/value.h +++ b/gdb/value.h -@@ -1128,6 +1128,8 @@ extern struct value *varying_to_slice (struct value *); +@@ -1139,6 +1139,8 @@ extern struct value *varying_to_slice (struct value *); extern struct value *value_slice (struct value *, int, int); @@ -2016,6 +2021,3 @@ index 7dc67dc721..03ca06448f 100644 extern struct value *value_literal_complex (struct value *, struct value *, struct type *); --- -2.14.3 - diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch index 63bbcf6..41b6817 100644 --- a/gdb-vla-intel-fortran-vla-strings.patch +++ b/gdb-vla-intel-fortran-vla-strings.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-vla-intel-fortran-vla-strings.patch -FileName: gdb-vla-intel-fortran-vla-strings.patch - ;;=push git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings @@ -31,38 +29,11 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings gdb/valops.c | 16 ++- gdb/valprint.c | 6 -- 20 files changed, 827 insertions(+), 110 deletions(-) ---- - gdb/NEWS | 2 + - gdb/c-valprint.c | 22 ++++ - gdb/dwarf2read.c | 163 +++++++++++++++++++++++++----- - gdb/f-typeprint.c | 93 +++++++++-------- - gdb/gdbtypes.c | 40 +++++++- - gdb/testsuite/gdb.cp/vla-cxx.cc | 9 ++ - gdb/testsuite/gdb.cp/vla-cxx.exp | 9 ++ - gdb/testsuite/gdb.fortran/pointers.exp | 143 ++++++++++++++++++++++++++ - gdb/testsuite/gdb.fortran/pointers.f90 | 109 ++++++++++++++++++++ - gdb/testsuite/gdb.fortran/print_type.exp | 100 ++++++++++++++++++ - gdb/testsuite/gdb.fortran/vla-ptype.exp | 12 +-- - gdb/testsuite/gdb.fortran/vla-strings.exp | 103 +++++++++++++++++++ - gdb/testsuite/gdb.fortran/vla-strings.f90 | 39 +++++++ - gdb/testsuite/gdb.fortran/vla-type.exp | 7 +- - gdb/testsuite/gdb.fortran/vla-value.exp | 4 +- - gdb/testsuite/gdb.mi/mi-vla-fortran.exp | 8 +- - gdb/typeprint.c | 19 ++++ - gdb/valops.c | 16 ++- - gdb/valprint.c | 6 -- - 19 files changed, 807 insertions(+), 97 deletions(-) - create mode 100644 gdb/testsuite/gdb.fortran/pointers.exp - create mode 100644 gdb/testsuite/gdb.fortran/pointers.f90 - create mode 100644 gdb/testsuite/gdb.fortran/print_type.exp - create mode 100644 gdb/testsuite/gdb.fortran/vla-strings.exp - create mode 100644 gdb/testsuite/gdb.fortran/vla-strings.f90 diff --git a/gdb/NEWS b/gdb/NEWS -index 6c9a2ecefd..f40eb6c390 100644 --- a/gdb/NEWS +++ b/gdb/NEWS -@@ -3,6 +3,8 @@ +@@ -109,6 +109,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* *** Changes in GDB 8.1 @@ -72,7 +43,6 @@ index 6c9a2ecefd..f40eb6c390 100644 in XML target descriptions. This allows for finer grain grouping of registers on systems with a large amount of registers. diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c -index c4c0918e26..3904fab260 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -653,6 +653,28 @@ c_value_print (struct value *val, struct ui_file *stream, @@ -105,10 +75,9 @@ index c4c0918e26..3904fab260 100644 type_print (value_type (val), "", stream, -1); fprintf_filtered (stream, ") "); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 8fc1f7ec45..98e7d842f0 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -2077,7 +2077,8 @@ static void read_signatured_type (struct signatured_type *); +@@ -1789,7 +1789,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, @@ -118,7 +87,7 @@ index 8fc1f7ec45..98e7d842f0 100644 /* memory allocation interface */ -@@ -13745,7 +13746,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); @@ -127,7 +96,7 @@ index 8fc1f7ec45..98e7d842f0 100644 } cu->list_in_scope = &local_symbols; -@@ -16327,7 +16328,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -16329,7 +16330,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) byte_stride_prop = (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop)); @@ -136,8 +105,8 @@ index 8fc1f7ec45..98e7d842f0 100644 + NULL, 0); if (!stride_ok) { - complaint (&symfile_complaints, -@@ -17075,29 +17077,94 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) + complaint (_("unable to read array DW_AT_byte_stride " +@@ -17090,29 +17092,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; @@ -163,8 +132,7 @@ index 8fc1f7ec45..98e7d842f0 100644 + /* DW_AT_byte_size should never occur in combination with + DW_AT_bit_size. */ + if (byte_size != NULL && bit_size != NULL) -+ complaint (&symfile_complaints, -+ _("DW_AT_byte_size AND " ++ complaint (_("DW_AT_byte_size AND " + "DW_AT_bit_size found together at the same time.")); + + /* If DW_AT_string_length AND DW_AT_byte_size exist together, @@ -186,12 +154,10 @@ index 8fc1f7ec45..98e7d842f0 100644 + + if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops, + ARRAY_SIZE(append_ops))) -+ complaint (&symfile_complaints, -+ _("Could not parse DW_AT_byte_size")); ++ complaint (_("Could not parse DW_AT_byte_size")); + } + else if (bit_size != NULL) -+ complaint (&symfile_complaints, -+ _("DW_AT_string_length AND " ++ complaint (_("DW_AT_string_length AND " + "DW_AT_bit_size found but not supported yet.")); + /* If DW_AT_string_length WITHOUT DW_AT_byte_size exist, the default + is the address size of the target machine. */ @@ -202,8 +168,7 @@ index 8fc1f7ec45..98e7d842f0 100644 + + if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops, + ARRAY_SIZE(append_ops))) -+ complaint (&symfile_complaints, -+ _("Could not parse DW_AT_string_length")); ++ complaint (_("Could not parse DW_AT_string_length")); + } + + TYPE_RANGE_DATA (range_type)->high = high; @@ -243,7 +208,7 @@ index 8fc1f7ec45..98e7d842f0 100644 char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -17446,7 +17513,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17460,7 +17523,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, @@ -252,8 +217,8 @@ index 8fc1f7ec45..98e7d842f0 100644 + const gdb_byte *additional_data, int additional_data_size) { struct dwarf2_property_baton *baton; - struct obstack *obstack = &cu->objfile->objfile_obstack; -@@ -17456,14 +17524,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, + struct obstack *obstack +@@ -17471,14 +17535,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, if (attr_form_is_block (attr)) { @@ -269,7 +234,7 @@ index 8fc1f7ec45..98e7d842f0 100644 + gdb_byte *data; + + data = (gdb_byte *) obstack_alloc( -+ &cu->objfile->objfile_obstack, ++ &cu->per_cu->dwarf2_per_objfile->objfile->objfile_obstack, + DW_BLOCK (attr)->size + additional_data_size); + memcpy (data, DW_BLOCK (attr)->data, DW_BLOCK (attr)->size); + memcpy (data + DW_BLOCK (attr)->size, additional_data, @@ -291,7 +256,7 @@ index 8fc1f7ec45..98e7d842f0 100644 } else if (attr_form_is_ref (attr)) { -@@ -17496,8 +17583,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17511,8 +17594,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; @@ -302,7 +267,7 @@ index 8fc1f7ec45..98e7d842f0 100644 + { + gdb_byte *data; + -+ data = (gdb_byte *) obstack_alloc (&cu->objfile->objfile_obstack, ++ data = (gdb_byte *) obstack_alloc (&cu->per_cu->dwarf2_per_objfile->objfile->objfile_obstack, + DW_BLOCK (target_attr)->size + additional_data_size); + memcpy (data, DW_BLOCK (target_attr)->data, + DW_BLOCK (target_attr)->size); @@ -322,24 +287,26 @@ index 8fc1f7ec45..98e7d842f0 100644 prop->data.baton = baton; prop->kind = PROP_LOCEXPR; gdb_assert (prop->data.baton != NULL); -@@ -17608,24 +17715,24 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -17623,7 +17726,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_byte_stride, cu); if (attr) - if (!attr_to_dynamic_prop (attr, die, cu, &stride)) + if (!attr_to_dynamic_prop (attr, die, cu, &stride, NULL, 0)) - complaint (&symfile_complaints, _("Missing DW_AT_byte_stride " - "- DIE at 0x%x [in module %s]"), - to_underlying (die->sect_off), objfile_name (cu->objfile)); + complaint (_("Missing DW_AT_byte_stride " + "- DIE at 0x%s [in module %s]"), + sect_offset_str (die->sect_off), +@@ -17631,7 +17734,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) - attr_to_dynamic_prop (attr, die, cu, &low); + attr_to_dynamic_prop (attr, die, cu, &low, NULL, 0); else if (!low_default_is_valid) - complaint (&symfile_complaints, _("Missing DW_AT_lower_bound " - "- DIE at 0x%x [in module %s]"), - to_underlying (die->sect_off), objfile_name (cu->objfile)); + complaint (_("Missing DW_AT_lower_bound " + "- DIE at %s [in module %s]"), +@@ -17639,10 +17742,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); - if (!attr_to_dynamic_prop (attr, die, cu, &high)) @@ -351,35 +318,34 @@ index 8fc1f7ec45..98e7d842f0 100644 { /* If bounds are constant do the final calculation here. */ if (low.kind == PROP_CONST && high.kind == PROP_CONST) -@@ -25223,7 +25330,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25143,7 +25246,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)) { - if (attr_to_dynamic_prop (attr, die, cu, &prop)) + if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0)) - add_dyn_prop (DYN_PROP_ALLOCATED, prop, type, objfile); + add_dyn_prop (DYN_PROP_ALLOCATED, prop, type); } else if (attr != NULL) -@@ -25238,7 +25345,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25157,7 +25260,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)) { - if (attr_to_dynamic_prop (attr, die, cu, &prop)) + if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0)) - add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type, objfile); + add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type); } else if (attr != NULL) -@@ -25251,7 +25358,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -25169,7 +25272,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); - if (attr_to_dynamic_prop (attr, die, cu, &prop)) + if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0)) - add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type, objfile); + add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type); if (dwarf2_per_objfile->die_type_hash == NULL) diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c -index f14f1811f4..4f6a0ed09a 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -37,7 +37,7 @@ static void f_type_print_args (struct type *, struct ui_file *); @@ -522,7 +488,7 @@ index f14f1811f4..4f6a0ed09a 100644 if (passed_a_ptr) fprintf_filtered (stream, ")"); -@@ -383,7 +388,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, +@@ -388,7 +393,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, fputs_filtered (" :: ", stream); fputs_filtered (TYPE_FIELD_NAME (type, index), stream); f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index), @@ -532,10 +498,9 @@ index f14f1811f4..4f6a0ed09a 100644 } fprintfi_filtered (level, stream, "End Type "); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c -index a72e2b3e0a..cb5524023f 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c -@@ -1915,7 +1915,8 @@ is_dynamic_type_internal (struct type *type, int top_level) +@@ -1904,7 +1904,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. */ @@ -545,7 +510,7 @@ index a72e2b3e0a..cb5524023f 100644 type = check_typedef (TYPE_TARGET_TYPE (type)); /* Types that have a dynamic TYPE_DATA_LOCATION are considered -@@ -1949,6 +1950,7 @@ is_dynamic_type_internal (struct type *type, int top_level) +@@ -1938,6 +1939,7 @@ is_dynamic_type_internal (struct type *type, int top_level) } case TYPE_CODE_ARRAY: @@ -553,7 +518,7 @@ index a72e2b3e0a..cb5524023f 100644 { gdb_assert (TYPE_NFIELDS (type) == 1); -@@ -2067,7 +2069,8 @@ resolve_dynamic_array (struct type *type, +@@ -2056,7 +2058,8 @@ resolve_dynamic_array (struct type *type, struct dynamic_prop *prop; unsigned int bit_stride = 0; @@ -563,7 +528,7 @@ index a72e2b3e0a..cb5524023f 100644 type = copy_type (type); -@@ -2092,11 +2095,15 @@ resolve_dynamic_array (struct type *type, +@@ -2081,11 +2084,15 @@ resolve_dynamic_array (struct type *type, ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type)); @@ -580,7 +545,7 @@ index a72e2b3e0a..cb5524023f 100644 prop = get_dyn_prop (DYN_PROP_BYTE_STRIDE, type); if (prop != NULL) { -@@ -2251,6 +2258,28 @@ resolve_dynamic_struct (struct type *type, +@@ -2240,6 +2247,28 @@ resolve_dynamic_struct (struct type *type, return resolved_type; } @@ -609,7 +574,7 @@ index a72e2b3e0a..cb5524023f 100644 /* Worker for resolved_dynamic_type. */ static struct type * -@@ -2299,7 +2328,12 @@ resolve_dynamic_type_internal (struct type *type, +@@ -2288,7 +2317,12 @@ resolve_dynamic_type_internal (struct type *type, break; } @@ -623,7 +588,6 @@ index a72e2b3e0a..cb5524023f 100644 break; diff --git a/gdb/testsuite/gdb.cp/vla-cxx.cc b/gdb/testsuite/gdb.cp/vla-cxx.cc -index 1b5b27bf3d..06198b41e0 100644 --- a/gdb/testsuite/gdb.cp/vla-cxx.cc +++ b/gdb/testsuite/gdb.cp/vla-cxx.cc @@ -15,6 +15,10 @@ @@ -655,7 +619,6 @@ index 1b5b27bf3d..06198b41e0 100644 return vla[2]; } diff --git a/gdb/testsuite/gdb.cp/vla-cxx.exp b/gdb/testsuite/gdb.cp/vla-cxx.exp -index ac87499d49..dacbfb6ca0 100644 --- a/gdb/testsuite/gdb.cp/vla-cxx.exp +++ b/gdb/testsuite/gdb.cp/vla-cxx.exp @@ -23,6 +23,12 @@ if ![runto_main] { @@ -680,7 +643,6 @@ index ac87499d49..dacbfb6ca0 100644 +gdb_test "print *ptr" " = \\{5, 7, 9\\}" diff --git a/gdb/testsuite/gdb.fortran/pointers.exp b/gdb/testsuite/gdb.fortran/pointers.exp new file mode 100644 -index 0000000000..67cf99989d --- /dev/null +++ b/gdb/testsuite/gdb.fortran/pointers.exp @@ -0,0 +1,143 @@ @@ -829,7 +791,6 @@ index 0000000000..67cf99989d +gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\)\\(\\)\\)\\) $hex " "Print program counter" diff --git a/gdb/testsuite/gdb.fortran/pointers.f90 b/gdb/testsuite/gdb.fortran/pointers.f90 new file mode 100644 -index 0000000000..6240c87988 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/pointers.f90 @@ -0,0 +1,109 @@ @@ -944,7 +905,6 @@ index 0000000000..6240c87988 +end program pointers diff --git a/gdb/testsuite/gdb.fortran/print_type.exp b/gdb/testsuite/gdb.fortran/print_type.exp new file mode 100644 -index 0000000000..45b4968f6c --- /dev/null +++ b/gdb/testsuite/gdb.fortran/print_type.exp @@ -0,0 +1,100 @@ @@ -1049,7 +1009,6 @@ index 0000000000..45b4968f6c +} +gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)" diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp -index 5351a0aa2e..fa248c5a0c 100644 --- a/gdb/testsuite/gdb.fortran/vla-ptype.exp +++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp @@ -32,9 +32,9 @@ set real [fortran_real4] @@ -1091,7 +1050,6 @@ index 5351a0aa2e..fa248c5a0c 100644 "ptype vla2(5, 45, 20) not allocated" diff --git a/gdb/testsuite/gdb.fortran/vla-strings.exp b/gdb/testsuite/gdb.fortran/vla-strings.exp new file mode 100644 -index 0000000000..484fdcb652 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/vla-strings.exp @@ -0,0 +1,103 @@ @@ -1200,7 +1158,6 @@ index 0000000000..484fdcb652 +} diff --git a/gdb/testsuite/gdb.fortran/vla-strings.f90 b/gdb/testsuite/gdb.fortran/vla-strings.f90 new file mode 100644 -index 0000000000..3c22735fdb --- /dev/null +++ b/gdb/testsuite/gdb.fortran/vla-strings.f90 @@ -0,0 +1,39 @@ @@ -1244,7 +1201,6 @@ index 0000000000..3c22735fdb + l = associated(var_char_p) ! var_char_p-not-associated +end program vla_strings diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp -index aff0d5a258..6f2d6a4009 100755 --- a/gdb/testsuite/gdb.fortran/vla-type.exp +++ b/gdb/testsuite/gdb.fortran/vla-type.exp @@ -132,7 +132,10 @@ gdb_test "ptype fivearr(2)%tone" \ @@ -1269,7 +1225,6 @@ index aff0d5a258..6f2d6a4009 100755 "ptype fivedynarr(2)%tone, not allocated" diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp -index 4b1842e38c..5a831a3964 100644 --- a/gdb/testsuite/gdb.fortran/vla-value.exp +++ b/gdb/testsuite/gdb.fortran/vla-value.exp @@ -35,7 +35,7 @@ gdb_breakpoint [gdb_get_line_number "vla1-init"] @@ -1291,7 +1246,6 @@ index 4b1842e38c..5a831a3964 100644 gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated\\\)" \ "print undefined pvla(1,3,8)" diff --git a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp -index b6e777235c..14b611f7b5 100644 --- a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp +++ b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp @@ -51,10 +51,10 @@ mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ @@ -1321,10 +1275,9 @@ index b6e777235c..14b611f7b5 100644 mi_gdb_test "582-var-show-format pvla2_not_associated" \ "582\\^done,format=\"natural\"" \ diff --git a/gdb/typeprint.c b/gdb/typeprint.c -index c098a3f426..319fbaf94e 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c -@@ -538,6 +538,25 @@ whatis_exp (const char *exp, int show) +@@ -589,6 +589,25 @@ whatis_exp (const char *exp, int show) printf_filtered (" */\n"); } @@ -1349,12 +1302,11 @@ index c098a3f426..319fbaf94e 100644 + LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags); printf_filtered ("\n"); - + } diff --git a/gdb/valops.c b/gdb/valops.c -index 4cd4fd96ae..9b25980090 100644 --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -1564,6 +1564,19 @@ value_ind (struct value *arg1) +@@ -1565,6 +1565,19 @@ value_ind (struct value *arg1) if (TYPE_CODE (base_type) == TYPE_CODE_PTR) { struct type *enc_type; @@ -1374,7 +1326,7 @@ index 4cd4fd96ae..9b25980090 100644 /* We may be pointing to something embedded in a larger object. Get the real type of the enclosing object. */ -@@ -1579,8 +1592,7 @@ value_ind (struct value *arg1) +@@ -1580,8 +1593,7 @@ value_ind (struct value *arg1) else /* Retrieve the enclosing object pointed to. */ arg2 = value_at_lazy (enc_type, @@ -1385,10 +1337,9 @@ index 4cd4fd96ae..9b25980090 100644 enc_type = value_type (arg2); return readjust_indirect_value_type (arg2, enc_type, base_type, arg1); diff --git a/gdb/valprint.c b/gdb/valprint.c -index b19123f23e..d01d02fc09 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c -@@ -1111,12 +1111,6 @@ value_check_printable (struct value *val, struct ui_file *stream, +@@ -1108,12 +1108,6 @@ value_check_printable (struct value *val, struct ui_file *stream, return 0; } @@ -1401,6 +1352,3 @@ index b19123f23e..d01d02fc09 100644 if (type_not_allocated (value_type (val))) { val_print_not_allocated (stream); --- -2.14.3 - diff --git a/gdb-vla-intel-stringbt-fix.patch b/gdb-vla-intel-stringbt-fix.patch index e3ad4ae..1c3ccd6 100644 --- a/gdb-vla-intel-stringbt-fix.patch +++ b/gdb-vla-intel-stringbt-fix.patch @@ -1,10 +1,7 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 1 Aug 2014 23:02:17 +0200 -Subject: Crash regression(?) printing Fortran strings in bt [Re: [V2 00/23] - Fortran dynamic array support] - -FileName: gdb-vla-intel-stringbt-fix.patch +Subject: gdb-vla-intel-stringbt-fix.patch ;;=push+jan @@ -29,18 +26,8 @@ cannot reproduce it. Thanks, Jan ---- - gdb/dwarf2loc.c | 15 +++++++++ - .../gdb.fortran/dynamic-other-frame-stub.f90 | 24 +++++++++++++ - gdb/testsuite/gdb.fortran/dynamic-other-frame.exp | 39 ++++++++++++++++++++++ - gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 | 36 ++++++++++++++++++++ - 4 files changed, 114 insertions(+) - create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 - create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame.exp - create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index 5105c8d23a..5486e4dc12 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -42,6 +42,7 @@ @@ -74,7 +61,6 @@ index 5105c8d23a..5486e4dc12 100644 ctx.gdbarch = get_objfile_arch (objfile); diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 new file mode 100644 -index 0000000000..261ce17ae5 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 @@ -0,0 +1,24 @@ @@ -104,7 +90,6 @@ index 0000000000..261ce17ae5 +end subroutine bar diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp new file mode 100644 -index 0000000000..570a28ca65 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp @@ -0,0 +1,39 @@ @@ -149,7 +134,6 @@ index 0000000000..570a28ca65 +gdb_test "bt" {foo \(string='hello'.*} diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 new file mode 100644 -index 0000000000..2bc637db49 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 @@ -0,0 +1,36 @@ @@ -189,6 +173,3 @@ index 0000000000..2bc637db49 + end interface + call foo ('hello') +end --- -2.14.3 - diff --git a/gdb-vla-intel-tests.patch b/gdb-vla-intel-tests.patch index b2dbabf..adadcb5 100644 --- a/gdb-vla-intel-tests.patch +++ b/gdb-vla-intel-tests.patch @@ -3,23 +3,10 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-vla-intel-tests.patch -FileName: gdb-vla-intel-tests.patch - ;;=fedoratest ---- - gdb/testsuite/gdb.fortran/vla-func.exp | 61 ++++++++++++++++ - gdb/testsuite/gdb.fortran/vla-func.f90 | 71 +++++++++++++++++++ - gdb/testsuite/gdb.fortran/vla-stringsold.exp | 101 +++++++++++++++++++++++++++ - gdb/testsuite/gdb.fortran/vla-stringsold.f90 | 40 +++++++++++ - 4 files changed, 273 insertions(+) - create mode 100644 gdb/testsuite/gdb.fortran/vla-func.exp - create mode 100644 gdb/testsuite/gdb.fortran/vla-func.f90 - create mode 100644 gdb/testsuite/gdb.fortran/vla-stringsold.exp - create mode 100644 gdb/testsuite/gdb.fortran/vla-stringsold.f90 diff --git a/gdb/testsuite/gdb.fortran/vla-func.exp b/gdb/testsuite/gdb.fortran/vla-func.exp new file mode 100644 -index 0000000000..f0f236bef0 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/vla-func.exp @@ -0,0 +1,61 @@ @@ -86,7 +73,6 @@ index 0000000000..f0f236bef0 + "ptype vla3 (after func2)" diff --git a/gdb/testsuite/gdb.fortran/vla-func.f90 b/gdb/testsuite/gdb.fortran/vla-func.f90 new file mode 100644 -index 0000000000..7540f54dbb --- /dev/null +++ b/gdb/testsuite/gdb.fortran/vla-func.f90 @@ -0,0 +1,71 @@ @@ -163,7 +149,6 @@ index 0000000000..7540f54dbb +end program vla_func diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.exp b/gdb/testsuite/gdb.fortran/vla-stringsold.exp new file mode 100644 -index 0000000000..c1bf7ef763 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/vla-stringsold.exp @@ -0,0 +1,101 @@ @@ -270,7 +255,6 @@ index 0000000000..c1bf7ef763 + "ptype var_char_p after associated" diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.f90 b/gdb/testsuite/gdb.fortran/vla-stringsold.f90 new file mode 100644 -index 0000000000..0a1d5221d0 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/vla-stringsold.f90 @@ -0,0 +1,40 @@ @@ -314,6 +298,3 @@ index 0000000000..0a1d5221d0 + var_char_p => null() + l = associated(var_char_p) ! var_char_p-not-associated +end program vla_strings --- -2.14.3 - diff --git a/gdb-x86_64-i386-syscall-restart.patch b/gdb-x86_64-i386-syscall-restart.patch index 3d0ce17..3d3f784 100644 --- a/gdb-x86_64-i386-syscall-restart.patch +++ b/gdb-x86_64-i386-syscall-restart.patch @@ -3,8 +3,6 @@ From: Fedora GDB patches Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-x86_64-i386-syscall-restart.patch -FileName: gdb-x86_64-i386-syscall-restart.patch - ;; Fix syscall restarts for amd64->i386 biarch. ;;=push+jan @@ -86,12 +84,8 @@ gdb/ * amd64-nat.c (amd64_collect_native_gregset): Do not pre-clear %eax. Sign extend it afterwards. ---- - gdb/amd64-nat.c | 20 ++++++++++++++++++-- - 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c -index 12d364a716..0359edf041 100644 --- a/gdb/amd64-nat.c +++ b/gdb/amd64-nat.c @@ -135,9 +135,9 @@ amd64_collect_native_gregset (const struct regcache *regcache, @@ -107,7 +101,7 @@ index 12d364a716..0359edf041 100644 if (regnum == -1 || regnum == i) memset (regs + amd64_native_gregset_reg_offset (gdbarch, i), 0, 8); @@ -163,4 +163,20 @@ amd64_collect_native_gregset (const struct regcache *regcache, - regcache_raw_collect (regcache, i, regs + offset); + regcache->raw_collect (i, regs + offset); } } + @@ -127,6 +121,3 @@ index 12d364a716..0359edf041 100644 + } + } } --- -2.14.3 - diff --git a/gdb.spec b/gdb.spec index 7b3b010..1c2e4f0 100644 --- a/gdb.spec +++ b/gdb.spec @@ -27,7 +27,7 @@ License: GPL-3.0-or-later AND GPL-3.0-with-GCC-exception AND LGPL-2.1-or- Group: Development/Tools/Debuggers Name: gdb -Version: 8.1 +Version: 8.2 Release: 0 # The release always contains a leading reserved number, start it at 1. @@ -88,7 +88,7 @@ Source4: gdbinit Source6: gdbtui # libipt: Intel Processor Trace Decoder Library -%global libipt_version 1.6.1 +%global libipt_version 2.0 Source7: v%{libipt_version}.tar.gz # Infrastructure to sync patches from the Fedora rpm @@ -127,115 +127,120 @@ Patch26: gdb-6.3-bz140532-ppc-unwinding-test.patch Patch27: gdb-6.3-bz202689-exec-from-pthread-test.patch Patch28: gdb-6.6-bz230000-power6-disassembly-test.patch Patch29: gdb-6.6-bz229517-gcore-without-terminal.patch -Patch30: gdb-6.6-bz235197-fork-detach-info.patch -Patch31: gdb-6.6-testsuite-timeouts.patch -Patch32: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch -Patch33: gdb-6.6-scheduler_locking-step-is-default.patch -Patch34: gdb-6.3-attach-see-vdso-test.patch -Patch35: gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch36: gdb-6.6-buildid-locate.patch -Patch37: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch38: gdb-6.6-buildid-locate-rpm.patch -Patch39: gdb-6.7-charsign-test.patch -Patch40: gdb-6.7-ppc-clobbered-registers-O2-test.patch -Patch41: gdb-6.7-testsuite-stable-results.patch -Patch42: gdb-6.5-ia64-libunwind-leak-test.patch -Patch43: gdb-6.5-missed-trap-on-step-test.patch -Patch44: gdb-6.5-gcore-buffer-limit-test.patch -Patch45: gdb-6.3-mapping-zero-inode-test.patch -Patch46: gdb-6.3-focus-cmd-prev-test.patch -Patch47: gdb-6.8-bz442765-threaded-exec-test.patch -Patch48: gdb-6.8-sparc64-silence-memcpy-check.patch -Patch49: gdb-6.5-section-num-fixup-test.patch -Patch50: gdb-6.8-bz436037-reg-no-longer-active.patch -Patch51: gdb-6.8-watchpoint-conditionals-test.patch -Patch52: gdb-6.8-bz466901-backtrace-full-prelinked.patch -Patch53: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch54: gdb-core-open-vdso-warning.patch -Patch55: gdb-x86_64-i386-syscall-restart.patch -Patch56: gdb-bz533176-fortran-omp-step.patch -Patch57: gdb-follow-child-stale-parent.patch -Patch58: gdb-ccache-workaround.patch -Patch59: gdb-archer-pie-addons.patch -Patch60: gdb-archer-pie-addons-keep-disabled.patch -Patch61: gdb-lineno-makeup-test.patch -Patch62: gdb-ppc-power7-test.patch -Patch63: gdb-bz541866-rwatch-before-run.patch -Patch64: gdb-moribund-utrace-workaround.patch -Patch65: gdb-archer-next-over-throw-cxx-exec.patch -Patch66: gdb-bz601887-dwarf4-rh-test.patch -Patch67: gdb-6.6-buildid-locate-core-as-arg.patch -Patch68: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch -Patch69: gdb-test-bt-cfi-without-die.patch -Patch70: gdb-gdb-add-index-script.patch -Patch71: gdb-bz568248-oom-is-error.patch -Patch72: gdb-bz634108-solib_address.patch -Patch73: gdb-test-pid0-core.patch -Patch74: gdb-test-dw2-aranges.patch -Patch75: gdb-test-expr-cumulative-archer.patch -Patch76: gdb-physname-pr11734-test.patch -Patch77: gdb-physname-pr12273-test.patch -Patch78: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch -Patch79: gdb-test-ivy-bridge.patch -Patch80: gdb-runtest-pie-override.patch -Patch81: gdb-attach-fail-reasons-5of5.patch -Patch82: gdb-stale-frame_info.patch -Patch83: gdb-glibc-strstr-workaround.patch -Patch84: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch -Patch85: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch86: gdb-rhbz795424-bitpos-20of25.patch -Patch87: gdb-rhbz795424-bitpos-21of25.patch -Patch88: gdb-rhbz795424-bitpos-22of25.patch -Patch89: gdb-rhbz795424-bitpos-23of25.patch -Patch90: gdb-rhbz795424-bitpos-25of25.patch -Patch91: gdb-rhbz795424-bitpos-25of25-test.patch -Patch92: gdb-rhbz795424-bitpos-lazyvalue.patch -Patch93: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch94: gdb-gnat-dwarf-crash-3of3.patch -Patch95: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch96: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch -Patch97: gdb-archer-vla-tests.patch -Patch98: gdb-vla-intel-tests.patch -Patch99: gdb-btrobust.patch -Patch100: gdb-fortran-frame-string.patch -Patch101: gdb-python-gil.patch -Patch102: gdb-rhbz1156192-recursive-dlopen-test.patch -Patch103: gdb-jit-reader-multilib.patch -Patch104: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch105: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch -Patch106: gdb-rhbz1350436-type-printers-error.patch -Patch107: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch108: gdb-bz1219747-attach-kills.patch -Patch109: gdb-fedora-libncursesw.patch -Patch110: gdb-opcodes-clflushopt-test.patch -Patch111: gdb-dts-rhel6-python-compat.patch -Patch112: gdb-6.6-buildid-locate-rpm-scl.patch -Patch113: gdb-readline62-ask-more-rh.patch -Patch114: gdb-6.8-attach-signalled-detach-stopped.patch -Patch115: gdb-6.8-quit-never-aborts.patch -Patch116: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch117: gdb-container-rh-pkg.patch -Patch118: gdb-rhbz1325795-framefilters-test.patch -Patch119: gdb-linux_perf-bundle.patch -Patch120: gdb-libexec-add-index.patch -Patch121: gdb-rhbz1398387-tab-crash-test.patch -Patch122: gdb-testsuite-readline63-sigint.patch -Patch123: gdb-archer.patch -Patch124: gdb-vla-intel-fix-print-char-array.patch -Patch125: gdb-rhbz1540559-gdbaddindex-glibcdebug-regression.patch -Patch126: gdb-ppc64-stwux-tautological-compare.patch +Patch30: gdb-6.6-testsuite-timeouts.patch +Patch31: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch32: gdb-6.6-scheduler_locking-step-is-default.patch +Patch33: gdb-6.3-attach-see-vdso-test.patch +Patch34: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch35: gdb-6.6-buildid-locate.patch +Patch36: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch37: gdb-6.6-buildid-locate-rpm.patch +Patch38: gdb-6.7-charsign-test.patch +Patch39: gdb-6.7-ppc-clobbered-registers-O2-test.patch +Patch40: gdb-6.7-testsuite-stable-results.patch +Patch41: gdb-6.5-ia64-libunwind-leak-test.patch +Patch42: gdb-6.5-missed-trap-on-step-test.patch +Patch43: gdb-6.5-gcore-buffer-limit-test.patch +Patch44: gdb-6.3-mapping-zero-inode-test.patch +Patch45: gdb-6.3-focus-cmd-prev-test.patch +Patch46: gdb-6.8-bz442765-threaded-exec-test.patch +Patch47: gdb-6.8-sparc64-silence-memcpy-check.patch +Patch48: gdb-6.5-section-num-fixup-test.patch +Patch49: gdb-6.8-bz436037-reg-no-longer-active.patch +Patch50: gdb-6.8-watchpoint-conditionals-test.patch +Patch51: gdb-6.8-bz466901-backtrace-full-prelinked.patch +Patch52: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch53: gdb-core-open-vdso-warning.patch +Patch54: gdb-x86_64-i386-syscall-restart.patch +Patch55: gdb-bz533176-fortran-omp-step.patch +Patch56: gdb-follow-child-stale-parent.patch +Patch57: gdb-ccache-workaround.patch +Patch58: gdb-archer-pie-addons.patch +Patch59: gdb-archer-pie-addons-keep-disabled.patch +Patch60: gdb-lineno-makeup-test.patch +Patch61: gdb-ppc-power7-test.patch +Patch62: gdb-bz541866-rwatch-before-run.patch +Patch63: gdb-moribund-utrace-workaround.patch +Patch64: gdb-archer-next-over-throw-cxx-exec.patch +Patch65: gdb-bz601887-dwarf4-rh-test.patch +Patch66: gdb-6.6-buildid-locate-core-as-arg.patch +Patch67: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +Patch68: gdb-test-bt-cfi-without-die.patch +Patch69: gdb-bz568248-oom-is-error.patch +Patch70: gdb-bz634108-solib_address.patch +Patch71: gdb-test-pid0-core.patch +Patch72: gdb-test-dw2-aranges.patch +Patch73: gdb-test-expr-cumulative-archer.patch +Patch74: gdb-physname-pr11734-test.patch +Patch75: gdb-physname-pr12273-test.patch +Patch76: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch +Patch77: gdb-test-ivy-bridge.patch +Patch78: gdb-runtest-pie-override.patch +Patch79: gdb-attach-fail-reasons-5of5.patch +Patch80: gdb-glibc-strstr-workaround.patch +Patch81: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +Patch82: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch83: gdb-rhbz795424-bitpos-20of25.patch +Patch84: gdb-rhbz795424-bitpos-21of25.patch +Patch85: gdb-rhbz795424-bitpos-22of25.patch +Patch86: gdb-rhbz795424-bitpos-23of25.patch +Patch87: gdb-rhbz795424-bitpos-25of25.patch +Patch88: gdb-rhbz795424-bitpos-25of25-test.patch +Patch89: gdb-rhbz795424-bitpos-lazyvalue.patch +Patch90: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch91: gdb-gnat-dwarf-crash-3of3.patch +Patch92: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch93: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +Patch94: gdb-archer-vla-tests.patch +Patch95: gdb-vla-intel-tests.patch +Patch96: gdb-btrobust.patch +Patch97: gdb-fortran-frame-string.patch +Patch98: gdb-python-gil.patch +Patch99: gdb-rhbz1156192-recursive-dlopen-test.patch +Patch100: gdb-jit-reader-multilib.patch +Patch101: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch102: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch +Patch103: gdb-rhbz1350436-type-printers-error.patch +Patch104: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch105: gdb-bz1219747-attach-kills.patch +Patch106: gdb-fedora-libncursesw.patch +Patch107: gdb-opcodes-clflushopt-test.patch +Patch108: gdb-dts-rhel6-python-compat.patch +Patch109: gdb-6.6-buildid-locate-rpm-scl.patch +Patch110: gdb-readline62-ask-more-rh.patch +Patch111: gdb-6.8-quit-never-aborts.patch +Patch112: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch113: gdb-container-rh-pkg.patch +Patch114: gdb-rhbz1325795-framefilters-test.patch +Patch115: gdb-linux_perf-bundle.patch +Patch116: gdb-libexec-add-index.patch +Patch117: gdb-rhbz1398387-tab-crash-test.patch +Patch118: gdb-testsuite-readline63-sigint.patch +Patch119: gdb-archer.patch +Patch120: gdb-vla-intel-fix-print-char-array.patch +Patch121: gdb-rhbz1553104-s390x-arch12-test.patch +Patch122: gdb-rhbz881849-ipv6-1of3.patch +Patch123: gdb-rhbz881849-ipv6-2of3.patch +Patch124: gdb-rhbz881849-ipv6-3of3.patch +Patch125: gdb-rhbz1187581-power8-regs-1of7.patch +Patch126: gdb-rhbz1187581-power8-regs-2of7.patch +Patch127: gdb-rhbz1187581-power8-regs-3of7.patch +Patch128: gdb-rhbz1187581-power8-regs-4of7.patch +Patch129: gdb-rhbz1187581-power8-regs-5of7.patch +Patch130: gdb-rhbz1187581-power8-regs-6of7.patch +Patch131: gdb-rhbz1187581-power8-regs-7of7.patch +Patch132: gdb-rhbz1491128-batch-mode-exit-status-1of2.patch +Patch133: gdb-rhbz1491128-batch-mode-exit-status-2of2.patch +Patch134: gdb-use-pulongest-aarch64-linux-tdep.patch #Fedora Packages end # Upstream patch to fix gcc -Werror Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch -Patch1003: gdb-pahole-python2.patch Patch1004: gdb-fix-buf-overflow.diff Patch1005: gdb-7.10-swo18929.patch -Patch1006: gdb-fix-python37-breakage.patch # libipt support Patch3000: v1.5-libipt-static.patch -Patch3001: v1.6.1-implicit-fallthrough.patch BuildRequires: bison BuildRequires: flex @@ -533,13 +538,19 @@ find -name "*.info*"|xargs rm -f %patch124 -p1 %patch125 -p1 %patch126 -p1 +%patch127 -p1 +%patch128 -p1 +%patch129 -p1 +%patch130 -p1 +%patch131 -p1 +%patch132 -p1 +%patch133 -p1 +%patch134 -p1 #Fedora patching end %patch1002 -p1 -%patch1003 -p1 %patch1004 -p1 %patch1005 -p1 -%patch1006 -p1 #unpack libipt %if 0%{have_libipt} @@ -547,7 +558,6 @@ tar xzf %{SOURCE7} ( cd processor-trace-%{libipt_version} %patch3000 -p1 -%patch3001 -p1 ) %endif @@ -763,10 +773,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} V=1 CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" 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} V=1 CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" ! grep '_RELOCATABLE.*1' gdb/config.h diff --git a/v1.6.1-implicit-fallthrough.patch b/v1.6.1-implicit-fallthrough.patch deleted file mode 100644 index 22eefec..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; diff --git a/v1.6.1.tar.gz b/v1.6.1.tar.gz deleted file mode 100644 index 459d757..0000000 --- a/v1.6.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:861fd8178414e07ba622b5e40f5ba4d68d62f4712a8302a7ec51997748c4585a -size 250843 diff --git a/v2.0.tar.gz b/v2.0.tar.gz new file mode 100644 index 0000000..f4780c1 --- /dev/null +++ b/v2.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:668aed61eb20cda87e26e87f5a72d75260052ab498fe6447109cdd18dc8afaad +size 338965