From 99f0af80c5e673f778726f34a325101dc118da2e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 26 2017 09:15:20 +0000 Subject: import devtoolset-6-gdb-7.12.1-47.el7 --- diff --git a/.devtoolset-6-gdb.metadata b/.devtoolset-6-gdb.metadata index e511356..fd41e50 100644 --- a/.devtoolset-6-gdb.metadata +++ b/.devtoolset-6-gdb.metadata @@ -1,3 +1,3 @@ -1a6a0f2fe04d6ac9ba85048af35610e0fc217300 SOURCES/gdb-7.12.tar.xz -f5043eb584343c9c3e7c97ebee1513dd4fb9df79 SOURCES/gdb-libstdc++-v3-python-6.1.1-20160817.tar.xz +ef77c5345d6f9fdcdf7a5d8503301242b701936e SOURCES/gdb-7.12.1.tar.xz +856c71b45cae294145cacd90551d0358f4ed2da5 SOURCES/gdb-libstdc++-v3-python-6.3.1-20170212.tar.xz 054196d0467df156415950778c11b2346f757cd1 SOURCES/v1.5.tar.gz diff --git a/.gitignore b/.gitignore index f54ed8c..2aaef91 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -SOURCES/gdb-7.12.tar.xz -SOURCES/gdb-libstdc++-v3-python-6.1.1-20160817.tar.xz +SOURCES/gdb-7.12.1.tar.xz +SOURCES/gdb-libstdc++-v3-python-6.3.1-20170212.tar.xz SOURCES/v1.5.tar.gz diff --git a/SOURCES/gdb-aarch64-nextoverthrow.patch b/SOURCES/gdb-aarch64-nextoverthrow.patch deleted file mode 100644 index 54c4003..0000000 --- a/SOURCES/gdb-aarch64-nextoverthrow.patch +++ /dev/null @@ -1,138 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2016-10/msg00287.html -Subject: Re: aarch64 regression: gdb.cp/nextoverthrow.exp [Re: [PATCH master+7.12] [AArch64] Match instruction "STP with base register" in prologue] - -Jan Kratochvil writes: - ->> Could you open a ticket in bugzilla for this error? I am testing a patch. -> -> https://sourceware.org/bugzilla/show_bug.cgi?id=20682 - -Thanks, here is the patch... - --- -Yao (齐尧) - ->From 5794d10bcda63da8fc47d0a76c29669af83ed48b Mon Sep 17 00:00:00 2001 -From: Yao Qi -Date: Tue, 11 Oct 2016 12:12:46 +0100 -Subject: [PATCH] [AArch64] Track FP registers in prologue analyzer - -We don't track FP registers in aarch64 prologue analyzer, so this causes -an internal error when FP registers are saved by "stp" instruction in -prologue (stp d8, d9, [sp,#128]), - - tbreak _Unwind_RaiseException^M - aarch64-tdep.c:335: internal-error: CORE_ADDR aarch64_analyze_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, aarch64_prologue_cache*): Assertion `inst.operands[0].type == AARCH64_OPND_Rt' failed.^M - A problem internal to GDB has been detected, - -This patch teaches GDB to track FP registers (D registers) in prologue -analyzer. - -gdb: - -2016-10-12 Yao Qi - - PR tdep/20682 - * aarch64-tdep.c: Replace 32 with AARCH64_D_REGISTER_COUNT. - (aarch64_analyze_prologue): Extend array 'regs' for D registers. - Assert that operand 0 and 1 can be X or D registers. Update - register number for D registers. Update registers in frame - cache. - * aarch64-tdep.h (AARCH64_D_REGISTER_COUNT): New macro. - -diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c -index 16dd365..be72785 100644 ---- a/gdb/aarch64-tdep.c -+++ b/gdb/aarch64-tdep.c -@@ -68,7 +68,7 @@ - - /* Pseudo register base numbers. */ - #define AARCH64_Q0_REGNUM 0 --#define AARCH64_D0_REGNUM (AARCH64_Q0_REGNUM + 32) -+#define AARCH64_D0_REGNUM (AARCH64_Q0_REGNUM + AARCH64_D_REGISTER_COUNT) - #define AARCH64_S0_REGNUM (AARCH64_D0_REGNUM + 32) - #define AARCH64_H0_REGNUM (AARCH64_S0_REGNUM + 32) - #define AARCH64_B0_REGNUM (AARCH64_H0_REGNUM + 32) -@@ -206,11 +206,12 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, - { - enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); - int i; -- pv_t regs[AARCH64_X_REGISTER_COUNT]; -+ /* Track X registers and D registers in prologue. */ -+ pv_t regs[AARCH64_X_REGISTER_COUNT + AARCH64_D_REGISTER_COUNT]; - struct pv_area *stack; - struct cleanup *back_to; - -- for (i = 0; i < AARCH64_X_REGISTER_COUNT; i++) -+ for (i = 0; i < AARCH64_X_REGISTER_COUNT + AARCH64_D_REGISTER_COUNT; i++) - regs[i] = pv_register (i, 0); - stack = make_pv_area (AARCH64_SP_REGNUM, gdbarch_addr_bit (gdbarch)); - back_to = make_cleanup_free_pv_area (stack); -@@ -328,13 +329,15 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, - && strcmp ("stp", inst.opcode->name) == 0) - { - /* STP with addressing mode Pre-indexed and Base register. */ -- unsigned rt1 = inst.operands[0].reg.regno; -- unsigned rt2 = inst.operands[1].reg.regno; -+ unsigned rt1; -+ unsigned rt2; - unsigned rn = inst.operands[2].addr.base_regno; - int32_t imm = inst.operands[2].addr.offset.imm; - -- gdb_assert (inst.operands[0].type == AARCH64_OPND_Rt); -- gdb_assert (inst.operands[1].type == AARCH64_OPND_Rt2); -+ gdb_assert (inst.operands[0].type == AARCH64_OPND_Rt -+ || inst.operands[0].type == AARCH64_OPND_Ft); -+ gdb_assert (inst.operands[1].type == AARCH64_OPND_Rt2 -+ || inst.operands[1].type == AARCH64_OPND_Ft2); - gdb_assert (inst.operands[2].type == AARCH64_OPND_ADDR_SIMM7); - gdb_assert (!inst.operands[2].addr.offset.is_reg); - -@@ -349,6 +352,17 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, - pv_add_constant (regs[rn], imm + 8))) - break; - -+ rt1 = inst.operands[0].reg.regno; -+ rt2 = inst.operands[1].reg.regno; -+ if (inst.operands[0].type == AARCH64_OPND_Ft) -+ { -+ /* Only bottom 64-bit of each V register (D register) need -+ to be preserved. */ -+ gdb_assert (inst.operands[0].qualifier == AARCH64_OPND_QLF_S_D); -+ rt1 += AARCH64_X_REGISTER_COUNT; -+ rt2 += AARCH64_X_REGISTER_COUNT; -+ } -+ - pv_area_store (stack, pv_add_constant (regs[rn], imm), 8, - regs[rt1]); - pv_area_store (stack, pv_add_constant (regs[rn], imm + 8), 8, -@@ -408,6 +422,16 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, - cache->saved_regs[i].addr = offset; - } - -+ for (i = 0; i < AARCH64_D_REGISTER_COUNT; i++) -+ { -+ int regnum = gdbarch_num_regs (gdbarch); -+ CORE_ADDR offset; -+ -+ if (pv_area_find_reg (stack, gdbarch, i + AARCH64_X_REGISTER_COUNT, -+ &offset)) -+ cache->saved_regs[i + regnum + AARCH64_D0_REGNUM].addr = offset; -+ } -+ - do_cleanups (back_to); - return start; - } -diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h -index a95b613..6252820 100644 ---- a/gdb/aarch64-tdep.h -+++ b/gdb/aarch64-tdep.h -@@ -68,6 +68,8 @@ enum aarch64_regnum - - /* Total number of general (X) registers. */ - #define AARCH64_X_REGISTER_COUNT 32 -+/* Total number of D registers. */ -+#define AARCH64_D_REGISTER_COUNT 32 - - /* The maximum number of modified instructions generated for one - single-stepped instruction. */ diff --git a/SOURCES/gdb-add-index-chmod.patch b/SOURCES/gdb-add-index-chmod.patch new file mode 100755 index 0000000..00b37c4 --- /dev/null +++ b/SOURCES/gdb-add-index-chmod.patch @@ -0,0 +1,69 @@ +http://sourceware.org/ml/gdb-patches/2017-01/msg00110.html +Subject: [patch] contrib/gdb-add-index.sh: chmod u+w + + +--AhhlLboLdkugWU4S +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi, + +in Fedora 24 it still worked, in Fedora 25 it does not - *-debuginfo.rpm +no longer have the .gdb_index accelerating section now. + +It happens because: +objcopy: unable to copy file 'foo.debug'; reason: Permission denied + +*.debug files in Fedora were always 444 but the time gdb-add-index is run is +still before the *.debug split and in Fedora 24 the files were -rwxr-xr-x +that time while in Fedora 25 they are apparently no longer w. + +OK for check-in? + + +Jan + +--AhhlLboLdkugWU4S +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename=1 + +gdb/ChangeLog +2017-01-06 Jan Kratochvil + + * contrib/gdb-add-index.sh: Use chmod u+w for $file. + +diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh +index 0cd4ce3..5a190a0 100755 +--- a/gdb/contrib/gdb-add-index.sh ++++ b/gdb/contrib/gdb-add-index.sh +@@ -38,10 +38,11 @@ fi + dir="${file%/*}" + test "$dir" = "$file" && dir="." + index="${file}.gdb-index" ++mode="${file}.mode" + +-rm -f $index ++rm -f $index $mode + # Ensure intermediate index file is removed when we exit. +-trap "rm -f $index" 0 ++trap "rm -f $index $mode" 0 + + $GDB --batch -nx -iex 'set auto-load no' \ + -ex "file $file" -ex "save gdb-index $dir" || { +@@ -58,8 +59,13 @@ $GDB --batch -nx -iex 'set auto-load no' \ + status=0 + + if test -f "$index"; then ++ touch "$mode" ++ chmod --reference="$file" "$mode" ++ # objcopy: unable to copy file 'foo.debug'; reason: Permission denied ++ chmod u+w "$file" + $OBJCOPY --add-section .gdb_index="$index" \ + --set-section-flags .gdb_index=readonly "$file" "$file" ++ chmod --reference="$mode" "$file" + status=$? + else + echo "$myname: No index was created for $file" 1>&2 + +--AhhlLboLdkugWU4S-- + diff --git a/SOURCES/gdb-archer-vla-tests.patch b/SOURCES/gdb-archer-vla-tests.patch index f30180a..b27ef75 100644 --- a/SOURCES/gdb-archer-vla-tests.patch +++ b/SOURCES/gdb-archer-vla-tests.patch @@ -1,7 +1,7 @@ -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.ada/packed_array.exp +Index: gdb-7.12/gdb/testsuite/gdb.ada/packed_array.exp =================================================================== ---- gdb-7.11.90.20160807.orig/gdb/testsuite/gdb.ada/packed_array.exp 2016-08-07 04:00:01.000000000 +0200 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.ada/packed_array.exp 2016-08-25 18:44:42.058789058 +0200 +--- gdb-7.12.orig/gdb/testsuite/gdb.ada/packed_array.exp 2016-08-01 17:50:21.000000000 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.ada/packed_array.exp 2016-10-22 09:45:15.849013467 +0200 @@ -56,5 +56,11 @@ # are. Observed with (FSF GNU Ada 4.5.3 20110124). xfail $test @@ -14,10 +14,493 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.ada/packed_array.exp + } } -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S +Index: gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S 2016-08-25 18:44:42.058789058 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S 2016-10-22 09:50:38.510393903 +0200 +@@ -0,0 +1,358 @@ ++ .file "x86_64-vla-pointer.c" ++ .text ++.Ltext0: ++ .globl foo ++ .type foo, @function ++foo: ++.LFB0: ++ .file 1 "gdb.arch/x86_64-vla-pointer.c" ++ # gdb.arch/x86_64-vla-pointer.c:22 ++ .loc 1 22 0 ++ .cfi_startproc ++# BLOCK 2 seq:0 ++# PRED: ENTRY (FALLTHRU) ++ pushq %rbp ++ .cfi_def_cfa_offset 16 ++ .cfi_offset 6, -16 ++ movq %rsp, %rbp ++ .cfi_def_cfa_register 6 ++ pushq %rbx ++ subq $56, %rsp ++ .cfi_offset 3, -24 ++ movl %edi, -52(%rbp) ++ # gdb.arch/x86_64-vla-pointer.c:22 ++ .loc 1 22 0 ++ movq %rsp, %rax ++ movq %rax, %rsi ++ # gdb.arch/x86_64-vla-pointer.c:23 ++ .loc 1 23 0 ++ movl -52(%rbp), %eax ++ movslq %eax, %rdx ++ subq $1, %rdx ++ movq %rdx, -32(%rbp) ++ movslq %eax, %rdx ++ movq %rdx, %r8 ++ movl $0, %r9d ++ # gdb.arch/x86_64-vla-pointer.c:24 ++ .loc 1 24 0 ++ movslq %eax, %rdx ++ movq %rdx, %rcx ++ movl $0, %ebx ++ cltq ++ movl $16, %edx ++ subq $1, %rdx ++ addq %rdx, %rax ++ movl $16, %ebx ++ movl $0, %edx ++ divq %rbx ++ imulq $16, %rax, %rax ++ subq %rax, %rsp ++ movq %rsp, %rax ++ addq $0, %rax ++ movq %rax, -40(%rbp) ++ # gdb.arch/x86_64-vla-pointer.c:27 ++ .loc 1 27 0 ++ movl $0, -20(%rbp) ++# SUCC: 4 [100.0%] ++ jmp .L2 ++# BLOCK 3 seq:1 ++# PRED: 4 ++.L3: ++ # gdb.arch/x86_64-vla-pointer.c:28 ++ .loc 1 28 0 discriminator 3 ++ movl -20(%rbp), %eax ++ movl %eax, %ecx ++ movq -40(%rbp), %rdx ++ movl -20(%rbp), %eax ++ cltq ++ movb %cl, (%rdx,%rax) ++# SUCC: 4 (FALLTHRU,DFS_BACK) ++ # gdb.arch/x86_64-vla-pointer.c:27 ++ .loc 1 27 0 discriminator 3 ++ addl $1, -20(%rbp) ++# BLOCK 4 seq:2 ++# PRED: 3 (FALLTHRU,DFS_BACK) 2 [100.0%] ++.L2: ++ # gdb.arch/x86_64-vla-pointer.c:27 ++ .loc 1 27 0 is_stmt 0 discriminator 1 ++ movl -20(%rbp), %eax ++ cmpl -52(%rbp), %eax ++# SUCC: 3 5 (FALLTHRU) ++ jl .L3 ++# BLOCK 5 seq:3 ++# PRED: 4 (FALLTHRU) ++ # gdb.arch/x86_64-vla-pointer.c:30 ++ .loc 1 30 0 is_stmt 1 ++ movq -40(%rbp), %rax ++ movb $0, (%rax) ++ movq %rsi, %rsp ++ # gdb.arch/x86_64-vla-pointer.c:31 ++ .loc 1 31 0 ++ nop ++ movq -8(%rbp), %rbx ++ leave ++ .cfi_def_cfa 7, 8 ++# SUCC: EXIT [100.0%] ++ ret ++ .cfi_endproc ++.LFE0: ++ .size foo, .-foo ++.Letext0: ++ .section .debug_info,"",@progbits ++.Ldebug_info0: ++ .long 0xa5 # Length of Compilation Unit Info ++ .value 0x4 # DWARF version number ++ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section ++ .byte 0x8 # Pointer Size (in bytes) ++ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit) ++ .long .LASF3 # DW_AT_producer: "GNU C11 6.2.1 20160916 (Red Hat 6.2.1-2) -mtune=generic -march=x86-64 -g" ++ .byte 0xc # DW_AT_language ++ .long .LASF4 # DW_AT_name: "gdb.arch/x86_64-vla-pointer.c" ++ .long .LASF5 # DW_AT_comp_dir: "/home/jkratoch/redhat/fedora/gdb/master/gdb-7.12/gdb/testsuite" ++ .quad .Ltext0 # DW_AT_low_pc ++ .quad .Letext0-.Ltext0 # DW_AT_high_pc ++ .long .Ldebug_line0 # DW_AT_stmt_list ++ .uleb128 0x2 # (DIE (0x2d) DW_TAG_subprogram) ++ # DW_AT_external ++ .ascii "foo\0" # DW_AT_name ++ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c) ++ .byte 0x15 # DW_AT_decl_line ++ # DW_AT_prototyped ++ .quad .LFB0 # DW_AT_low_pc ++ .quad .LFE0-.LFB0 # DW_AT_high_pc ++ .uleb128 0x1 # DW_AT_frame_base ++ .byte 0x9c # DW_OP_call_frame_cfa ++ # DW_AT_GNU_all_call_sites ++ .long 0x80 # DW_AT_sibling ++ .uleb128 0x3 # (DIE (0x4a) DW_TAG_formal_parameter) ++ .long .LASF6 # DW_AT_name: "size" ++ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c) ++ .byte 0x15 # DW_AT_decl_line ++ .long 0x80 # DW_AT_type ++ .uleb128 0x3 # DW_AT_location ++ .byte 0x91 # DW_OP_fbreg ++ .sleb128 -68 ++ .uleb128 0x4 # (DIE (0x59) DW_TAG_typedef) ++ .long .LASF7 # DW_AT_name: "array_t" ++ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c) ++ .byte 0x17 # DW_AT_decl_line ++ .long 0x87 # DW_AT_type ++ .uleb128 0x5 # (DIE (0x64) DW_TAG_variable) ++ .long .LASF0 # DW_AT_name: "array" ++ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c) ++ .byte 0x18 # DW_AT_decl_line ++ .long 0x59 # DW_AT_type ++ .uleb128 0x3 # DW_AT_location ++ .byte 0x91 # DW_OP_fbreg ++ .sleb128 -56 ++ .byte 0x6 # DW_OP_deref ++ .uleb128 0x6 # (DIE (0x73) DW_TAG_variable) ++ .ascii "i\0" # DW_AT_name ++ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c) ++ .byte 0x19 # DW_AT_decl_line ++ .long 0x80 # DW_AT_type ++ .uleb128 0x2 # DW_AT_location ++ .byte 0x91 # DW_OP_fbreg ++ .sleb128 -36 ++ .byte 0 # end of children of DIE 0x2d ++ .uleb128 0x7 # (DIE (0x80) DW_TAG_base_type) ++ .byte 0x4 # DW_AT_byte_size ++ .byte 0x5 # DW_AT_encoding ++ .ascii "int\0" # DW_AT_name ++ .uleb128 0x8 # (DIE (0x87) DW_TAG_array_type) ++ .long 0xa1 # DW_AT_type ++ .long 0x9a # DW_AT_sibling ++ .uleb128 0x9 # (DIE (0x90) DW_TAG_subrange_type) ++ .long 0x9a # DW_AT_type ++ .uleb128 0x3 # DW_AT_upper_bound ++ .byte 0x91 # DW_OP_fbreg ++ .sleb128 -48 ++ .byte 0x6 # DW_OP_deref ++ .byte 0 # end of children of DIE 0x87 ++ .uleb128 0xa # (DIE (0x9a) DW_TAG_base_type) ++ .byte 0x8 # DW_AT_byte_size ++ .byte 0x7 # DW_AT_encoding ++ .long .LASF1 # DW_AT_name: "sizetype" ++ .uleb128 0xa # (DIE (0xa1) DW_TAG_base_type) ++ .byte 0x1 # DW_AT_byte_size ++ .byte 0x6 # DW_AT_encoding ++ .long .LASF2 # DW_AT_name: "char" ++ .byte 0 # end of children of DIE 0xb ++ .section .debug_abbrev,"",@progbits ++.Ldebug_abbrev0: ++ .uleb128 0x1 # (abbrev code) ++ .uleb128 0x11 # (TAG: DW_TAG_compile_unit) ++ .byte 0x1 # DW_children_yes ++ .uleb128 0x25 # (DW_AT_producer) ++ .uleb128 0xe # (DW_FORM_strp) ++ .uleb128 0x13 # (DW_AT_language) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x3 # (DW_AT_name) ++ .uleb128 0xe # (DW_FORM_strp) ++ .uleb128 0x1b # (DW_AT_comp_dir) ++ .uleb128 0xe # (DW_FORM_strp) ++ .uleb128 0x11 # (DW_AT_low_pc) ++ .uleb128 0x1 # (DW_FORM_addr) ++ .uleb128 0x12 # (DW_AT_high_pc) ++ .uleb128 0x7 # (DW_FORM_data8) ++ .uleb128 0x10 # (DW_AT_stmt_list) ++ .uleb128 0x17 # (DW_FORM_sec_offset) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x2 # (abbrev code) ++ .uleb128 0x2e # (TAG: DW_TAG_subprogram) ++ .byte 0x1 # DW_children_yes ++ .uleb128 0x3f # (DW_AT_external) ++ .uleb128 0x19 # (DW_FORM_flag_present) ++ .uleb128 0x3 # (DW_AT_name) ++ .uleb128 0x8 # (DW_FORM_string) ++ .uleb128 0x3a # (DW_AT_decl_file) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x3b # (DW_AT_decl_line) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x27 # (DW_AT_prototyped) ++ .uleb128 0x19 # (DW_FORM_flag_present) ++ .uleb128 0x11 # (DW_AT_low_pc) ++ .uleb128 0x1 # (DW_FORM_addr) ++ .uleb128 0x12 # (DW_AT_high_pc) ++ .uleb128 0x7 # (DW_FORM_data8) ++ .uleb128 0x40 # (DW_AT_frame_base) ++ .uleb128 0x18 # (DW_FORM_exprloc) ++ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites) ++ .uleb128 0x19 # (DW_FORM_flag_present) ++ .uleb128 0x1 # (DW_AT_sibling) ++ .uleb128 0x13 # (DW_FORM_ref4) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x3 # (abbrev code) ++ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) ++ .byte 0 # DW_children_no ++ .uleb128 0x3 # (DW_AT_name) ++ .uleb128 0xe # (DW_FORM_strp) ++ .uleb128 0x3a # (DW_AT_decl_file) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x3b # (DW_AT_decl_line) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x49 # (DW_AT_type) ++ .uleb128 0x13 # (DW_FORM_ref4) ++ .uleb128 0x2 # (DW_AT_location) ++ .uleb128 0x18 # (DW_FORM_exprloc) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x4 # (abbrev code) ++ .uleb128 0x16 # (TAG: DW_TAG_typedef) ++ .byte 0 # DW_children_no ++ .uleb128 0x3 # (DW_AT_name) ++ .uleb128 0xe # (DW_FORM_strp) ++ .uleb128 0x3a # (DW_AT_decl_file) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x3b # (DW_AT_decl_line) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x49 # (DW_AT_type) ++ .uleb128 0x13 # (DW_FORM_ref4) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x5 # (abbrev code) ++ .uleb128 0x34 # (TAG: DW_TAG_variable) ++ .byte 0 # DW_children_no ++ .uleb128 0x3 # (DW_AT_name) ++ .uleb128 0xe # (DW_FORM_strp) ++ .uleb128 0x3a # (DW_AT_decl_file) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x3b # (DW_AT_decl_line) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x49 # (DW_AT_type) ++ .uleb128 0x13 # (DW_FORM_ref4) ++ .uleb128 0x2 # (DW_AT_location) ++ .uleb128 0x18 # (DW_FORM_exprloc) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x6 # (abbrev code) ++ .uleb128 0x34 # (TAG: DW_TAG_variable) ++ .byte 0 # DW_children_no ++ .uleb128 0x3 # (DW_AT_name) ++ .uleb128 0x8 # (DW_FORM_string) ++ .uleb128 0x3a # (DW_AT_decl_file) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x3b # (DW_AT_decl_line) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x49 # (DW_AT_type) ++ .uleb128 0x13 # (DW_FORM_ref4) ++ .uleb128 0x2 # (DW_AT_location) ++ .uleb128 0x18 # (DW_FORM_exprloc) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x7 # (abbrev code) ++ .uleb128 0x24 # (TAG: DW_TAG_base_type) ++ .byte 0 # DW_children_no ++ .uleb128 0xb # (DW_AT_byte_size) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x3e # (DW_AT_encoding) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x3 # (DW_AT_name) ++ .uleb128 0x8 # (DW_FORM_string) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x8 # (abbrev code) ++ .uleb128 0x1 # (TAG: DW_TAG_array_type) ++ .byte 0x1 # DW_children_yes ++ .uleb128 0x49 # (DW_AT_type) ++ .uleb128 0x13 # (DW_FORM_ref4) ++ .uleb128 0x1 # (DW_AT_sibling) ++ .uleb128 0x13 # (DW_FORM_ref4) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x9 # (abbrev code) ++ .uleb128 0x21 # (TAG: DW_TAG_subrange_type) ++ .byte 0 # DW_children_no ++ .uleb128 0x49 # (DW_AT_type) ++ .uleb128 0x13 # (DW_FORM_ref4) ++ .uleb128 0x2f # (DW_AT_upper_bound) ++ .uleb128 0x18 # (DW_FORM_exprloc) ++ .byte 0 ++ .byte 0 ++ .uleb128 0xa # (abbrev code) ++ .uleb128 0x24 # (TAG: DW_TAG_base_type) ++ .byte 0 # DW_children_no ++ .uleb128 0xb # (DW_AT_byte_size) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x3e # (DW_AT_encoding) ++ .uleb128 0xb # (DW_FORM_data1) ++ .uleb128 0x3 # (DW_AT_name) ++ .uleb128 0xe # (DW_FORM_strp) ++ .byte 0 ++ .byte 0 ++ .byte 0 ++ .section .debug_aranges,"",@progbits ++ .long 0x2c # Length of Address Ranges Info ++ .value 0x2 # DWARF Version ++ .long .Ldebug_info0 # Offset of Compilation Unit Info ++ .byte 0x8 # Size of Address ++ .byte 0 # Size of Segment Descriptor ++ .value 0 # Pad to 16 byte boundary ++ .value 0 ++ .quad .Ltext0 # Address ++ .quad .Letext0-.Ltext0 # Length ++ .quad 0 ++ .quad 0 ++ .section .debug_line,"",@progbits ++.Ldebug_line0: ++ .section .debug_str,"MS",@progbits,1 ++.LASF4: ++ .string "gdb.arch/x86_64-vla-pointer.c" ++.LASF7: ++ .string "array_t" ++.LASF3: ++ .string "GNU C11 6.2.1 20160916 (Red Hat 6.2.1-2) -mtune=generic -march=x86-64 -g" ++.LASF2: ++ .string "char" ++.LASF1: ++ .string "sizetype" ++.LASF5: ++ .string "/home/jkratoch/redhat/fedora/gdb/master/gdb-7.12/gdb/testsuite" ++.LASF6: ++ .string "size" ++.LASF0: ++ .string "array" ++ .ident "GCC: (GNU) 6.2.1 20160916 (Red Hat 6.2.1-2)" ++ .section .note.GNU-stack,"",@progbits +Index: gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c 2016-10-22 09:50:40.335407367 +0200 +@@ -0,0 +1,45 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2009 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 0 ++ ++void ++foo (int size) ++{ ++ typedef char array_t[size]; ++ array_t array; ++ int i; ++ ++ for (i = 0; i < size; i++) ++ array[i] = i; ++ ++ array[0] = 0; /* break-here */ ++} ++ ++#else ++ ++void foo (int size); ++ ++int ++main (void) ++{ ++ foo (26); ++ foo (78); ++ return 0; ++} ++ ++#endif +Index: gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp 2016-10-22 21:10:56.210413346 +0200 +@@ -0,0 +1,65 @@ ++# Copyright 2009 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 "x86_64-*-*"] then { ++ verbose "Skipping over gdb.arch/x86_64-vla-pointer.exp test made only for x86_64." ++ return ++} ++ ++set testfile x86_64-vla-pointer ++set srcasmfile ${testfile}-foo.S ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++set binobjfile [standard_output_file ${testfile}-foo.o] ++if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto_main] { ++ untested x86_64-vla-pointer ++ return -1 ++} ++ ++gdb_breakpoint $srcfile:[gdb_get_line_number "break-here"] ++ ++gdb_continue_to_breakpoint "break-here" ++ ++gdb_test "whatis array" "type = array_t" "first: whatis array" ++gdb_test "whatis array_t" "type = char \\\[variable length\\\]" "first: whatis array_t" ++gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array" ++ ++gdb_test "whatis *array" "type = char" "first: whatis *array" ++gdb_test "ptype *array" "type = char" "first: ptype *array" ++ ++gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'" ++gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'" ++gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'" ++gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'" ++ ++gdb_continue_to_breakpoint "break_here" ++ ++gdb_test "whatis array" "type = array_t" "second: whatis array" ++gdb_test "whatis array_t" "type = char \\\[variable length\\\]" "second: whatis array_t" ++gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" +Index: gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S 2016-10-22 09:45:15.851013482 +0200 @@ -0,0 +1,455 @@ + .file "x86_64-vla-typedef.c" + .section .debug_abbrev,"",@progbits @@ -474,10 +957,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S + .string "GNU C 4.3.2 20081105 (Red Hat 4.3.2-7)" + .ident "GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)" + .section .note.GNU-stack,"",@progbits -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c +Index: gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c 2016-08-25 18:44:42.058789058 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c 2016-10-22 09:45:15.851013482 +0200 @@ -0,0 +1,45 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -524,10 +1007,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c +} + +#endif -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp +Index: gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp 2016-08-25 18:44:42.058789058 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp 2016-10-22 09:45:15.851013482 +0200 @@ -0,0 +1,64 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -593,10 +1076,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp +gdb_test "whatis array" "type = array_t" "second: whatis array" + +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/arrayidx.c +Index: gdb-7.12/gdb/testsuite/gdb.base/arrayidx.c =================================================================== ---- gdb-7.11.90.20160807.orig/gdb/testsuite/gdb.base/arrayidx.c 2016-08-07 04:00:01.000000000 +0200 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/arrayidx.c 2016-08-25 18:44:42.058789058 +0200 +--- gdb-7.12.orig/gdb/testsuite/gdb.base/arrayidx.c 2016-08-01 17:50:21.000000000 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/arrayidx.c 2016-10-22 09:45:15.851013482 +0200 @@ -17,6 +17,13 @@ int array[] = {1, 2, 3, 4}; @@ -611,10 +1094,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/arrayidx.c int main (void) { -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/arrayidx.exp +Index: gdb-7.12/gdb/testsuite/gdb.base/arrayidx.exp =================================================================== ---- gdb-7.11.90.20160807.orig/gdb/testsuite/gdb.base/arrayidx.exp 2016-08-07 04:00:01.000000000 +0200 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/arrayidx.exp 2016-08-25 18:44:42.059789067 +0200 +--- gdb-7.12.orig/gdb/testsuite/gdb.base/arrayidx.exp 2016-08-01 17:50:21.000000000 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/arrayidx.exp 2016-10-22 09:45:15.851013482 +0200 @@ -49,4 +49,12 @@ "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \ "Print array with array-indexes on" @@ -629,10 +1112,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/arrayidx.exp + unsupported "$test (no GCC)" + } +} -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/internal-var-field-address.c +Index: gdb-7.12/gdb/testsuite/gdb.base/internal-var-field-address.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/internal-var-field-address.c 2016-08-25 18:44:42.059789067 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/internal-var-field-address.c 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,20 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -654,10 +1137,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/internal-var-field-address.c +struct { + int field; +} staticstruct = { 1 }; -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/internal-var-field-address.exp +Index: gdb-7.12/gdb/testsuite/gdb.base/internal-var-field-address.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/internal-var-field-address.exp 2016-08-25 18:44:42.059789067 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/internal-var-field-address.exp 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,26 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -685,10 +1168,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/internal-var-field-address.ex + +gdb_test {set $varstruct = staticstruct} +gdb_test {p $varstruct.field} " = 1" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla-frame.c +Index: gdb-7.12/gdb/testsuite/gdb.base/vla-frame.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla-frame.c 2016-08-25 18:44:42.059789067 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/vla-frame.c 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,31 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -721,10 +1204,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla-frame.c + f (s); + return 0; +} -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla-frame.exp +Index: gdb-7.12/gdb/testsuite/gdb.base/vla-frame.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla-frame.exp 2016-08-25 18:44:42.059789067 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/vla-frame.exp 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,38 @@ +# Copyright 2011 Free Software Foundation, Inc. +# @@ -764,10 +1247,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla-frame.exp +} + +gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla-overflow.c +Index: gdb-7.12/gdb/testsuite/gdb.base/vla-overflow.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla-overflow.c 2016-08-25 18:44:42.059789067 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/vla-overflow.c 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,30 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -799,10 +1282,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla-overflow.c + + return 0; +} -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla-overflow.exp +Index: gdb-7.12/gdb/testsuite/gdb.base/vla-overflow.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla-overflow.exp 2016-08-25 18:44:42.059789067 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/vla-overflow.exp 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,109 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -913,10 +1396,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla-overflow.exp +gdb_test "bt" "in \[^ \]*abort \\(.* in main \\(.*" "Backtrace after abort()" + +verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla.c +Index: gdb-7.12/gdb/testsuite/gdb.base/vla.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla.c 2016-08-25 18:44:42.059789067 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/vla.c 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,55 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -973,10 +1456,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla.c + foo (78); + return 0; +} -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla.exp +Index: gdb-7.12/gdb/testsuite/gdb.base/vla.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla.exp 2016-08-25 18:44:42.059789067 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/vla.exp 2016-10-22 09:45:15.853013497 +0200 @@ -0,0 +1,62 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -1040,10 +1523,382 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/vla.exp +gdb_test "p temp1" " = '1' " "second: print temp1" +gdb_test "p temp2" " = '2' " "second: print temp2" +gdb_test "p temp3" " = '3' " "second: print temp3" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S +Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb9593.cc =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S 2016-08-25 18:44:42.060789076 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.cp/gdb9593.cc 2016-10-22 09:45:15.853013497 +0200 +@@ -0,0 +1,180 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008, 2009 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 . ++ */ ++#include ++ ++using namespace std; ++ ++class NextOverThrowDerivates ++{ ++ ++public: ++ ++ ++ // Single throw an exception in this function. ++ void function1() ++ { ++ throw 20; ++ } ++ ++ // Throw an exception in another function. ++ void function2() ++ { ++ function1(); ++ } ++ ++ // Throw an exception in another function, but handle it ++ // locally. ++ void function3 () ++ { ++ { ++ try ++ { ++ function1 (); ++ } ++ catch (...) ++ { ++ cout << "Caught and handled function1 exception" << endl; ++ } ++ } ++ } ++ ++ void rethrow () ++ { ++ try ++ { ++ function1 (); ++ } ++ catch (...) ++ { ++ throw; ++ } ++ } ++ ++ void finish () ++ { ++ // We use this to test that a "finish" here does not end up in ++ // this frame, but in the one above. ++ try ++ { ++ function1 (); ++ } ++ catch (int x) ++ { ++ } ++ function1 (); // marker for until ++ } ++ ++ void until () ++ { ++ function1 (); ++ function1 (); // until here ++ } ++ ++}; ++NextOverThrowDerivates next_cases; ++ ++ ++int main () ++{ ++ try ++ { ++ next_cases.function1 (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ try ++ { ++ next_cases.function2 (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ try ++ { ++ // This is duplicated so we can next over one but step into ++ // another. ++ next_cases.function2 (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ next_cases.function3 (); ++ ++ try ++ { ++ next_cases.rethrow (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ try ++ { ++ // Another duplicate so we can test "finish". ++ next_cases.function2 (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ // Another test for "finish". ++ try ++ { ++ next_cases.finish (); ++ } ++ catch (...) ++ { ++ } ++ ++ // Test of "until". ++ try ++ { ++ next_cases.finish (); ++ } ++ catch (...) ++ { ++ } ++ ++ // Test of "until" with an argument. ++ try ++ { ++ next_cases.until (); ++ } ++ catch (...) ++ { ++ } ++ ++ // Test of "advance". ++ try ++ { ++ next_cases.until (); ++ } ++ catch (...) ++ { ++ } ++} ++ +Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb9593.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.cp/gdb9593.exp 2016-10-22 09:45:15.853013497 +0200 +@@ -0,0 +1,182 @@ ++# Copyright 2008, 2009 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 $tracelevel then { ++ strace $tracelevel ++} ++ ++if { [skip_cplus_tests] } { continue } ++ ++set testfile "gdb9593" ++set srcfile ${testfile}.cc ++set binfile [standard_output_file $testfile] ++ ++# Create and source the file that provides information about the compiler ++# used to compile the test case. ++if [get_compiler_info "c++"] { ++ untested gdb9593.exp ++ return -1 ++} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { ++ untested gdb9593.exp ++ return -1 ++} ++ ++# Some targets can't do function calls, so don't even bother with this ++# test. ++if [target_info exists gdb,cannot_call_functions] { ++ setup_xfail "*-*-*" 9593 ++ fail "This target can not call functions" ++ continue ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto_main] then { ++ perror "couldn't run to main" ++ continue ++} ++ ++# See whether we have the needed unwinder hooks. ++set ok 1 ++gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook" { ++ -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" { ++ pass "check for unwinder hook" ++ } ++ -re "No symbol .* in current context.\r\n$gdb_prompt $" { ++ # Pass the test so we don't get bogus fails in the results. ++ pass "check for unwinder hook" ++ set ok 0 ++ } ++} ++if {!$ok} { ++ untested gdb9593.exp ++ return -1 ++} ++ ++# See http://sourceware.org/bugzilla/show_bug.cgi?id=9593 ++ ++gdb_test "next" \ ++ ".*catch (...).*" \ ++ "next over a throw 1" ++ ++gdb_test "next" \ ++ ".*next_cases.function2.*" \ ++ "next past catch 1" ++ ++gdb_test "next" \ ++ ".*catch (...).*" \ ++ "next over a throw 2" ++ ++gdb_test "next" \ ++ ".*next_cases.function2.*" \ ++ "next past catch 2" ++ ++gdb_test "step" \ ++ ".*function1().*" \ ++ "step into function2 1" ++ ++gdb_test "next" \ ++ ".*catch (...).*" \ ++ "next over a throw 3" ++ ++gdb_test "next" \ ++ ".*next_cases.function3.*" \ ++ "next past catch 3" ++ ++gdb_test "next" \ ++ ".*next_cases.rethrow.*" \ ++ "next over a throw 4" ++ ++gdb_test "next" \ ++ ".*catch (...).*" \ ++ "next over a rethrow" ++ ++gdb_test "next" \ ++ ".*next_cases.function2.*" \ ++ "next after a rethrow" ++ ++gdb_test "step" \ ++ ".*function1().*" \ ++ "step into function2 2" ++ ++gdb_test "finish" \ ++ ".*catch (...).*" \ ++ "finish 1" ++ ++gdb_test "next" \ ++ ".*next_cases.finish ().*" \ ++ "next past catch 4" ++ ++gdb_test "step" \ ++ ".*function1 ().*" \ ++ "step into finish method" ++ ++gdb_test "finish" \ ++ ".*catch (...).*" \ ++ "finish 2" ++ ++gdb_test "next" \ ++ ".*next_cases.finish ().*" \ ++ "next past catch 5" ++ ++gdb_test "step" \ ++ ".*function1 ().*" \ ++ "step into finish, for until" ++ ++gdb_test "until" \ ++ ".*function1 ().*" \ ++ "until with no argument 1" ++ ++set line [gdb_get_line_number "marker for until" $testfile.cc] ++ ++gdb_test "until $line" \ ++ ".*function1 ().*" \ ++ "next past catch 6" ++ ++gdb_test "until" \ ++ ".*catch (...).*" \ ++ "until with no argument 2" ++ ++set line [gdb_get_line_number "until here" $testfile.cc] ++ ++gdb_test "next" \ ++ ".*next_cases.until ().*" \ ++ "next past catch 6" ++ ++gdb_test "step" \ ++ ".*function1 ().*" \ ++ "step into until" ++ ++gdb_test "until $line" \ ++ ".*catch (...).*" \ ++ "until-over-throw" ++ ++gdb_test "next" \ ++ ".*next_cases.until ().*" \ ++ "next past catch 7" ++ ++gdb_test "step" \ ++ ".*function1 ().*" \ ++ "step into until, for advance" ++ ++gdb_test "advance $line" \ ++ ".*catch (...).*" \ ++ "advance-over-throw" +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S 2016-10-22 09:45:15.853013497 +0200 @@ -0,0 +1,246 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1291,10 +2146,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S + .string "char" +.Luint_str: + .string "unsigned int" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp 2016-08-25 18:44:42.060789076 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp 2016-10-22 09:45:15.854013504 +0200 @@ -0,0 +1,66 @@ +# Copyright 2010 Free Software Foundation, Inc. + @@ -1362,10 +2217,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp + +# The register contains unpredictable value - the array size. +gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]} -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-stripped.c +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-stripped.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-stripped.c 2016-08-25 18:44:42.060789076 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-stripped.c 2016-10-22 09:45:15.854013504 +0200 @@ -0,0 +1,42 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1409,10 +2264,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-stripped.c + func1 (1, 2); + return 0; +} -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp 2016-08-25 18:44:42.060789076 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp 2016-10-22 09:45:15.854013504 +0200 @@ -0,0 +1,79 @@ +# Copyright 2006 Free Software Foundation, Inc. + @@ -1445,7 +2300,7 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp + +set testfile "dw2-stripped" +set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile}.x ++set binfile [standard_output_file ${testfile}.x] + +remote_exec build "rm -f ${binfile}" + @@ -1493,10 +2348,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp +gdb_test "step" \ + "func.* \\(.*\\) at .*" \ + "step" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S 2016-08-25 18:44:42.060789076 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S 2016-10-22 09:45:15.854013504 +0200 @@ -0,0 +1,83 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1581,10 +2436,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-loca + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp 2016-08-25 18:44:42.060789076 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp 2016-10-22 09:45:15.854013504 +0200 @@ -0,0 +1,37 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -1623,10 +2478,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-loca +clean_restart $binfile + +gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S 2016-08-25 18:44:42.060789076 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S 2016-10-22 09:45:15.854013504 +0200 @@ -0,0 +1,121 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1749,10 +2604,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S + .byte 0x0 /* Terminator */ + + .byte 0x0 /* Terminator */ -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp 2016-08-25 18:44:42.060789076 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp 2016-10-22 09:45:15.855013512 +0200 @@ -0,0 +1,39 @@ +# Copyright 2012 Free Software Foundation, Inc. + @@ -1793,10 +2648,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp + +gdb_test "ptype notype_string" {type = char \[129\]} +gdb_test "p notype_string" " = 'x' " -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/dwarf-stride.exp +Index: gdb-7.12/gdb/testsuite/gdb.fortran/dwarf-stride.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2016-08-25 18:44:42.061789086 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2016-10-22 09:45:15.855013512 +0200 @@ -0,0 +1,42 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -1840,10 +2695,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/dwarf-stride.exp +gdb_continue_to_breakpoint "break-here" ".*break-here.*" +gdb_test "p c40pt(1)" " = '0-hello.*" +gdb_test "p c40pt(2)" " = '1-hello.*" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/dwarf-stride.f90 +Index: gdb-7.12/gdb/testsuite/gdb.fortran/dwarf-stride.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/dwarf-stride.f90 2016-08-25 18:44:42.061789086 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/dwarf-stride.f90 2016-10-22 09:45:15.855013512 +0200 @@ -0,0 +1,40 @@ +! Copyright 2009 Free Software Foundation, Inc. +! @@ -1885,10 +2740,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/dwarf-stride.f90 + print *, c40pt ! break-here + +end program repro -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/dynamic.exp +Index: gdb-7.12/gdb/testsuite/gdb.fortran/dynamic.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/dynamic.exp 2016-08-25 18:54:25.957258024 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/dynamic.exp 2016-10-22 09:45:15.855013512 +0200 @@ -0,0 +1,154 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -2044,10 +2899,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/dynamic.exp +gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9" +# maps to foo::vary(1,3) +gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/dynamic.f90 +Index: gdb-7.12/gdb/testsuite/gdb.fortran/dynamic.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/dynamic.f90 2016-08-25 18:44:42.061789086 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/dynamic.f90 2016-10-22 09:45:15.855013512 +0200 @@ -0,0 +1,98 @@ +! Copyright 2007 Free Software Foundation, Inc. +! @@ -2147,10 +3002,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/dynamic.f90 + if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort + if (x (3, 1) .ne. 10) call abort +end -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/string.exp +Index: gdb-7.12/gdb/testsuite/gdb.fortran/string.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/string.exp 2016-08-25 18:44:42.061789086 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/string.exp 2016-10-22 09:45:15.855013512 +0200 @@ -0,0 +1,59 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -2211,10 +3066,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/string.exp +gdb_continue_to_breakpoint "var-finish" +gdb_test "p e" "\\$\[0-9\]* = 'e '" "p e re-set" +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" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/string.f90 +Index: gdb-7.12/gdb/testsuite/gdb.fortran/string.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/string.f90 2016-08-25 18:44:42.061789086 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/string.f90 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,37 @@ +! Copyright 2008 Free Software Foundation, Inc. +! @@ -2253,10 +3108,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/string.f90 + h = 'h' + call foo (g, h) +end -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/subrange.exp +Index: gdb-7.12/gdb/testsuite/gdb.fortran/subrange.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/subrange.exp 2016-08-25 18:44:42.061789086 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/subrange.exp 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,72 @@ +# Copyright 2011 Free Software Foundation, Inc. + @@ -2330,10 +3185,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/subrange.exp +gdb_unload +setup_kfail "*-*-*" "vlaregression/9999" +gdb_test {p $a (3, 2:2)} { = \(23\)} -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/subrange.f90 +Index: gdb-7.12/gdb/testsuite/gdb.fortran/subrange.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/subrange.f90 2016-08-25 18:44:42.061789086 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/subrange.f90 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,28 @@ +! Copyright 2011 Free Software Foundation, Inc. +! @@ -2363,10 +3218,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.fortran/subrange.f90 + ptr => a + write (*,*) a ! break-static +end -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.mi/mi2-var-stale-type.c +Index: gdb-7.12/gdb/testsuite/gdb.mi/mi2-var-stale-type.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.mi/mi2-var-stale-type.c 2016-08-25 18:44:42.061789086 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.mi/mi2-var-stale-type.c 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,26 @@ +/* Copyright 2011 Free Software Foundation, Inc. + @@ -2394,10 +3249,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.mi/mi2-var-stale-type.c + + return 0; +} -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp +Index: gdb-7.12/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp 2016-08-25 18:44:42.062789095 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,57 @@ +# Copyright 2011 Free Software Foundation, Inc. +# @@ -2456,10 +3311,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp +mi_create_varobj "vla" "vla" "create local variable vla" + +mi_gdb_test "-var-update *" "\\^done,changelist=.*" "-var-update *" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.opt/array-from-register-func.c +Index: gdb-7.12/gdb/testsuite/gdb.opt/array-from-register-func.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.opt/array-from-register-func.c 2016-08-25 18:44:42.062789095 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.opt/array-from-register-func.c 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,22 @@ +/* This file is part of GDB, the GNU debugger. + @@ -2483,10 +3338,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.opt/array-from-register-func.c +{ + return arr[0]; +} -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.opt/array-from-register.c +Index: gdb-7.12/gdb/testsuite/gdb.opt/array-from-register.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.opt/array-from-register.c 2016-08-25 18:44:42.062789095 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.opt/array-from-register.c 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,28 @@ +/* This file is part of GDB, the GNU debugger. + @@ -2516,10 +3371,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.opt/array-from-register.c + + return 0; +} -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.opt/array-from-register.exp +Index: gdb-7.12/gdb/testsuite/gdb.opt/array-from-register.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.opt/array-from-register.exp 2016-08-25 18:44:42.062789095 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.opt/array-from-register.exp 2016-10-22 09:45:15.857013527 +0200 @@ -0,0 +1,33 @@ +# Copyright 2009 Free Software Foundation, Inc. +# @@ -2554,10 +3409,87 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.opt/array-from-register.exp +# Seen regression: +# Address requested for identifier "arr" which is in register $rdi +gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42" -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.pascal/arrays.exp +Index: gdb-7.12/gdb/testsuite/gdb.opt/fortran-string.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.opt/fortran-string.exp 2016-10-22 09:45:15.857013527 +0200 +@@ -0,0 +1,39 @@ ++# Copyright 2009 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. ++ ++# This file was written by Jan Kratochvil . ++ ++# Test GDB can cope with Fortran strings having their length present in a CPU ++# register. With -O0 the string length is passed on the stack. To make this ++# test meaningful the follow assertion should pass. It is not being checked ++# here as the "_s" symbol is compiler dependent: ++# (gdb) info address _s ++# Symbol "_s" is a variable in register XX. ++ ++set test fortran-string ++set srcfile ${test}.f90 ++if { [prepare_for_testing ${test}.exp ${test} ${srcfile} {debug f90 additional_flags=-O2}] } { ++ return -1 ++} ++ ++if ![runto $srcfile:[gdb_get_line_number "s = s"]] then { ++ perror "couldn't run to breakpoint MAIN__" ++ continue ++} ++ ++gdb_test "frame" ".*s='foo'.*" ++gdb_test "ptype s" "type = character\\*3" ++gdb_test "p s" "\\$\[0-9\]* = 'foo'" +Index: gdb-7.12/gdb/testsuite/gdb.opt/fortran-string.f90 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.opt/fortran-string.f90 2016-10-22 09:45:15.857013527 +0200 +@@ -0,0 +1,28 @@ ++! Copyright 2009 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. ++! ++! Ihis file is the Fortran source file for dynamic.exp. ++! Original file written by Jakub Jelinek . ++! Modified for the GDB testcase by Jan Kratochvil . ++ ++ subroutine f(s) ++ character*(*) s ++ s = s ++ end ++ ++ program main ++ call f ('foo') ++ end +Index: gdb-7.12/gdb/testsuite/gdb.pascal/arrays.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.pascal/arrays.exp 2016-08-25 18:44:42.062789095 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.pascal/arrays.exp 2016-10-22 09:45:15.857013527 +0200 @@ -0,0 +1,104 @@ +# Copyright 2008, 2009 Free Software Foundation, Inc. +# @@ -2663,10 +3595,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.pascal/arrays.exp +} +gdb_test "print DynArrChar" ".* = 'abcdefghijklm'" "Print dynamic array of char" + -Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.pascal/arrays.pas +Index: gdb-7.12/gdb/testsuite/gdb.pascal/arrays.pas =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.pascal/arrays.pas 2016-08-25 18:44:42.062789095 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.pascal/arrays.pas 2016-10-22 09:45:15.857013527 +0200 @@ -0,0 +1,82 @@ +{ + Copyright 2008, 2009 Free Software Foundation, Inc. @@ -2750,10 +3682,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.pascal/arrays.pas + s := 'test'#0'string'; + writeln(s); { set breakpoint 2 here } +end. -Index: gdb-7.11.90.20160807/gdb/testsuite/lib/gdb.exp +Index: gdb-7.12/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-7.11.90.20160807.orig/gdb/testsuite/lib/gdb.exp 2016-08-25 18:44:41.424783148 +0200 -+++ gdb-7.11.90.20160807/gdb/testsuite/lib/gdb.exp 2016-08-25 18:44:42.063789104 +0200 +--- gdb-7.12.orig/gdb/testsuite/lib/gdb.exp 2016-10-22 09:45:15.106007986 +0200 ++++ gdb-7.12/gdb/testsuite/lib/gdb.exp 2016-10-22 09:45:15.858013534 +0200 @@ -173,6 +173,11 @@ send_gdb "y\n" exp_continue @@ -2766,10 +3698,10 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/lib/gdb.exp -re "Discard symbol table from .*y or n.*$" { send_gdb "y\n" exp_continue -Index: gdb-7.11.90.20160807/gdb/testsuite/lib/pascal.exp +Index: gdb-7.12/gdb/testsuite/lib/pascal.exp =================================================================== ---- gdb-7.11.90.20160807.orig/gdb/testsuite/lib/pascal.exp 2016-08-07 04:00:01.000000000 +0200 -+++ gdb-7.11.90.20160807/gdb/testsuite/lib/pascal.exp 2016-08-25 18:44:42.063789104 +0200 +--- gdb-7.12.orig/gdb/testsuite/lib/pascal.exp 2016-08-01 17:50:21.000000000 +0200 ++++ gdb-7.12/gdb/testsuite/lib/pascal.exp 2016-10-22 09:45:15.859013541 +0200 @@ -37,6 +37,9 @@ global pascal_compiler_is_fpc global gpc_compiler diff --git a/SOURCES/gdb-libexec-add-index.patch b/SOURCES/gdb-libexec-add-index.patch new file mode 100644 index 0000000..8ca579f --- /dev/null +++ b/SOURCES/gdb-libexec-add-index.patch @@ -0,0 +1,16 @@ +diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh +index cca7153..73181ec 100755 +--- a/gdb/contrib/gdb-add-index.sh ++++ b/gdb/contrib/gdb-add-index.sh +@@ -21,6 +21,11 @@ + GDB=${GDB:=gdb} + OBJCOPY=${OBJCOPY:=objcopy} + ++GDB2=/usr/libexec/gdb ++if test -x $GDB2 && ! which $GDB &>/dev/null; then ++ GDB=$GDB2 ++fi ++ + myname="${0##*/}" + + if test $# != 1; then diff --git a/SOURCES/gdb-physname-pr11734-test.patch b/SOURCES/gdb-physname-pr11734-test.patch new file mode 100644 index 0000000..739ba4a --- /dev/null +++ b/SOURCES/gdb-physname-pr11734-test.patch @@ -0,0 +1,226 @@ +http://sourceware.org/ml/gdb-patches/2010-12/msg00263.html + +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-1.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-1.cc 2011-02-03 22:28:01.000000000 +0100 +@@ -0,0 +1,30 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@gnu.org */ ++ ++#include "pr11734.h" ++ ++int ++main () ++{ ++ pr11734 *p = new pr11734; ++ p->foo (); ++ return 0; ++} ++ +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-2.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-2.cc 2011-02-03 22:28:01.000000000 +0100 +@@ -0,0 +1,27 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@gnu.org */ ++ ++#include "pr11734.h" ++ ++void ++pr11734::foo(void) ++{ ++} ++ +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-3.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-3.cc 2011-02-03 22:28:01.000000000 +0100 +@@ -0,0 +1,27 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@gnu.org */ ++ ++#include "pr11734.h" ++ ++void ++pr11734::foo (int a) ++{ ++} ++ +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-4.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-4.cc 2011-02-03 22:28:01.000000000 +0100 +@@ -0,0 +1,27 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@gnu.org */ ++ ++#include "pr11734.h" ++ ++void ++pr11734::foo (char *a) ++{ ++} ++ +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734.exp 2011-02-03 22:28:01.000000000 +0100 +@@ -0,0 +1,55 @@ ++# Copyright 2010 Free Software Foundation, Inc. ++# ++# Contributed by Red Hat, originally written by Keith Seitz. ++# ++# 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 . ++ ++# This file is part of the gdb testsuite. ++ ++if { [skip_cplus_tests] } { continue } ++ ++set testfile "pr11734" ++set class $testfile ++ ++set srcfiles {} ++for {set i 1} {$i < 5} {incr i} { ++ lappend srcfiles $testfile-$i.cc ++} ++ ++prepare_for_testing pr11734 $testfile $srcfiles {c++ debug} ++ ++if {![runto_main]} { ++ perror "couldn't run to breakpoint" ++ continue ++} ++ ++# An array holding the overload types for the method pr11734::foo. The ++# first element is the overloaded method parameter. The second element ++# is the expected source file number, e.g. "pr11734-?.cc". ++array set tests { ++ "char*" 4 ++ "int" 3 ++ "" 2 ++} ++ ++# Test each overload instance twice: once quoted, once unquoted ++foreach ovld [array names tests] { ++ set method "${class}::foo\($ovld\)" ++ set result "Breakpoint (\[0-9\]).*file .*/$class-$tests($ovld).*" ++ gdb_test "break $method" $result ++ gdb_test "break '$method'" $result ++} ++ ++gdb_exit ++return 0 +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734.h 2011-02-03 22:28:01.000000000 +0100 +@@ -0,0 +1,28 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@gnu.org */ ++ ++class pr11734 ++{ ++ public: ++ void foo (); ++ void foo (int); ++ void foo (char *); ++}; ++ diff --git a/SOURCES/gdb-physname-pr12273-test.patch b/SOURCES/gdb-physname-pr12273-test.patch new file mode 100644 index 0000000..e8bed15 --- /dev/null +++ b/SOURCES/gdb-physname-pr12273-test.patch @@ -0,0 +1,95 @@ +http://sourceware.org/ml/gdb-patches/2010-12/msg00264.html + +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr12273.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr12273.cc 2011-02-03 22:31:01.000000000 +0100 +@@ -0,0 +1,37 @@ ++/* This test case is part of GDB, the GNU debugger. ++ ++ Copyright 2010 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 . */ ++ ++template ++class GDB ++{ ++ public: ++ static int simple (void) { return 0; } ++ static int harder (T a) { return 1; } ++ template ++ static X even_harder (T a) { return static_cast (a); } ++ int operator == (GDB const& other) ++ { return 1; } ++}; ++ ++int main(int argc, char **argv) ++{ ++ GDB a, b; ++ if (a == b) ++ return GDB::harder('a') + GDB::harder(3) ++ + GDB::even_harder ('a'); ++ return GDB::simple (); ++} +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr12273.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr12273.exp 2011-02-03 22:31:01.000000000 +0100 +@@ -0,0 +1,46 @@ ++# Copyright 2010 Free Software Foundation, Inc. ++# ++# Contributed by Red Hat, originally written by Keith Seitz. ++# ++# 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 . ++ ++# This file is part of the gdb testsuite. ++ ++if {[skip_cplus_tests]} { continue } ++ ++set testfile "pr12273" ++# Do NOT compile with debug flag. ++prepare_for_testing pr12273 $testfile $testfile.cc {c++} ++ ++gdb_test_no_output "set language c++" ++ ++# A list of minimal symbol names to check. ++# Note that GDB::even_harder(char) is quoted and includes ++# the return type. This is necessary because this is the demangled name ++# of the minimal symbol. ++set min_syms [list \ ++ "GDB::operator ==" \ ++ "GDB::operator==(GDB const&)" \ ++ "GDB::harder(char)" \ ++ "GDB::harder(int)" \ ++ {"int GDB::even_harder(char)"} \ ++ "GDB::simple()"] ++ ++foreach sym $min_syms { ++ if {[gdb_breakpoint $sym]} { ++ pass "setting breakpoint at $sym" ++ } ++} ++ ++gdb_exit diff --git a/SOURCES/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch b/SOURCES/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch new file mode 100644 index 0000000..295d1dc --- /dev/null +++ b/SOURCES/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch @@ -0,0 +1,162 @@ +Original message by Tom Tromey: + + + Message-ID: <871uoc1va3.fsf@fleche.redhat.com> + +Comment from Sergio Durigan Junior: + + In order to correctly test this patch, I wrote a testcase based on Jan + Kratochvil's . The + testcase, which can be seen below, tests GDB in order to see if the + amount of memory being leaked is minimal, as requested in the bugzilla. + It is hard to define what "minimum" is, so I ran the testcase on all + supported RHEL architectures and came up with an average. + +commit cc0265cdda9dc7e8665e8bfcf5b4477489daf27c +Author: Tom Tromey +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. + +Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c +=================================================================== +--- /dev/null ++++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c +@@ -0,0 +1,27 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2014 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 . */ ++ ++static struct x ++ { ++ char unsigned u[4096]; ++ } x, *px = &x; ++ ++int ++main (int argc, char *argv[]) ++{ ++ return 0; ++} +Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp +=================================================================== +--- /dev/null ++++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp +@@ -0,0 +1,68 @@ ++# Copyright 2014 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++set testfile py-gdb-rhbz1007614-memleak-infpy_read_memory ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile} ++ ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { ++ return -1 ++} ++ ++if { [skip_python_tests] } { continue } ++ ++set pid_of_gdb [exp_pid -i [board_info host fileid]] ++ ++proc memory_v_pages_get {} { ++ global pid_of_gdb ++ set fd [open "/proc/$pid_of_gdb/statm"] ++ gets $fd line ++ close $fd ++ # number of pages of virtual memory ++ scan $line "%d" drs ++ return $drs ++} ++ ++if { ![runto_main] } { ++ untested $testfile.exp ++ return -1 ++} ++ ++set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py] ++ ++gdb_test "source ${remote_python_file}" "" ++ ++gdb_test "hello-world" "" ++ ++set kbytes_before [memory_v_pages_get] ++verbose -log "kbytes_before = $kbytes_before" ++ ++gdb_test "hello-world" "" ++ ++set kbytes_after [memory_v_pages_get] ++verbose -log "kbytes_after = $kbytes_after" ++ ++set kbytes_diff [expr $kbytes_after - $kbytes_before] ++verbose -log "kbytes_diff = $kbytes_diff" ++ ++# The value "1000" was calculated by running a few GDB sessions with this ++# testcase, and seeing how much (in average) the memory consumption ++# increased after the "hello-world" command issued above. The average ++# was around 500 bytes, so I chose 1000 as a high estimate. ++if { $kbytes_diff > 1000 } { ++ fail "there is a memory leak on GDB (RHBZ 1007614)" ++} else { ++ pass "there is not a memory leak on GDB (RHBZ 1007614)" ++} +Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py +=================================================================== +--- /dev/null ++++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py +@@ -0,0 +1,30 @@ ++# Copyright (C) 2014 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 . ++ ++class HelloWorld (gdb.Command): ++ """Greet the whole world.""" ++ ++ def __init__ (self): ++ super (HelloWorld, self).__init__ ("hello-world", ++ gdb.COMMAND_OBSCURE) ++ ++ def invoke (self, arg, from_tty): ++ px = gdb.parse_and_eval("px") ++ core = gdb.inferiors()[0] ++ for i in range(256 * 1024): ++ chunk = core.read_memory(px, 4096) ++ print "Hello, World!" ++ ++HelloWorld () diff --git a/SOURCES/gdb-rhbz1149205-catch-syscall-after-fork-test.patch b/SOURCES/gdb-rhbz1149205-catch-syscall-after-fork-test.patch new file mode 100644 index 0000000..b7169ef --- /dev/null +++ b/SOURCES/gdb-rhbz1149205-catch-syscall-after-fork-test.patch @@ -0,0 +1,114 @@ +URL: +Message-ID: <1368136582.30058.7.camel@soleil> + + From: Philippe Waroquiers + To: gdb-patches at sourceware dot org + Subject: RFA: fix gdb_assert caused by 'catch signal ...' and fork + Date: Thu, 09 May 2013 23:56:22 +0200 + + The attached patch fixes a gdb_assert caused by the combination of catch + signal and fork: + break-catch-sig.c:152: internal-error: signal_catchpoint_remove_location: Assertion `signal_catch_counts[iter] > 0' failed. + + The problem is that the signal_catch_counts is decremented by detach_breakpoints. + The fix consists in not detaching breakpoint locations of type bp_loc_other. + The patch introduces a new test. + +Comments by Sergio Durigan Junior: + + I addded a specific testcase for this patch, which tests exactly the + issue that the customer is facing. This patch does not solve the + whole problem of catching a syscall and forking (for more details, + see , + specifically comment #3), but it solves the issue reported by the + customer. + + I also removed the original testcase of this patch, because it + relied on "catch signal", which is a command that is not implemented + in this version of GDB. + +commit bd9673a4ded96ea5c108601501c8e59003ea1be6 +Author: Philippe Waroquiers +Date: Tue May 21 18:47:05 2013 +0000 + + Fix internal error caused by interaction between catch signal and fork + +Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c 2016-10-20 21:03:09.584272695 +0200 +@@ -0,0 +1,11 @@ ++#include ++#include ++ ++int ++main (int argc, char **argv) ++{ ++ if (fork () == 0) ++ sleep (1); ++ chdir ("."); ++ return 0; ++} +Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp 2016-10-20 21:04:13.337771174 +0200 +@@ -0,0 +1,58 @@ ++# Copyright 2015 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 { [is_remote target] || ![isnative] } then { ++ continue ++} ++ ++set testfile "gdb-rhbz1149205-catch-syscall-fork" ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++ ++# Until "catch syscall" is implemented on other targets... ++if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then { ++ continue ++} ++ ++# This shall be updated whenever 'catch syscall' is implemented ++# on some architecture. ++#if { ![istarget "i\[34567\]86-*-linux*"] ++if { ![istarget "x86_64-*-linux*"] && ![istarget "i\[34567\]86-*-linux*"] ++ && ![istarget "powerpc-*-linux*"] && ![istarget "powerpc64-*-linux*"] ++ && ![istarget "sparc-*-linux*"] && ![istarget "sparc64-*-linux*"] } { ++ continue ++} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ untested ${testfile}.exp ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load $binfile ++ ++if { ![runto_main] } { ++ return -1 ++} ++ ++gdb_test "catch syscall chdir" \ ++ "Catchpoint $decimal \\\(syscall (.)?chdir(.)? \\\[$decimal\\\]\\\)" \ ++ "catch syscall chdir" ++ ++gdb_test "continue" \ ++ "Continuing\.\r\n.*\r\nCatchpoint $decimal \\\(call to syscall .?chdir.?.*" \ ++ "continue from catch syscall after fork" diff --git a/SOURCES/gdb-rhbz1156192-recursive-dlopen-test.patch b/SOURCES/gdb-rhbz1156192-recursive-dlopen-test.patch new file mode 100644 index 0000000..2fbc80b --- /dev/null +++ b/SOURCES/gdb-rhbz1156192-recursive-dlopen-test.patch @@ -0,0 +1,341 @@ +Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c 2016-10-22 22:10:13.262634144 +0200 +@@ -0,0 +1,30 @@ ++/* Testcase for recursive dlopen calls. ++ ++ Copyright (C) 2014 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 . */ ++ ++/* This test was copied from glibc's testcase called ++ and related files. */ ++ ++#include ++#include ++ ++void ++bar (void) ++{ ++ printf ("Called bar.\n"); ++} +Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c 2016-10-22 22:10:13.262634144 +0200 +@@ -0,0 +1,30 @@ ++/* Testcase for recursive dlopen calls. ++ ++ Copyright (C) 2014 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 . */ ++ ++/* This test was copied from glibc's testcase called ++ and related files. */ ++ ++#include ++#include ++ ++void ++foo (void) ++{ ++ printf ("Called foo.\n"); ++} +Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c 2016-10-22 22:10:13.262634144 +0200 +@@ -0,0 +1,124 @@ ++/* Testcase for recursive dlopen calls. ++ ++ Copyright (C) 2014 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 . */ ++ ++/* This test was copied from glibc's testcase called ++ and related files. */ ++ ++#include ++#include ++#include ++#include ++ ++#define DSO "gdb-rhbz1156192-recursive-dlopen-libfoo.so" ++#define FUNC "foo" ++ ++#define DSO1 "gdb-rhbz1156192-recursive-dlopen-libbar.so" ++#define FUNC1 "bar" ++ ++/* Prototype for my hook. */ ++void *custom_malloc_hook (size_t, const void *); ++ ++/* Pointer to old malloc hooks. */ ++void *(*old_malloc_hook) (size_t, const void *); ++ ++/* Call function func_name in DSO dso_name via dlopen. */ ++void ++call_func (const char *dso_name, const char *func_name) ++{ ++ int ret; ++ void *dso; ++ void (*func) (void); ++ char *err; ++ ++ /* Open the DSO. */ ++ dso = dlopen (dso_name, RTLD_NOW|RTLD_GLOBAL); ++ if (dso == NULL) ++ { ++ err = dlerror (); ++ fprintf (stderr, "%s\n", err); ++ exit (1); ++ } ++ /* Clear any errors. */ ++ dlerror (); ++ ++ /* Lookup func. */ ++ *(void **) (&func) = dlsym (dso, func_name); ++ if (func == NULL) ++ { ++ err = dlerror (); ++ if (err != NULL) ++ { ++ fprintf (stderr, "%s\n", err); ++ exit (1); ++ } ++ } ++ /* Call func twice. */ ++ (*func) (); ++ ++ /* Close the library and look for errors too. */ ++ ret = dlclose (dso); ++ if (ret != 0) ++ { ++ err = dlerror (); ++ fprintf (stderr, "%s\n", err); ++ exit (1); ++ } ++ ++} ++ ++/* Empty hook that does nothing. */ ++void * ++custom_malloc_hook (size_t size, const void *caller) ++{ ++ void *result; ++ /* Restore old hooks. */ ++ __malloc_hook = old_malloc_hook; ++ /* First call a function in another library via dlopen. */ ++ call_func (DSO1, FUNC1); ++ /* Called recursively. */ ++ result = malloc (size); ++ /* Restore new hooks. */ ++ __malloc_hook = custom_malloc_hook; ++ return result; ++} ++ ++int ++main (void) ++{ ++ ++ /* Save old hook. */ ++ old_malloc_hook = __malloc_hook; ++ /* Install new hook. */ ++ __malloc_hook = custom_malloc_hook; ++ ++ /* Attempt to dlopen a shared library. This dlopen will ++ trigger an access to the ld.so.cache, and that in turn ++ will require a malloc to duplicate data in the cache. ++ The malloc will call our malloc hook which calls dlopen ++ recursively, and upon return of this dlopen the non-ref ++ counted ld.so.cache mapping will be unmapped. We will ++ return to the original dlopen and crash trying to access ++ dlopened data. */ ++ call_func (DSO, FUNC); ++ ++ /* Restore old hook. */ ++ __malloc_hook = old_malloc_hook; ++ ++ return 0; ++} +Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp 2016-10-24 23:21:58.043064177 +0200 +@@ -0,0 +1,137 @@ ++# Copyright 2014 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 { [skip_shlib_tests] } { ++ return 0 ++} ++ ++# Library foo ++set libname1 "gdb-rhbz1156192-recursive-dlopen-libfoo" ++set srcfile_lib1 ${srcdir}/${subdir}/${libname1}.c ++set binfile_lib1 [standard_output_file ${libname1}.so] ++# Library bar ++set libname2 "gdb-rhbz1156192-recursive-dlopen-libbar" ++set srcfile_lib2 ${srcdir}/${subdir}/${libname2}.c ++set binfile_lib2 [standard_output_file ${libname2}.so] ++ ++set testfile "gdb-rhbz1156192-recursive-dlopen" ++set srcfile ${testfile}.c ++set executable ${testfile} ++set binfile [standard_output_file ${executable}] ++ ++if { [gdb_compile_shlib ${srcfile_lib1} ${binfile_lib1} \ ++ { debug "additional_flags=-fPIC" }] != "" } { ++ untested "Could not compile ${binfile_lib1}" ++ return -1 ++} ++ ++if { [gdb_compile_shlib ${srcfile_lib2} ${binfile_lib2} \ ++ { debug "additional_flags=-fPIC" }] != "" } { ++ untested "Could not compile ${binfile_lib2}" ++ return -1 ++} ++ ++if { [prepare_for_testing ${testfile}.exp ${executable} ${srcfile} \ ++ [ list debug shlib_load "additional_flags=-Wno-deprecated-declarations" ]] } { ++ untested "Could not compile ${executable}" ++ return -1 ++} ++ ++proc do_test { has_libfoo has_libbar } { ++ global hex binfile_lib2 binfile_lib1 gdb_prompt ++ set libbar_match "[string_to_regexp $binfile_lib2]" ++ set libfoo_match "[string_to_regexp $binfile_lib1]" ++ ++ gdb_test_multiple "info shared" "info shared" { ++ -re ".*$libfoo_match\r\n.*$libbar_match\(\r\n.*Shared library is missing\)?.*\r\n${gdb_prompt} $" { ++ if { $has_libfoo && $has_libbar } { ++ pass "matched libfoo and libbar" ++ } else { ++ fail "matched libfoo and libbar (has_libfoo = $has_libfoo, has_libbar = $has_libbar)" ++ } ++ } ++ -re ".*$libfoo_match\(\r\n.*Shared library is missing\)?.*\r\n${gdb_prompt} $" { ++ if { $has_libfoo && !$has_libbar } { ++ pass "matched libfoo" ++ } else { ++ fail "matched libfoo (has_libfoo = $has_libfoo, has_libbar = $has_libbar)" ++ } ++ } ++ -re ".*$libbar_match\(\r\n.*Shared library is missing\)?.*\r\n${gdb_prompt} $" { ++ if { $has_libbar && !$has_libfoo } { ++ pass "matched libbar" ++ } else { ++ fail "matched libbar (has_libfoo = $has_libfoo, has_libbar = $has_libbar)" ++ } ++ } ++ "\r\n${gdb_prompt} $" { ++ if { !$has_libfoo && !$has_libbar } { ++ pass "did not match libfoo nor libbar" ++ } else { ++ fail "did not match libfoo nor libbar (has_libfoo = $has_libfoo, has_libbar = $has_libbar)" ++ } ++ } ++ } ++} ++ ++proc test_stop_on_solib_events { } { ++ set pass 0 ++ # This variable holds the information about whether libfoo and ++ # libbar (respectively) are expected in the "info shared" output. ++ set solib_event_order { { 0 0 } { 0 0 } { 0 0 } { 0 1 } \ ++ { 0 1 } { 0 0 } { 0 0 } { 0 1 } \ ++ { 0 1 } { 0 0 } { 0 0 } { 0 1 } \ ++ { 0 1 } { 0 0 } { 0 0 1 } { 1 1 } \ ++ { 1 1 } { 1 0 } { 1 0 } { 1 1 } \ ++ { 1 1 } { 1 0 1 } { 1 0 } { 1 0 } } ++ ++ with_test_prefix "stop-on-solib-events" { ++ gdb_test_no_output "set stop-on-solib-events 1" "setting stop-on-solib-events" ++ ++ gdb_run_cmd ++ foreach l $solib_event_order { ++ incr pass ++ with_test_prefix "pass #$pass" { ++ set should_be_corrupted [expr 0+0[lindex $l 2]] ++ do_test [lindex $l 0] [lindex $l 1] ++ set test "continue" ++ global gdb_prompt ++ gdb_test_multiple $test $test { ++ -re "\r\nwarning: Corrupted shared library list:.*\r\nStopped due to shared library event.*\r\n$gdb_prompt $" { ++ set corrupted 1 ++ pass $test ++ } ++ -re "\r\nStopped due to shared library event.*\r\n$gdb_prompt $" { ++ set corrupted 0 ++ pass $test ++ } ++ } ++ set test "corrupted=$corrupted but should_be_corrupted=$should_be_corrupted" ++ if {$corrupted == $should_be_corrupted} { ++ pass $test ++ } else { ++ fail $test ++ } ++ } ++ } ++ # In the last pass we do not expect to see libfoo or libbar. ++ incr pass ++ with_test_prefix "pass #$pass" { ++ do_test 0 0 ++ } ++ } ++} ++ ++test_stop_on_solib_events diff --git a/SOURCES/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch b/SOURCES/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch new file mode 100644 index 0000000..ecaece4 --- /dev/null +++ b/SOURCES/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch @@ -0,0 +1,125 @@ +Comments from Sergio Durigan Junior: + + The "proper" fix for this whole problem would be to backport the + "ambiguous linespec" patch series. However, it is really not + recommended to do that for RHEL GDB, because the patch series is too + big and could introduce unwanted regressions. Instead, what we + chose to do was to replace the gdb_assert call by a warning (which + 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. + +Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc 2016-10-20 21:06:31.849854180 +0200 +@@ -0,0 +1,22 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2015 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 . */ ++ ++int ++main (int argc, char *argv[]) ++{ ++ return 0; ++} +Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc 2016-10-20 21:06:31.850854188 +0200 +@@ -0,0 +1,26 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2015 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 . */ ++ ++class C ++ { ++ public: ++ C () {} ++ C (int x) {} ++ }; ++ ++C a; ++C b (1); +Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp 2016-10-20 21:09:33.408270526 +0200 +@@ -0,0 +1,51 @@ ++# Copyright 2015 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 { [skip_cplus_tests] } { continue } ++if { [skip_shlib_tests] } { continue } ++if { [is_remote target] } { continue } ++if { [target_info exists use_gdb_stub] } { continue } ++ ++set testfile gdb-rhbz1186476-internal-error-unqualified-name-re-set-main ++set srcfile $testfile.cc ++set executable $testfile ++set binfile [standard_output_file $executable] ++ ++set libtestfile gdb-rhbz1186476-internal-error-unqualified-name-re-set ++set libsrcfile $libtestfile.cc ++set sofile [standard_output_file lib$libtestfile.so] ++ ++# Create and source the file that provides information about the compiler ++# used to compile the test case. ++if [get_compiler_info "c++"] { ++ return -1 ++} ++ ++if { [gdb_compile_shlib $srcdir/$subdir/$libsrcfile $sofile {debug c++ "additional_flags=-fPIC"}] != "" ++ || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list additional_flags=-Wl,-rpath,[file dirname ${sofile}] "c++" shlib=${sofile} ]] != ""} { ++ untested $libtestfile.exp ++ return -1 ++} ++ ++clean_restart $executable ++ ++gdb_test_no_output "set breakpoint pending on" ++# gdb_breakpoint would print a failure because of some warning messages ++gdb_test "break C::C" "Breakpoint $decimal \\(C::C\\) pending." ++ ++#gdb_test "run" "warning: Found more than one location for breakpoint #$decimal; only the first location will be used.(\r\n)+Breakpoint $decimal, C::C.*" ++gdb_test "run" ++ ++gdb_test "info break" " in C::C\\(\\) at .* in C::C\\(int\\) at .*" diff --git a/SOURCES/gdb-test-ivy-bridge.patch b/SOURCES/gdb-test-ivy-bridge.patch new file mode 100644 index 0000000..9f574c3 --- /dev/null +++ b/SOURCES/gdb-test-ivy-bridge.patch @@ -0,0 +1,461 @@ +Index: gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp 2016-10-20 20:57:31.652630455 +0200 +@@ -0,0 +1,170 @@ ++# Copyright 2011 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 "x86_64-*-*"]} then { ++ return ++} ++ ++set testfile amd64-ivy-bridge ++set test compilation ++if [prepare_for_testing ${testfile}.exp ${testfile}.x ${testfile}.S [list debug "additional_flags=-m64 -nostdlib"]] { ++ fail $test ++ return -1 ++} ++pass $test ++ ++gdb_test_no_output "set disassembly-flavor att" ++# gas/i386/x86-64-rdrnd.d ++# gas/i386/x86-64-f16c.d ++# gas/i386/x86-64-fsgs.d ++gdb_test "disassemble/r _start" "\r ++Dump of assembler code for function _start:\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand %bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand %ebx\r ++\[^\r\n\]+:\t48 0f c7 f3\t\( \)?rdrand %rbx\r ++\[^\r\n\]+:\t66 41 0f c7 f0\t\( \)?rdrand %r8w\r ++\[^\r\n\]+:\t41 0f c7 f0\t\( \)?rdrand %r8d\r ++\[^\r\n\]+:\t49 0f c7 f0\t\( \)?rdrand %r8\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand %bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand %ebx\r ++\[^\r\n\]+:\t48 0f c7 f3\t\( \)?rdrand %rbx\r ++\[^\r\n\]+:\t66 41 0f c7 f0\t\( \)?rdrand %r8w\r ++\[^\r\n\]+:\t41 0f c7 f0\t\( \)?rdrand %r8d\r ++\[^\r\n\]+:\t49 0f c7 f0\t\( \)?rdrand %r8\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps %xmm4,%ymm4\r ++\[^\r\n\]+:\tc4 42 7d 13 00\t\( \)?vcvtph2ps \\(%r8\\),%ymm8\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps %xmm4,%xmm6\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%rcx\\),%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,%xmm4\r ++\[^\r\n\]+:\tc4 43 7d 1d 00 02\t\( \)?vcvtps2ph \\\$0x2,%ymm8,\\(%r8\\)\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,%xmm4\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%rcx\\)\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps %xmm4,%ymm4\r ++\[^\r\n\]+:\tc4 42 7d 13 00\t\( \)?vcvtph2ps \\(%r8\\),%ymm8\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps \\(%rcx\\),%ymm4\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps %xmm4,%xmm6\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%rcx\\),%xmm4\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%rcx\\),%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%rcx\\)\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%rcx\\)\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,%xmm4\r ++\[^\r\n\]+:\tc4 43 79 1d 00 02\t\( \)?vcvtps2ph \\\$0x2,%xmm8,\\(%r8\\)\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%rcx\\)\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae c3\t\( \)?rdfsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c0\t\( \)?rdfsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c0\t\( \)?rdfsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae cb\t\( \)?rdgsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c8\t\( \)?rdgsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c8\t\( \)?rdgsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae d3\t\( \)?wrfsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d0\t\( \)?wrfsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d0\t\( \)?wrfsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae db\t\( \)?wrgsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae c3\t\( \)?rdfsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c0\t\( \)?rdfsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c0\t\( \)?rdfsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae cb\t\( \)?rdgsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c8\t\( \)?rdgsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c8\t\( \)?rdgsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae d3\t\( \)?wrfsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d0\t\( \)?wrfsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d0\t\( \)?wrfsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae db\t\( \)?wrgsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase %r8\r ++End of assembler dump\\." "att" ++ ++gdb_test_no_output "set disassembly-flavor intel" ++# gas/i386/x86-64-rdrnd-intel.d ++# gas/i386/x86-64-f16c-intel.d ++# gas/i386/x86-64-fsgs-intel.d ++gdb_test "disassemble/r _start" "\r ++Dump of assembler code for function _start:\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand ebx\r ++\[^\r\n\]+:\t48 0f c7 f3\t\( \)?rdrand rbx\r ++\[^\r\n\]+:\t66 41 0f c7 f0\t\( \)?rdrand r8w\r ++\[^\r\n\]+:\t41 0f c7 f0\t\( \)?rdrand r8d\r ++\[^\r\n\]+:\t49 0f c7 f0\t\( \)?rdrand r8\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand ebx\r ++\[^\r\n\]+:\t48 0f c7 f3\t\( \)?rdrand rbx\r ++\[^\r\n\]+:\t66 41 0f c7 f0\t\( \)?rdrand r8w\r ++\[^\r\n\]+:\t41 0f c7 f0\t\( \)?rdrand r8d\r ++\[^\r\n\]+:\t49 0f c7 f0\t\( \)?rdrand r8\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps ymm4,xmm4\r ++\[^\r\n\]+:\tc4 42 7d 13 00\t\( \)?vcvtph2ps ymm8,XMMWORD PTR \\\[r8\\\]\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps xmm6,xmm4\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[rcx\\\]\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph xmm4,ymm4,0x2\r ++\[^\r\n\]+:\tc4 43 7d 1d 00 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[r8\\\],ymm8,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph xmm4,xmm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[rcx\\\],xmm4,0x2\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps ymm4,xmm4\r ++\[^\r\n\]+:\tc4 42 7d 13 00\t\( \)?vcvtph2ps ymm8,XMMWORD PTR \\\[r8\\\]\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps ymm4,XMMWORD PTR \\\[rcx\\\]\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps xmm6,xmm4\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[rcx\\\]\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[rcx\\\]\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph xmm4,ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[rcx\\\],ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[rcx\\\],ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph xmm4,xmm4,0x2\r ++\[^\r\n\]+:\tc4 43 79 1d 00 02\t\( \)?vcvtps2ph QWORD PTR \\\[r8\\\],xmm8,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[rcx\\\],xmm4,0x2\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae c3\t\( \)?rdfsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c0\t\( \)?rdfsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c0\t\( \)?rdfsbase r8\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae cb\t\( \)?rdgsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c8\t\( \)?rdgsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c8\t\( \)?rdgsbase r8\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae d3\t\( \)?wrfsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d0\t\( \)?wrfsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d0\t\( \)?wrfsbase r8\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae db\t\( \)?wrgsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase r8\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae c3\t\( \)?rdfsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c0\t\( \)?rdfsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c0\t\( \)?rdfsbase r8\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae cb\t\( \)?rdgsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c8\t\( \)?rdgsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c8\t\( \)?rdgsbase r8\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae d3\t\( \)?wrfsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d0\t\( \)?wrfsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d0\t\( \)?wrfsbase r8\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae db\t\( \)?wrgsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase r8\r ++End of assembler dump\\." "intel" +Index: gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp 2016-10-20 20:57:43.251721147 +0200 +@@ -0,0 +1,106 @@ ++# Copyright 2011 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 "x86_64-*-*"] && ![istarget "i?86-*-*"]} then { ++ return ++} ++ ++set testfile i386-ivy-bridge ++set test compilation ++if [prepare_for_testing ${testfile}.exp ${testfile}.x ${testfile}.S [list debug "additional_flags=-m32 -nostdlib"]] { ++ fail $test ++ return -1 ++} ++pass $test ++ ++gdb_test_no_output "set disassembly-flavor att" ++# gas/i386/rdrnd.d ++# gas/i386/f16c.d ++# gas/i386/fsgs.d ++gdb_test "disassemble/r _start" "\r ++Dump of assembler code for function _start:\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand %bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand %ebx\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand %bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand %ebx\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps %xmm4,%ymm4\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%ymm4\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps %xmm4,%xmm6\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%ecx\\)\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,%xmm4\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%ecx\\)\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps %xmm4,%ymm4\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%ymm4\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%ymm4\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps %xmm4,%xmm6\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%xmm4\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%ecx\\)\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%ecx\\)\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,%xmm4\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%ecx\\)\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%ecx\\)\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase %ebx\r ++End of assembler dump\\." "att" ++ ++gdb_test_no_output "set disassembly-flavor intel" ++# gas/i386/rdrnd-intel.d ++# gas/i386/f16c-intel.d ++# gas/i386/fsgs-intel.d ++gdb_test "disassemble/r _start" "\r ++Dump of assembler code for function _start:\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand ebx\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand ebx\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps ymm4,xmm4\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps ymm4,XMMWORD PTR \\\[ecx\\\]\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps xmm6,xmm4\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[ecx\\\]\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph xmm4,ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[ecx\\\],ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph xmm4,xmm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[ecx\\\],xmm4,0x2\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps ymm4,xmm4\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps ymm4,XMMWORD PTR \\\[ecx\\\]\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps ymm4,XMMWORD PTR \\\[ecx\\\]\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps xmm6,xmm4\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[ecx\\\]\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[ecx\\\]\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph xmm4,ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[ecx\\\],ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[ecx\\\],ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph xmm4,xmm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[ecx\\\],xmm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[ecx\\\],xmm4,0x2\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase ebx\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase ebx\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase ebx\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase ebx\r ++\[^\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" +Index: gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S 2016-10-20 20:55:50.853842324 +0200 +@@ -0,0 +1,98 @@ ++/* Copyright 2011 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 . ++ ++ This file is part of the gdb testsuite. */ ++ ++ .globl _start ++_start: .text ++ ++/* gas/i386/x86-64-rdrnd.s */ ++ .att_syntax prefix ++ rdrand %bx ++ rdrand %ebx ++ rdrand %rbx ++ rdrand %r8w ++ rdrand %r8d ++ rdrand %r8 ++ ++ .intel_syntax noprefix ++ rdrand bx ++ rdrand ebx ++ rdrand rbx ++ rdrand r8w ++ rdrand r8d ++ rdrand r8 ++ ++/* gas/i386/x86-64-f16c.s */ ++ .att_syntax prefix ++ vcvtph2ps %xmm4,%ymm4 ++ vcvtph2ps (%r8),%ymm8 ++ vcvtph2ps %xmm4,%xmm6 ++ vcvtph2ps (%rcx),%xmm4 ++ vcvtps2ph $0x2,%ymm4,%xmm4 ++ vcvtps2ph $0x2,%ymm8,(%r8) ++ vcvtps2ph $0x2,%xmm4,%xmm4 ++ vcvtps2ph $0x2,%xmm4,(%rcx) ++ ++ .intel_syntax noprefix ++ vcvtph2ps ymm4,xmm4 ++ vcvtph2ps ymm8,XMMWORD PTR [r8] ++ vcvtph2ps ymm4,[rcx] ++ vcvtph2ps xmm6,xmm4 ++ vcvtph2ps xmm4,QWORD PTR [rcx] ++ vcvtph2ps xmm4,[rcx] ++ vcvtps2ph xmm4,ymm4,0x2 ++ vcvtps2ph XMMWORD PTR [rcx],ymm4,0x2 ++ vcvtps2ph [rcx],ymm4,0x2 ++ vcvtps2ph xmm4,xmm4,0x2 ++ vcvtps2ph QWORD PTR [r8],xmm8,0x2 ++ vcvtps2ph [rcx],xmm4,0x2 ++ ++/* gas/i386/x86-64-fsgs.s */ ++ .att_syntax prefix ++ rdfsbase %ebx ++ rdfsbase %rbx ++ rdfsbase %r8d ++ rdfsbase %r8 ++ rdgsbase %ebx ++ rdgsbase %rbx ++ rdgsbase %r8d ++ rdgsbase %r8 ++ wrfsbase %ebx ++ wrfsbase %rbx ++ wrfsbase %r8d ++ wrfsbase %r8 ++ wrgsbase %ebx ++ wrgsbase %rbx ++ wrgsbase %r8d ++ wrgsbase %r8 ++ ++ .intel_syntax noprefix ++ rdfsbase ebx ++ rdfsbase rbx ++ rdfsbase r8d ++ rdfsbase r8 ++ rdgsbase ebx ++ rdgsbase rbx ++ rdgsbase r8d ++ rdgsbase r8 ++ wrfsbase ebx ++ wrfsbase rbx ++ wrfsbase r8d ++ wrfsbase r8 ++ wrgsbase ebx ++ wrgsbase rbx ++ wrgsbase r8d ++ wrgsbase r8 +Index: gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.S +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.S 2016-10-20 20:55:50.853842324 +0200 +@@ -0,0 +1,67 @@ ++/* Copyright 2011 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 . ++ ++ This file is part of the gdb testsuite. */ ++ ++ .globl _start ++_start: .text ++ ++/* gas/i386/rdrnd.s */ ++ .att_syntax prefix ++ rdrand %bx ++ rdrand %ebx ++ ++ .intel_syntax noprefix ++ rdrand bx ++ rdrand ebx ++ ++/* gas/i386/f16c.s */ ++ .att_syntax prefix ++ vcvtph2ps %xmm4,%ymm4 ++ vcvtph2ps (%ecx),%ymm4 ++ vcvtph2ps %xmm4,%xmm6 ++ vcvtph2ps (%ecx),%xmm4 ++ vcvtps2ph $0x2,%ymm4,%xmm4 ++ vcvtps2ph $0x2,%ymm4,(%ecx) ++ vcvtps2ph $0x2,%xmm4,%xmm4 ++ vcvtps2ph $0x2,%xmm4,(%ecx) ++ ++ .intel_syntax noprefix ++ vcvtph2ps ymm4,xmm4 ++ vcvtph2ps ymm4,XMMWORD PTR [ecx] ++ vcvtph2ps ymm4,[ecx] ++ vcvtph2ps xmm6,xmm4 ++ vcvtph2ps xmm4,QWORD PTR [ecx] ++ vcvtph2ps xmm4,[ecx] ++ vcvtps2ph xmm4,ymm4,0x2 ++ vcvtps2ph XMMWORD PTR [ecx],ymm4,0x2 ++ vcvtps2ph [ecx],ymm4,0x2 ++ vcvtps2ph xmm4,xmm4,0x2 ++ vcvtps2ph QWORD PTR [ecx],xmm4,0x2 ++ vcvtps2ph [ecx],xmm4,0x2 ++ ++/* gas/i386/fsgs.s */ ++ .att_syntax prefix ++ rdfsbase %ebx ++ rdgsbase %ebx ++ wrfsbase %ebx ++ wrgsbase %ebx ++ ++ .intel_syntax noprefix ++ rdfsbase ebx ++ rdgsbase ebx ++ wrfsbase ebx ++ wrgsbase ebx ++ diff --git a/SOURCES/gdb-testsuite-morestack-gold.patch b/SOURCES/gdb-testsuite-morestack-gold.patch new file mode 100644 index 0000000..a56e100 --- /dev/null +++ b/SOURCES/gdb-testsuite-morestack-gold.patch @@ -0,0 +1,83 @@ +http://sourceware.org/ml/gdb-patches/2016-10/msg00652.html +Subject: [testsuite patch] Fix false FAIL for gdb.base/morestack.exp + + +--HlL+5n6rz5pIUxbD +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi, + +since + [commit] [testsuite patch] Fix gcc_compiled for gcc 6 & 7 + https://sourceware.org/ml/gdb-patches/2016-10/msg00620.html + +there has started running again + Running gdb/testsuite/gdb.base/morestack.exp ... + +FAIL: gdb.base/morestack.exp: continue + +PASS: gdb.base/morestack.exp: up 3000 + +but as you can see it FAILs now - on Fedora 24 x86_64 (although for example it +still PASSes on CentOS-7.2 x86_64). + +Program received signal SIGSEGV, Segmentation fault. +0x00007ffff787c7bb in malloc_consolidate (av=av@entry=0x7ffff7bbcb00 ) at malloc.c:4181 +4181 unlink(av, nextchunk, bck, fwd); +(gdb) bt +#0 0x00007ffff787c7bb in malloc_consolidate (av=av@entry=0x7ffff7bbcb00 ) at malloc.c:4181 +#1 0x00007ffff787f235 in _int_malloc (av=av@entry=0x7ffff7bbcb00 , bytes=bytes@entry=1024) at malloc.c:3448 +[...] +#8 0x00007ffff784c5ac in _IO_vfprintf_internal (s=0x7ffff7bbd600 <_IO_2_1_stdout_>, format=, ap=ap@entry=0x7ffff77fd7f8) at vfprintf.c:1631 +#9 0x00007ffff7853939 in __printf (format=) at printf.c:33 +#10 0x0000000000400d6b in down () +#11 0x0000000000400f2c in __morestack () +#12 0x0000000000400dda in down () +[...] + +This apparently is due to - man gcc - -fsplit-stack: + When code compiled with -fsplit-stack calls code compiled without + -fsplit-stack, there may not be much stack space available for the + latter code to run. If compiling all code, including library code, + with -fsplit-stack is not an option, then the linker can fix up these + calls so that the code compiled without -fsplit-stack always has + a large stack. Support for this is implemented in the gold linker in + GNU binutils release 2.21 and later. + +Personally I do not understand why gold is not the default linker as GNU ld is +unusably slow (6x) for C++ but that is off-topic here. + +OK for check-in? + + +Thanks, +Jan + +--HlL+5n6rz5pIUxbD +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename=1 + +gdb/testsuite/ChangeLog +2016-10-22 Jan Kratochvil + + * gdb.base/morestack.exp: Try to build it using -fuse-ld=gold first. + +diff --git a/gdb/testsuite/gdb.base/morestack.exp b/gdb/testsuite/gdb.base/morestack.exp +index 12f5d28..caa85b8 100644 +--- a/gdb/testsuite/gdb.base/morestack.exp ++++ b/gdb/testsuite/gdb.base/morestack.exp +@@ -23,7 +23,11 @@ if {$gcc_compiled == 0} { + + standard_testfile + +-if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {additional_flags=-fsplit-stack}] } { ++# -fuse-ld=gold is used for calling printf code built without -fsplit-stack ++# which could crash otherise. See GCC documentation of -fsplit-stack. ++set opts "additional_flags=-fsplit-stack" ++if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile [list $opts additional_flags=-fuse-ld=gold]] \ ++ && [prepare_for_testing ${testfile}.exp ${testfile} $srcfile $opts] } { + return -1 + } + + +--HlL+5n6rz5pIUxbD-- + diff --git a/SOURCES/gdb-upstream.patch b/SOURCES/gdb-upstream.patch index 0cee56f..cf86baa 100644 --- a/SOURCES/gdb-upstream.patch +++ b/SOURCES/gdb-upstream.patch @@ -409,3 +409,261 @@ index 6c10dfc..a1b8065 100644 main (void) -- 2.7.4 + + + +http://sourceware.org/ml/gdb-patches/2016-10/msg00613.html +Subject: [testsuite patch] Fix gcc_compiled for gcc 6 & 7 + + +--IS0zKkzwUGydFO0o +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi, + +OK for check-in? + + +Jan + +--IS0zKkzwUGydFO0o +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename=1 + +gdb/testsuite/ChangeLog +2016-10-20 Jan Kratochvil + + * lib/gdb.exp (get_compiler_info): Generalize gcc_compile regexp. + +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index 378eea0..7d9b198 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -3290,12 +3290,8 @@ proc get_compiler_info {{arg ""}} { + } + + # Set the legacy symbols. +- set gcc_compiled 0 +- if { [regexp "^gcc-1-" "$compiler_info" ] } { set gcc_compiled 1 } +- if { [regexp "^gcc-2-" "$compiler_info" ] } { set gcc_compiled 2 } +- if { [regexp "^gcc-3-" "$compiler_info" ] } { set gcc_compiled 3 } +- if { [regexp "^gcc-4-" "$compiler_info" ] } { set gcc_compiled 4 } +- if { [regexp "^gcc-5-" "$compiler_info" ] } { set gcc_compiled 5 } ++ set gcc_compiled 0 ++ regexp "^gcc-(\[0-9\]+)-" "$compiler_info" matchall gcc_compiled + + # Log what happened. + verbose -log "get_compiler_info: $compiler_info" + +--IS0zKkzwUGydFO0o-- + + + +http://sourceware.org/ml/gdb-patches/2017-02/msg00226.html +Subject: [OB PATCH] Fix NULL pointer dereference + +This commit fixes a segmentation fault on tab completion when +certain debuginfo is installed: + + https://bugzilla.redhat.com/show_bug.cgi?id=1398387 + +gdb/ChangeLog: + + * symtab.c (add_symtab_completions): Prevent NULL pointer + dereference. +--- + gdb/ChangeLog | 5 +++++ + gdb/symtab.c | 3 +++ + 2 files changed, 8 insertions(+) + +diff --git a/gdb/symtab.c b/gdb/symtab.c +index 356f480..2c141e5 100644 +--- a/gdb/symtab.c ++++ b/gdb/symtab.c +@@ -5163,6 +5163,9 @@ add_symtab_completions (struct compunit_symtab *cust, + struct block_iterator iter; + int i; + ++ if (cust == NULL) ++ return; ++ + for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++) + { + QUIT; +-- +1.8.3.1 + + + +commit 6e5d74e74756fafe59e8198c4cc462cf7c57e12c +Author: Pedro Alves +Date: Wed Mar 8 11:41:35 2017 +0000 + + Fix PR 21218: GDB dumps core when escaping newline in multi-line command + + With commit 3b12939dfc2399 ("Replace the sync_execution global with a + new enum prompt_state tristate"), GDB started aborting if you try + splitting an input line with a continuation char (backslash) while in + a multi-line command: + + (gdb) commands + Type commands for breakpoint(s) 1, one per line. + End with a line saying just "end". + >print \ + + (gdb) 1 # note "(gdb)" incorrectly printed here. + >end + + readline: readline_callback_read_char() called with no handler! + $ + + That abort is actually a symptom of an old problem introduced when + gdb_readline_wrapper was rewritten to use asynchronous readline, back + in 2007. Note how the "(gdb)" prompt is printed above in the "(gdb) + 1" line. Clearly it shouldn't be there, but it already was before the + commit mentioned above. Fixing that also fixes the readline abort + shown above. + + The problem starts when command_line_input passes a NULL prompt to + gdb_readline_wrapper when it finds previous incomplete input due to a + backslash, trying to fetch more input without printing another ">" + secondary prompt. That itself should not be a problem, because + passing NULL to gdb_readline_wrapper has the same meaning as passing a + pointer to empty string, since gdb_readline_wrapper exposes the same + interface as 'readline(char *)'. However, gdb_readline_wrapper passes + the prompt argument directly to display_gdb_prompt, and for the + latter, a NULL prompt argument has a different meaning - it requests + printing the primary prompt. + + Before commit 782a7b8ef9c096 (which rewrote gdb_readline_wrapper to + use asynchronous readline), GDB behaved like this: + + (gdb) commands + [....] + >print \ + 1 + >end + (gdb) + + The above is what this commit restores GDB back to. + + New test included. + + gdb/ChangeLog: + 2017-03-08 Pedro Alves + + PR cli/21218 + * top.c (gdb_readline_wrapper): Avoid passing NULL to + display_gdb_prompt. + (command_line_input): Add comment. + + gdb/testsuite/ChangeLog: + 2017-03-08 Pedro Alves + Jan Kratochvil + + PR cli/21218 + * gdb.base/commands.exp (backslash_in_multi_line_command_test): + New proc. + (top level): Call it. + +### a/gdb/ChangeLog +### b/gdb/ChangeLog +## -1,5 +1,12 @@ + 2017-03-08 Pedro Alves + ++ PR cli/21218 ++ * top.c (gdb_readline_wrapper): Avoid passing NULL to ++ display_gdb_prompt. ++ (command_line_input): Add comment. ++ ++2017-03-08 Pedro Alves ++ + PR tui/21216 + * tui/tui-file.c (tui_file::write): New. + * tui/tui-file.h (tui_file): Override "write". +### a/gdb/testsuite/ChangeLog +### b/gdb/testsuite/ChangeLog +## -1,4 +1,12 @@ + 2017-03-08 Pedro Alves ++ Jan Kratochvil ++ ++ PR cli/21218 ++ * gdb.base/commands.exp (backslash_in_multi_line_command_test): ++ New proc. ++ (top level): Call it. ++ ++2017-03-08 Pedro Alves + + PR tui/21216 + * gdb.tui/tui-nl-filtered-output.exp: New file. +--- a/gdb/testsuite/gdb.base/commands.exp ++++ b/gdb/testsuite/gdb.base/commands.exp +@@ -759,6 +759,34 @@ proc redefine_backtrace_test {} { + "execute bt command in redefine_backtrace_test" + } + ++# Test an input line split with a continuation character (backslash) ++# while entering a multi-line command (in a secondary prompt). ++ ++proc backslash_in_multi_line_command_test {} { ++ gdb_breakpoint "main" ++ ++ gdb_test_multiple "commands" "commands" { ++ -re "End with a line saying just \"end\"\\.\r\n>$" { ++ pass "commands" ++ } ++ } ++ ++ set test "input line split with backslash" ++ send_gdb "print \\\nargc\n" ++ gdb_test_multiple "" $test { ++ -re "^print \\\\\r\nargc\r\n>$" { ++ pass $test ++ } ++ } ++ ++ gdb_test_no_output "end" ++ ++ # Input any command, just to be sure the readline state is sane. ++ # In PR 21218, this would trigger the infamous: ++ # readline: readline_callback_read_char() called with no handler! ++ gdb_test "print 1" "" "run command" ++} ++ + gdbvar_simple_if_test + gdbvar_simple_while_test + gdbvar_complex_if_while_test +@@ -1027,5 +1055,6 @@ recursive_source_test + if_commands_test + error_clears_commands_left + redefine_hook_test ++backslash_in_multi_line_command_test + # This one should come last, as it redefines "backtrace". + redefine_backtrace_test +--- a/gdb/top.c ++++ b/gdb/top.c +@@ -1030,8 +1030,11 @@ gdb_readline_wrapper (const char *prompt) + if (cleanup->target_is_async_orig) + target_async (0); + +- /* Display our prompt and prevent double prompt display. */ +- display_gdb_prompt (prompt); ++ /* Display our prompt and prevent double prompt display. Don't pass ++ down a NULL prompt, since that has special meaning for ++ display_gdb_prompt -- it indicates a request to print the primary ++ prompt, while we want a secondary prompt here. */ ++ display_gdb_prompt (prompt != NULL ? prompt : ""); + if (ui->command_editing) + rl_already_prompted = 1; + +@@ -1307,6 +1310,9 @@ command_line_input (const char *prompt_arg, int repeat, char *annotation_suffix) + if (cmd != NULL) + break; + ++ /* Got partial input. I.e., got a line that ends with a ++ continuation character (backslash). Suppress printing the ++ prompt again. */ + prompt = NULL; + } + diff --git a/SPECS/gdb.spec b/SPECS/gdb.spec index 80b2ad2..e2d0f3f 100644 --- a/SPECS/gdb.spec +++ b/SPECS/gdb.spec @@ -22,11 +22,11 @@ Name: %{?scl_prefix}gdb # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20150822 %global tarname gdb-%{version} -Version: 7.12 +Version: 7.12.1 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 24%{?dist} +Release: 47%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -46,6 +46,12 @@ Recommends: %{?scl_prefix}gcc-gdb-plugin%{?_isa} %endif %if 0%{!?scl:1} +# when manpages were moved from -headless to main +# https://bugzilla.redhat.com/show_bug.cgi?id=1402554 +# theoretically should not be required due to versioned dependeny +# below, but it cannot hurt either -- rdieter +Conflicts: gdb-headless < 7.12-29 + Summary: A stub package for GNU source-level debugger Requires: gdb-headless%{?_isa} = %{version}-%{release} @@ -65,10 +71,11 @@ Summary: A GNU source-level debugger for C, C++, Fortran, Go and other languages Obsoletes: gdb64 < 5.3.91 %endif +%ifarch %{arm} %global have_inproctrace 0 -%ifarch %{ix86} x86_64 +%else %global have_inproctrace 1 -%endif # %{ix86} x86_64 +%endif # gdb-add-index cannot be run even for SCL package on RHEL<=6. %if 0%{!?rhel:1} || 0%{?rhel} > 6 @@ -143,7 +150,7 @@ Source3: gdb-gstack.man Source4: gdbinit # libstdc++ pretty printers from GCC SVN. -%global libstdcxxpython gdb-libstdc++-v3-python-6.1.1-20160817 +%global libstdcxxpython gdb-libstdc++-v3-python-6.3.1-20170212 Source5: %{libstdcxxpython}.tar.xz # Provide gdbtui for RHEL-5 and RHEL-6 as it is removed upstream (BZ 797664). @@ -475,6 +482,10 @@ Patch547: gdb-test-dw2-aranges.patch #=fedoratest Patch548: gdb-test-expr-cumulative-archer.patch +# Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). +Patch565: gdb-physname-pr11734-test.patch +Patch567: gdb-physname-pr12273-test.patch + # Toolchain on sparc is slightly broken and debuginfo files are generated # with non 64bit aligned tables/offsets. # See for example readelf -S ../Xvnc.debug. @@ -489,6 +500,9 @@ Patch548: gdb-test-expr-cumulative-archer.patch #=push+work Patch579: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch +# Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890). +Patch616: gdb-test-ivy-bridge.patch + # Work around PR libc/13097 "linux-vdso.so.1" warning message. #=push Patch627: gdb-glibc-vdso-workaround.patch @@ -544,6 +558,9 @@ Patch848: gdb-dts-rhel6-python-compat.patch # Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211). Patch852: gdb-gnat-dwarf-crash-3of3.patch +# Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614) +Patch861: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch + # VLA (Fortran dynamic arrays) from Intel + archer-jankratochvil-vla tests. Patch1058: gdb-vla-intel-fortran-strides.patch Patch1132: gdb-vla-intel-fortran-vla-strings.patch @@ -560,9 +577,22 @@ Patch925: gdb-fortran-frame-string.patch # Fix Python GIL with gdb.execute("continue") (Phil Muldoon, BZ 1116957). Patch927: gdb-python-gil.patch +# Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to +# crash.' (RH BZ 1156192). +Patch977: gdb-rhbz1156192-recursive-dlopen-test.patch + # Fix jit-reader.h for multi-lib. Patch978: gdb-jit-reader-multilib.patch +# Fix '`catch syscall' doesn't work for parent after `fork' is called' +# (Philippe Waroquiers, RH BZ 1149205). +Patch984: gdb-rhbz1149205-catch-syscall-after-fork-test.patch + +# Fix 'backport GDB 7.4 fix to RHEL 6.6 GDB' [Original Sourceware bug +# description: 'C++ (and objc): Internal error on unqualified name +# re-set', PR 11657] (RH BZ 1186476). +Patch991: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch + # Test 'info type-printers' Python error (RH BZ 1350436). Patch992: gdb-rhbz1350436-type-printers-error.patch @@ -606,13 +636,19 @@ Patch1144: gdb-bison-old.patch Patch1145: gdb-testsuite-casts.patch Patch1146: gdb-testsuite-m-static.patch -# [aarch64] Fix gdb.cp/nextoverthrow.exp regression (Yao Qi). -Patch1148: gdb-aarch64-nextoverthrow.patch - # Fix TLS (such as 'errno') regression. Patch1149: gdb-tls-1of2.patch Patch1150: gdb-tls-2of2.patch +# [testsuite] Fix false FAIL for gdb.base/morestack.exp. +Patch1151: gdb-testsuite-morestack-gold.patch + +# Fix gdb-headless /usr/bin/ executables (BZ 1390251). +Patch1152: gdb-libexec-add-index.patch + +# Fix gdb-add-index for 444 *.debug files. +Patch1153: gdb-add-index-chmod.patch + %if 0%{!?rhel:1} || 0%{?rhel} > 6 # RL_STATE_FEDORA_GDB would not be found for: # Patch642: gdb-readline62-ask-more-rh.patch @@ -922,7 +958,10 @@ find -name "*.info*"|xargs rm -f %patch542 -p1 %patch547 -p1 %patch548 -p1 +%patch565 -p1 +%patch567 -p1 %patch579 -p1 +%patch616 -p1 %patch627 -p1 %patch634 -p1 %patch653 -p1 @@ -939,13 +978,17 @@ find -name "*.info*"|xargs rm -f %patch818 -p1 %patch832 -p1 %patch852 -p1 +%patch861 -p1 %patch863 -p1 %patch887 -p1 %patch888 -p1 %patch918 -p1 %patch925 -p1 %patch927 -p1 +%patch977 -p1 %patch978 -p1 +%patch984 -p1 +%patch991 -p1 %patch992 -p1 %patch1026 -p1 %patch1053 -p1 @@ -973,9 +1016,11 @@ done %patch1144 -p1 %patch1145 -p1 %patch1146 -p1 -%patch1148 -p1 %patch1149 -p1 %patch1150 -p1 +%patch1151 -p1 +%patch1152 -p1 +%patch1153 -p1 %patch1075 -p1 %if 0%{?rhel:1} && 0%{?rhel} <= 7 @@ -1306,7 +1351,16 @@ make %{?_smp_mflags} install DESTDIR=$RPM_BUILD_ROOT %if 0%{!?scl:1} mkdir -p $RPM_BUILD_ROOT%{_prefix}/libexec mv -f $RPM_BUILD_ROOT%{_bindir}/gdb $RPM_BUILD_ROOT%{_prefix}/libexec/gdb -ln -s -r $RPM_BUILD_ROOT%{_prefix}/libexec/gdb $RPM_BUILD_ROOT%{_bindir}/gdb +%if 0%{?rhel:1} && 0%{?rhel} <= 6 +# RHEL-6: ln: invalid option -- 'r': https://bugzilla.redhat.com/show_bug.cgi?id=1384947 +# RHEL-6 also does not have: /usr/bin/realpath +ln -s $( + perl -le 'sub x{$_=$_[0];s{/+}{/}g;s{/$}{};return split "/";}@a=x shift;@b=x shift;while($a[0] eq $b[0]){shift @a;shift @b;}print join "/",map("..",@a),@b;' \ + $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_prefix}/libexec/gdb +) $RPM_BUILD_ROOT%{_bindir}/gdb +%else +ln -s -r $RPM_BUILD_ROOT%{_prefix}/libexec/gdb $RPM_BUILD_ROOT%{_bindir}/gdb +%endif %endif # Provide gdbtui for RHEL-5 and RHEL-6 as it is removed upstream (BZ 797664). @@ -1332,7 +1386,7 @@ mkdir -p $RPM_BUILD_ROOT/usr/lib/debug%{_bindir} cp -p $RPM_BUILD_DIR/%{gdb_src}/gdb/gdb-gdb.py $RPM_BUILD_ROOT/usr/lib/debug%{_bindir}/ for pyo in "" "-O";do # RHEL-5: AttributeError: 'module' object has no attribute 'compile_file' - python $pyo -c 'import compileall, re, sys; sys.exit (not compileall.compile_dir("'"$RPM_BUILD_ROOT/usr/lib/debug%{_bindir}"'", 1, "'"/usr/lib/debug%{_bindir}"'"))' + %{__python} $pyo -c 'import compileall, re, sys; sys.exit (not compileall.compile_dir("'"$RPM_BUILD_ROOT/usr/lib/debug%{_bindir}"'", 1, "'"/usr/lib/debug%{_bindir}"'"))' done %endif # 0%{?_enable_debug_packages:1} && 0%{!?_without_python:1} @@ -1440,40 +1494,37 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) +%doc COPYING3 COPYING COPYING.LIB README NEWS %{_bindir}/gdb +%{_bindir}/gcore +%{_mandir}/*/gcore.1* +%{_bindir}/gstack +%{_mandir}/*/gstack.1* +%{_bindir}/pstack +%{_mandir}/*/pstack.1* +# Provide gdb/jit-reader.h so that users are able to write their own GDB JIT +# plugins. +%{_includedir}/gdb %if 0%{!?scl:1} %files headless %defattr(-,root,root) %{_prefix}/libexec/gdb %endif -%doc COPYING3 COPYING COPYING.LIB README NEWS -%{_bindir}/gcore %config(noreplace) %{_sysconfdir}/gdbinit +%{_mandir}/*/gdb.1* %{_sysconfdir}/gdbinit.d %{_mandir}/*/gdbinit.5* -%{_mandir}/*/gdb.1* -%{_mandir}/*/gcore.1* # gdb-add-index cannot be run even for SCL package on RHEL<=6. %if 0%{!?rhel:1} || 0%{?rhel} > 6 +%{_bindir}/gdb-add-index %{_mandir}/*/gdb-add-index.1* %endif -%{_bindir}/gstack -%{_mandir}/*/gstack.1* # Provide gdbtui for RHEL-5 and RHEL-6 as it is removed upstream (BZ 797664). %if 0%{?rhel:1} && 0%{?rhel} <= 6 %{_bindir}/gdbtui %{_mandir}/*/gdbtui.1* %endif # 0%{?rhel:1} && 0%{?rhel} <= 6 -# gdb-add-index cannot be run even for SCL package on RHEL<=6. -%if 0%{!?rhel:1} || 0%{?rhel} > 6 -%{_bindir}/gdb-add-index -%endif -%{_bindir}/pstack -%{_mandir}/*/pstack.1* %{_datadir}/gdb -# Provide gdb/jit-reader.h so that users are able to write their own GDB JIT -# plugins. -%{_includedir}/gdb # don't include the files in include, they are part of binutils @@ -1533,6 +1584,63 @@ then fi %changelog +* Wed Mar 8 2017 Jan Kratochvil - 7.12.1-47.fc25 +- Fix EOL escape in multiline command segv (Pedro Alves, RH BZ 1429172). + +* Wed Feb 15 2017 Jan Kratochvil - 7.12.1-46.fc25 +- Fix -completion crash (Gary Benson, RH BZ 1398387). + +* Tue Feb 14 2017 Jan Kratochvil - 7.12.1-45.fc25 +- Release bump. + +* Sun Feb 12 2017 Jan Kratochvil - 7.12.1-44.fc25 +- [dts] Upgrade libstdc++-v3-python to 6.3.1-20170212. + +* Sat Jan 21 2017 Jan Kratochvil - 7.12.1-41.fc25 +- Rebase to released FSF GDB 7.12.1. + +* Tue Jan 17 2017 Jan Kratochvil - 7.12-40.fc25 +- Enable libinproctrace.so on all archs except arm32. + +* Thu Jan 12 2017 Jan Kratochvil - 7.12-37.fc25 +- [rhel6] Fix missing /usr/bin/realpath. + +* Wed Jan 11 2017 Jan Kratochvil - 7.12-36.fc25 +- Update from FSF GDB 7.12 stable branch to snapshot: gdb-7.12.0.20170111 + +* Sun Jan 8 2017 Jan Kratochvil - 7.12-35.fc25 +- Fix Python backtraces for 32-bit inferiors (Tom Tromey, RH BZ 1411094). + +* Fri Jan 6 2017 Jan Kratochvil - 7.12-34.fc25 +- Fix gdb-add-index for 444 *.debug files. + +* Mon Jan 02 2017 Rex Dieter - 7.12-33.fc25 +- fix logic of prior Conflicts + +* Mon Jan 02 2017 Rex Dieter - 7.12-32.fc25 +- Conflicts: gdb-headless < 7.12-29 (#1402554) + +* Fri Dec 09 2016 Charalampos Stratakis - 7.12-31.fc25 +- Python 3.6 rebuild: Rebuild with python3 support. + +* Fri Dec 09 2016 Charalampos Stratakis - 7.12-30.fc25 +- Python 3.6 rebuild: Rebuild without python3 support. + +* Mon Oct 31 2016 Jan Kratochvil - 7.12-29.fc25 +- Fix gdb-headless /usr/bin/ executables (BZ 1390251). + +* Mon Oct 24 2016 Jan Kratochvil - 7.12-28.fc25 +- Fix testcase: gdb.base/gdb-rhbz1156192-recursive-dlopen.exp + +* Sun Oct 23 2016 Jan Kratochvil - 7.12-27.fc25 +- More work on missing testcases present in rhel6 GDB; some still FAIL. + +* Thu Oct 20 2016 Jan Kratochvil - 7.12-26.fc25 +- Add missing testcases present in rhel6 GDB; some still FAIL. + +* Fri Oct 14 2016 Jan Kratochvil - 7.12-25.fc25 +- [rhel6] Fix .spec without devtoolset-6-build installed (RH BZ 1384947). + * Wed Oct 12 2016 Jan Kratochvil - 7.12-24.fc25 - Fix TLS (such as 'errno') regression.