Jan Kratochvil 60c662d
commit 2c29df25b7c2ff006b45afd80ee6dd734ebbd47c
Jan Kratochvil 60c662d
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Jan Kratochvil 60c662d
Date:   Sun Sep 11 16:53:09 2016 -0400
Jan Kratochvil 60c662d
Jan Kratochvil 60c662d
    Fix false FAIL on gdb.base/stap-probe.exp, due to ICF optimization
Jan Kratochvil 60c662d
    
Jan Kratochvil 60c662d
    GCC 6's ICF optimization pass is making the declaration of 'm1' and
Jan Kratochvil 60c662d
    'm2', on gdb.base/stap-probe.c, to be unified.  However, this leads to
Jan Kratochvil 60c662d
    only one instance of the probe 'two' being created, which causes a
Jan Kratochvil 60c662d
    failure on the testsuite (which expects a multi-location breakpoint to
Jan Kratochvil 60c662d
    be inserted on the probe).
Jan Kratochvil 60c662d
    
Jan Kratochvil 60c662d
    This patch fixes this failure by declaring a dummy variable on 'm1',
Jan Kratochvil 60c662d
    and using it as an argument to m1's version of probe 'two'.  Since we
Jan Kratochvil 60c662d
    do not care about the contents of the functions nor about the
Jan Kratochvil 60c662d
    arguments of each probe 'two', this is OK.
Jan Kratochvil 60c662d
    
Jan Kratochvil 60c662d
    gdb/testsuite/ChangeLog:
Jan Kratochvil 60c662d
    2016-09-11  Sergio Durigan Junior  <sergiodj@redhat.com>
Jan Kratochvil 60c662d
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil 60c662d
    
Jan Kratochvil 60c662d
    	* gdb.base/stap-probe.c (m1): New variable 'dummy', necessary to
Jan Kratochvil 60c662d
    	make m1's definition to be different from m2's.  Use 'dummy' as an
Jan Kratochvil 60c662d
    	argument for probe 'two'.
Jan Kratochvil 60c662d
Jan Kratochvil 60c662d
### a/gdb/testsuite/ChangeLog
Jan Kratochvil 60c662d
### b/gdb/testsuite/ChangeLog
Jan Kratochvil 60c662d
## -1,3 +1,10 @@
Jan Kratochvil 60c662d
+2016-09-11  Sergio Durigan Junior  <sergiodj@redhat.com>
Jan Kratochvil 60c662d
+	    Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil 60c662d
+
Jan Kratochvil 60c662d
+	* gdb.base/stap-probe.c (m1): New variable 'dummy', necessary to
Jan Kratochvil 60c662d
+	make m1's definition to be different from m2's.  Use 'dummy' as an
Jan Kratochvil 60c662d
+	argument for probe 'two'.
Jan Kratochvil 60c662d
+
Jan Kratochvil 60c662d
 2016-09-10  Jon Beniston  <jon@beniston.com>
Jan Kratochvil 60c662d
 
Jan Kratochvil 60c662d
 	* lib/mi-support.exp (mi_gdb_target_load): Use target_sim_options
Jan Kratochvil 60c662d
--- a/gdb/testsuite/gdb.base/stap-probe.c
Jan Kratochvil 60c662d
+++ b/gdb/testsuite/gdb.base/stap-probe.c
Jan Kratochvil 60c662d
@@ -53,8 +53,13 @@ struct funcs
Jan Kratochvil 60c662d
 static void
Jan Kratochvil 60c662d
 m1 (void)
Jan Kratochvil 60c662d
 {
Jan Kratochvil 60c662d
+  /* m1 and m2 are equivalent, but because of some compiler
Jan Kratochvil 60c662d
+     optimizations we have to make each of them unique.  This is why
Jan Kratochvil 60c662d
+     we have this dummy variable here.  */
Jan Kratochvil 60c662d
+  volatile int dummy = 0;
Jan Kratochvil 60c662d
+
Jan Kratochvil 60c662d
   if (TEST2)
Jan Kratochvil 60c662d
-    STAP_PROBE (test, two);
Jan Kratochvil 60c662d
+    STAP_PROBE1 (test, two, dummy);
Jan Kratochvil 60c662d
 }
Jan Kratochvil 60c662d
 
Jan Kratochvil 60c662d
 static void
Jan Kratochvil eed01b8
Jan Kratochvil eed01b8
Jan Kratochvil eed01b8
commit f389f6fef76d7cf8e8beb7061edff2155c284898
Jan Kratochvil eed01b8
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil eed01b8
Date:   Wed Oct 5 21:56:46 2016 +0200
Jan Kratochvil eed01b8
Jan Kratochvil eed01b8
    testsuite: Fix recent GCC FAIL: gdb.arch/i386-signal.exp
Jan Kratochvil eed01b8
    
Jan Kratochvil eed01b8
    gcc-6.2.1-2.fc24.x86_64
Jan Kratochvil eed01b8
    
Jan Kratochvil eed01b8
    (gdb) backtrace 10^M
Jan Kratochvil eed01b8
    (gdb) FAIL: gdb.arch/i386-signal.exp: backtrace 10
Jan Kratochvil eed01b8
    
Jan Kratochvil eed01b8
    (gdb) disas/s
Jan Kratochvil eed01b8
    Dump of assembler code for function main:
Jan Kratochvil eed01b8
    .../gdb/testsuite/gdb.arch/i386-signal.c:
Jan Kratochvil eed01b8
    30      {
Jan Kratochvil eed01b8
       0x000000000040057f <+0>:     push   %rbp
Jan Kratochvil eed01b8
       0x0000000000400580 <+1>:     mov    %rsp,%rbp
Jan Kratochvil eed01b8
    31        setup ();
Jan Kratochvil eed01b8
       0x0000000000400583 <+4>:     callq  0x400590 <setup>
Jan Kratochvil eed01b8
    => 0x0000000000400588 <+9>:     mov    $0x0,%eax
Jan Kratochvil eed01b8
    32      }
Jan Kratochvil eed01b8
       0x000000000040058d <+14>:    pop    %rbp
Jan Kratochvil eed01b8
       0x000000000040058e <+15>:    retq
Jan Kratochvil eed01b8
    End of assembler dump.
Jan Kratochvil eed01b8
    
Jan Kratochvil eed01b8
    The .exp patch is an obvious typo fix I think.  The regex was written to
Jan Kratochvil eed01b8
    accept "ADDR in main" and I find it OK as checking .debug_line validity is not
Jan Kratochvil eed01b8
    the purpose of this testfile.
Jan Kratochvil eed01b8
    
Jan Kratochvil eed01b8
    gcc-4.8.5-11.el7.x86_64 did not put the 'mov $0x0,%eax' instruction there at
Jan Kratochvil eed01b8
    all so there was no problem with .debug_line.
Jan Kratochvil eed01b8
    
Jan Kratochvil eed01b8
    gdb/testsuite/ChangeLog
Jan Kratochvil eed01b8
    2016-10-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil eed01b8
    
Jan Kratochvil eed01b8
    	* gdb.arch/i386-signal.exp (backtrace 10): Fix #2 typo.
Jan Kratochvil eed01b8
Jan Kratochvil eed01b8
### a/gdb/testsuite/ChangeLog
Jan Kratochvil eed01b8
### b/gdb/testsuite/ChangeLog
Jan Kratochvil eed01b8
## -1,3 +1,7 @@
Jan Kratochvil eed01b8
+2016-10-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil eed01b8
+
Jan Kratochvil eed01b8
+	* gdb.arch/i386-signal.exp (backtrace 10): Fix #2 typo.
Jan Kratochvil eed01b8
+
Jan Kratochvil eed01b8
 2016-10-05  Yao Qi  <yao.qi@linaro.org>
Jan Kratochvil eed01b8
 
Jan Kratochvil eed01b8
 	* lib/gdb.exp (support_complex_tests): Return zero if
Jan Kratochvil eed01b8
--- a/gdb/testsuite/gdb.arch/i386-signal.exp
Jan Kratochvil eed01b8
+++ b/gdb/testsuite/gdb.arch/i386-signal.exp
Jan Kratochvil eed01b8
@@ -35,6 +35,6 @@ gdb_load ${binfile}
Jan Kratochvil eed01b8
 
Jan Kratochvil eed01b8
 runto func
Jan Kratochvil eed01b8
 gdb_test "backtrace 10" \
Jan Kratochvil eed01b8
-    "#0  ($hex in )?func.*\r\n#1  <signal handler called>\r\n#2  ($hex in)?main.*"
Jan Kratochvil eed01b8
+    "#0  ($hex in )?func.*\r\n#1  <signal handler called>\r\n#2  ($hex in )?main.*"
Jan Kratochvil eed01b8
 
Jan Kratochvil eed01b8
 gdb_test "finish" "Run till exit from \#0  func.*<signal handler called>"
Jan Kratochvil 425d099
Jan Kratochvil 425d099
Jan Kratochvil 425d099
commit 20c2c024c1e89e402a57e8c3577fb9777709d9a4
Jan Kratochvil 425d099
Author: Carl E. Love <carll@oc4738070240.ibm.com>
Jan Kratochvil 425d099
Date:   Fri Aug 19 11:06:38 2016 -0700
Jan Kratochvil 425d099
Jan Kratochvil 425d099
    Fix missing files for ld when test suite not compiled in the source directory
Jan Kratochvil 425d099
    
Jan Kratochvil 425d099
    This patch fixes an issues with six test suite expect files that do not
Jan Kratochvil 425d099
    run correctly when the test suite is not built in the source directory.  The
Jan Kratochvil 425d099
    issue is these tests are not using the current "standard_testfile" call
Jan Kratochvil 425d099
    but rather using the older set command to initialize the "testfile",
Jan Kratochvil 425d099
    "srcfile" and "binprefix" variables or are missing the set for the
Jan Kratochvil 425d099
    "binprefix" variable.
Jan Kratochvil 425d099
    
Jan Kratochvil 425d099
    -----------------------------------------------
Jan Kratochvil 425d099
    
Jan Kratochvil 425d099
    gdb/testsuite/ChangeLog
Jan Kratochvil 425d099
    
Jan Kratochvil 425d099
    2016-08-19  Carl Love  <cel@us.ibm.com>
Jan Kratochvil 425d099
    
Jan Kratochvil 425d099
    	* gdb.arch/altivec-regs.exp: Use standard_testfile instead of
Jan Kratochvil 425d099
    	maintaining separate logic for constructing the output path.
Jan Kratochvil 425d099
    	* gdb.arch/powerpc-d128-regs.exp: Likewise.
Jan Kratochvil 425d099
    	* gdb.arch/ppc-dfp.exp: Likewise.
Jan Kratochvil 425d099
    	* gdb.arch/ppc-fp.exp: Likewise.
Jan Kratochvil 425d099
    	* gdb.arch/vsx-regs.exp: Likewise.
Jan Kratochvil 425d099
    	* gdb.arch/altivec-abi.exp: Likewise, plus added local variable
Jan Kratochvil 425d099
    	binprefix for generating the additional binary files.
Jan Kratochvil 425d099
Jan Kratochvil 425d099
### a/gdb/testsuite/ChangeLog
Jan Kratochvil 425d099
### b/gdb/testsuite/ChangeLog
Jan Kratochvil 425d099
## -1,3 +1,14 @@
Jan Kratochvil 425d099
+2016-08-19  Carl Love  <cel@us.ibm.com>
Jan Kratochvil 425d099
+
Jan Kratochvil 425d099
+	* gdb.arch/altivec-regs.exp: Use standard_testfile instead of
Jan Kratochvil 425d099
+	maintaining separate logic for constructing the output path.
Jan Kratochvil 425d099
+	* gdb.arch/powerpc-d128-regs.exp: Likewise.
Jan Kratochvil 425d099
+	* gdb.arch/ppc-dfp.exp: Likewise.
Jan Kratochvil 425d099
+	* gdb.arch/ppc-fp.exp: Likewise.
Jan Kratochvil 425d099
+	* gdb.arch/vsx-regs.exp: Likewise.
Jan Kratochvil 425d099
+	* gdb.arch/altivec-abi.exp: Likewise, plus added local variable
Jan Kratochvil 425d099
+	binprefix for generating the additional binary files.
Jan Kratochvil 425d099
+
Jan Kratochvil 425d099
 2016-08-19  Pedro Alves  <palves@redhat.com>
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 	* gdb.trace/mi-trace-frame-collected.exp
Jan Kratochvil 425d099
--- a/gdb/testsuite/gdb.arch/altivec-abi.exp
Jan Kratochvil 425d099
+++ b/gdb/testsuite/gdb.arch/altivec-abi.exp
Jan Kratochvil 425d099
@@ -26,9 +26,7 @@ if {![istarget "powerpc*"] || [skip_altivec_tests]} then {
Jan Kratochvil 425d099
     return
Jan Kratochvil 425d099
 }
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
-set testfile "altivec-abi"
Jan Kratochvil 425d099
-set binfile ${objdir}/${subdir}/${testfile}
Jan Kratochvil 425d099
-set srcfile ${testfile}.c
Jan Kratochvil 425d099
+standard_testfile
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 if [get_compiler_info] {
Jan Kratochvil 425d099
     warning "get_compiler failed"
Jan Kratochvil 425d099
@@ -146,6 +144,8 @@ proc altivec_abi_tests { extra_flags force_abi } {
Jan Kratochvil 425d099
 }
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 if [test_compiler_info gcc*] {
Jan Kratochvil 425d099
+    set binprefix ${binfile}
Jan Kratochvil 425d099
+
Jan Kratochvil 425d099
     with_test_prefix "default ABI, auto" {
Jan Kratochvil 425d099
 	altivec_abi_tests  "additional_flags=-maltivec" "auto"
Jan Kratochvil 425d099
     }
Jan Kratochvil 425d099
@@ -156,23 +156,23 @@ if [test_compiler_info gcc*] {
Jan Kratochvil 425d099
 	# On 64-bit GNU/Linux with GCC 4.1 and 4.2, -mabi=no-altivec
Jan Kratochvil 425d099
 	# was broken, so skip those tests there.
Jan Kratochvil 425d099
 	if { ![is_lp64_target] || ![test_compiler_info "gcc-4-\[12\]-*"] } {
Jan Kratochvil 425d099
-	    set binfile ${objdir}/${subdir}/${testfile}-ge-ge
Jan Kratochvil 425d099
+	    set binfile ${binprefix}-ge-ge
Jan Kratochvil 425d099
 	    with_test_prefix "generic ABI, forced" {
Jan Kratochvil 425d099
 		altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=no-altivec" "generic"
Jan Kratochvil 425d099
 	    }
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
-	    set binfile ${objdir}/${subdir}/${testfile}-ge-auto
Jan Kratochvil 425d099
+	    set binfile ${binprefix}-ge-auto
Jan Kratochvil 425d099
 	    with_test_prefix "generic ABI, auto" {
Jan Kratochvil 425d099
 		altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=no-altivec" "auto"
Jan Kratochvil 425d099
 	    }
Jan Kratochvil 425d099
 	}
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
-	set binfile ${objdir}/${subdir}/${testfile}-av-av
Jan Kratochvil 425d099
+	set binfile ${binprefix}-av-av
Jan Kratochvil 425d099
 	with_test_prefix "AltiVec ABI, forced" {
Jan Kratochvil 425d099
 	    altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=altivec" "altivec"
Jan Kratochvil 425d099
 	}
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
-	set binfile ${objdir}/${subdir}/${testfile}-av-auto
Jan Kratochvil 425d099
+	set binfile ${binprefix}-av-auto
Jan Kratochvil 425d099
 	with_test_prefix "AltiVec ABI, auto" {
Jan Kratochvil 425d099
 	    altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=altivec" "auto"
Jan Kratochvil 425d099
 	}
Jan Kratochvil 425d099
--- a/gdb/testsuite/gdb.arch/altivec-regs.exp
Jan Kratochvil 425d099
+++ b/gdb/testsuite/gdb.arch/altivec-regs.exp
Jan Kratochvil 425d099
@@ -27,9 +27,7 @@ if {![istarget "powerpc*"] || [skip_altivec_tests]} then {
Jan Kratochvil 425d099
     return
Jan Kratochvil 425d099
 }
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
-set testfile "altivec-regs"
Jan Kratochvil 425d099
-set binfile ${objdir}/${subdir}/${testfile}
Jan Kratochvil 425d099
-set srcfile ${testfile}.c
Jan Kratochvil 425d099
+standard_testfile
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 set compile_flags {debug nowarnings}
Jan Kratochvil 425d099
 if [get_compiler_info] {
Jan Kratochvil 425d099
--- a/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
Jan Kratochvil 425d099
+++ b/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
Jan Kratochvil 425d099
@@ -25,9 +25,7 @@ if ![istarget "powerpc64*-*"] then {
Jan Kratochvil 425d099
     return
Jan Kratochvil 425d099
 }
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
-set testfile "powerpc-d128-regs"
Jan Kratochvil 425d099
-set srcfile ${testfile}.c
Jan Kratochvil 425d099
-set binfile ${objdir}/${subdir}/${testfile}
Jan Kratochvil 425d099
+standard_testfile
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quiet debug}] != "" } {
Jan Kratochvil 425d099
      untested powerpc-d128-regs.exp
Jan Kratochvil 425d099
--- a/gdb/testsuite/gdb.arch/ppc-dfp.exp
Jan Kratochvil 425d099
+++ b/gdb/testsuite/gdb.arch/ppc-dfp.exp
Jan Kratochvil 425d099
@@ -21,9 +21,7 @@ if ![istarget "powerpc*"] then {
Jan Kratochvil 425d099
     return
Jan Kratochvil 425d099
 }
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
-set testfile "ppc-dfp"
Jan Kratochvil 425d099
-set binfile ${objdir}/${subdir}/${testfile}
Jan Kratochvil 425d099
-set srcfile ${testfile}.c
Jan Kratochvil 425d099
+standard_testfile
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 if [get_compiler_info] {
Jan Kratochvil 425d099
     warning "get_compiler failed"
Jan Kratochvil 425d099
--- a/gdb/testsuite/gdb.arch/ppc-fp.exp
Jan Kratochvil 425d099
+++ b/gdb/testsuite/gdb.arch/ppc-fp.exp
Jan Kratochvil 425d099
@@ -21,9 +21,7 @@ if ![istarget "powerpc*"] then {
Jan Kratochvil 425d099
     return
Jan Kratochvil 425d099
 }
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
-set testfile "ppc-fp"
Jan Kratochvil 425d099
-set binfile ${objdir}/${subdir}/${testfile}
Jan Kratochvil 425d099
-set srcfile ${testfile}.c
Jan Kratochvil 425d099
+standard_testfile
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 if [get_compiler_info] {
Jan Kratochvil 425d099
     warning "get_compiler failed"
Jan Kratochvil 425d099
--- a/gdb/testsuite/gdb.arch/vsx-regs.exp
Jan Kratochvil 425d099
+++ b/gdb/testsuite/gdb.arch/vsx-regs.exp
Jan Kratochvil 425d099
@@ -24,9 +24,7 @@ if {![istarget "powerpc*"] || [skip_vsx_tests]} then {
Jan Kratochvil 425d099
     return
Jan Kratochvil 425d099
 }
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
-set testfile "vsx-regs"
Jan Kratochvil 425d099
-set binfile ${objdir}/${subdir}/${testfile}
Jan Kratochvil 425d099
-set srcfile ${testfile}.c
Jan Kratochvil 425d099
+standard_testfile
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 set compile_flags {debug nowarnings quiet}
Jan Kratochvil 425d099
 if [get_compiler_info] {
Jan Kratochvil 425d099
Jan Kratochvil 425d099
Jan Kratochvil 425d099
http://sourceware.org/ml/gdb-patches/2016-10/msg00258.html
Jan Kratochvil 425d099
Subject: [testsuite obv] Use standard_output_file
Jan Kratochvil 425d099
Jan Kratochvil 425d099
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil 425d099
Date: Tue, 11 Oct 2016 16:43:58 +0200
Jan Kratochvil 425d099
Subject: [PATCH] testsuite: Use standard_output_file
Jan Kratochvil 425d099
Subject: [PATCH] testsuite: Use standard_output_file
Jan Kratochvil 425d099
Jan Kratochvil 425d099
gdb/testsuite/ChangeLog
Jan Kratochvil 425d099
2016-10-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil 425d099
Jan Kratochvil 425d099
	* gdb.arch/powerpc-prologue.exp: Use standard_output_file.
Jan Kratochvil 425d099
	* gdb.arch/ppc64-symtab-cordic.exp: Likewise.
Jan Kratochvil 425d099
	* gdb.arch/vsx-regs.exp: Likewise.
Jan Kratochvil 425d099
---
Jan Kratochvil 425d099
 gdb/testsuite/ChangeLog                        | 6 ++++++
Jan Kratochvil 425d099
 gdb/testsuite/gdb.arch/powerpc-prologue.exp    | 2 +-
Jan Kratochvil 425d099
 gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp | 4 ++--
Jan Kratochvil 425d099
 gdb/testsuite/gdb.arch/vsx-regs.exp            | 2 +-
Jan Kratochvil 425d099
 4 files changed, 10 insertions(+), 4 deletions(-)
Jan Kratochvil 425d099
Jan Kratochvil 425d099
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
Jan Kratochvil 425d099
index 9c7df29..b6ba0ec 100644
Jan Kratochvil 425d099
### a/gdb/testsuite/ChangeLog
Jan Kratochvil 425d099
### b/gdb/testsuite/ChangeLog
Jan Kratochvil 425d099
## -1,3 +1,9 @@
Jan Kratochvil 425d099
+2016-10-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil 425d099
+
Jan Kratochvil 425d099
+	* gdb.arch/powerpc-prologue.exp: Use standard_output_file
Jan Kratochvil 425d099
+	* gdb.arch/ppc64-symtab-cordic.exp: Likewise.
Jan Kratochvil 425d099
+	* gdb.arch/vsx-regs.exp: Likewise.
Jan Kratochvil 425d099
+
Jan Kratochvil 425d099
 2016-10-07  Yao Qi  <yao.qi@linaro.org>
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 	* gdb.xml/tdesc-regs.exp: Set regdir to "arm/".
Jan Kratochvil 425d099
diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-prologue.exp
Jan Kratochvil 425d099
index 341ae02..0c74d7e 100644
Jan Kratochvil 425d099
--- a/gdb/testsuite/gdb.arch/powerpc-prologue.exp
Jan Kratochvil 425d099
+++ b/gdb/testsuite/gdb.arch/powerpc-prologue.exp
Jan Kratochvil 425d099
@@ -24,7 +24,7 @@ if {[istarget *-*-aix*] || ![istarget "powerpc-*-*"]} then {
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 set testfile "powerpc-prologue"
Jan Kratochvil 425d099
 set srcfile ${testfile}.c
Jan Kratochvil 425d099
-set binfile ${objdir}/${subdir}/${testfile}
Jan Kratochvil 425d099
+set binfile [standard_output_file ${testfile}]
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 # Don't use "debug", so that we don't have line information for the assembly
Jan Kratochvil 425d099
 # fragments.
Jan Kratochvil 425d099
diff --git a/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp b/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp
Jan Kratochvil 425d099
index c8cb429..3fdc490 100644
Jan Kratochvil 425d099
--- a/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp
Jan Kratochvil 425d099
+++ b/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp
Jan Kratochvil 425d099
@@ -21,9 +21,9 @@ if {![istarget "powerpc*"] || ![is_lp64_target]} {
Jan Kratochvil 425d099
 standard_testfile
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 set kobz2file ${srcdir}/${subdir}/cordic.ko.bz2
Jan Kratochvil 425d099
-set kofile ${objdir}/${subdir}/cordic.ko
Jan Kratochvil 425d099
+set kofile [standard_output_file cordic.ko]
Jan Kratochvil 425d099
 set kodebugbz2file ${srcdir}/${subdir}/cordic.ko.debug.bz2
Jan Kratochvil 425d099
-set kodebugfile ${objdir}/${subdir}/cordic.ko.debug
Jan Kratochvil 425d099
+set kodebugfile [standard_output_file cordic.ko.debug]
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 if {[catch "system \"bzip2 -dc ${kobz2file} >${kofile}\""] != 0} {
Jan Kratochvil 425d099
     untested "failed bzip2 for ${kobz2file}"
Jan Kratochvil 425d099
diff --git a/gdb/testsuite/gdb.arch/vsx-regs.exp b/gdb/testsuite/gdb.arch/vsx-regs.exp
Jan Kratochvil 425d099
index 307f12a..31e58e6 100644
Jan Kratochvil 425d099
--- a/gdb/testsuite/gdb.arch/vsx-regs.exp
Jan Kratochvil 425d099
+++ b/gdb/testsuite/gdb.arch/vsx-regs.exp
Jan Kratochvil 425d099
@@ -152,7 +152,7 @@ for {set i 0} {$i < 32} {incr i 1} {
Jan Kratochvil 425d099
 # later when loading the core file (i.e., different register values for different
Jan Kratochvil 425d099
 # vector register banks).
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
-set corefile "${objdir}/${subdir}/vsx-core.test"
Jan Kratochvil 425d099
+set corefile [standard_output_file vsx-core.test]
Jan Kratochvil 425d099
 set core_supported [gdb_gcore_cmd "$corefile" "Save a VSX-enabled corefile"]
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 # Now run the F32~F63/VR0~VR31 tests.
Jan Kratochvil 425d099
-- 
Jan Kratochvil 425d099
2.7.4
Jan Kratochvil 425d099
Jan Kratochvil 425d099
Jan Kratochvil 425d099
http://sourceware.org/ml/gdb-patches/2016-10/msg00268.html
Jan Kratochvil 425d099
Subject: [testsuite obv] Fix gdb.arch/powerpc-prologue.c compilation
Jan Kratochvil 425d099
Jan Kratochvil 425d099
From: Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil 425d099
Date: Tue, 11 Oct 2016 19:09:05 +0200
Jan Kratochvil 425d099
Subject: [PATCH] testsuite: Fix gdb.arch/powerpc-prologue.c compilation
Jan Kratochvil 425d099
Subject: [PATCH] testsuite: Fix gdb.arch/powerpc-prologue.c compilation
Jan Kratochvil 425d099
Jan Kratochvil 425d099
gcc-6.2.1
Jan Kratochvil 425d099
Jan Kratochvil 425d099
gdb compile failed, gdb/testsuite/gdb.arch/powerpc-prologue.c: In function 'main':
Jan Kratochvil 425d099
gdb/testsuite/gdb.arch/powerpc-prologue.c:32:3: warning: implicit declaration of function 'optimized_1' [-Wimplicit-function-declaration]
Jan Kratochvil 425d099
   optimized_1 ();
Jan Kratochvil 425d099
   ^~~~~~~~~~~
Jan Kratochvil 425d099
Jan Kratochvil 425d099
gdb/testsuite/ChangeLog
Jan Kratochvil 425d099
2016-10-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil 425d099
Jan Kratochvil 425d099
	* gdb.arch/powerpc-prologue.c (optimized_1): New declaration.
Jan Kratochvil 425d099
---
Jan Kratochvil 425d099
 gdb/testsuite/ChangeLog                   | 4 ++++
Jan Kratochvil 425d099
 gdb/testsuite/gdb.arch/powerpc-prologue.c | 1 +
Jan Kratochvil 425d099
 2 files changed, 5 insertions(+)
Jan Kratochvil 425d099
Jan Kratochvil 425d099
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
Jan Kratochvil 425d099
index b6ba0ec..b4ccd4a 100644
Jan Kratochvil 425d099
### a/gdb/testsuite/ChangeLog
Jan Kratochvil 425d099
### b/gdb/testsuite/ChangeLog
Jan Kratochvil 425d099
## -1,5 +1,9 @@
Jan Kratochvil 425d099
 2016-10-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
+	* gdb.arch/powerpc-prologue.c (optimized_1): New declaration.
Jan Kratochvil 425d099
+
Jan Kratochvil 425d099
+2016-10-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil 425d099
+
Jan Kratochvil 425d099
 	* gdb.arch/powerpc-prologue.exp: Use standard_output_file
Jan Kratochvil 425d099
 	* gdb.arch/ppc64-symtab-cordic.exp: Likewise.
Jan Kratochvil 425d099
 	* gdb.arch/vsx-regs.exp: Likewise.
Jan Kratochvil 425d099
diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.c b/gdb/testsuite/gdb.arch/powerpc-prologue.c
Jan Kratochvil 425d099
index 6c10dfc..a1b8065 100644
Jan Kratochvil 425d099
--- a/gdb/testsuite/gdb.arch/powerpc-prologue.c
Jan Kratochvil 425d099
+++ b/gdb/testsuite/gdb.arch/powerpc-prologue.c
Jan Kratochvil 425d099
@@ -24,6 +24,7 @@
Jan Kratochvil 425d099
 #endif
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 void gdb2029 (void);
Jan Kratochvil 425d099
+void optimized_1 (void);
Jan Kratochvil 425d099
 
Jan Kratochvil 425d099
 int
Jan Kratochvil 425d099
 main (void)
Jan Kratochvil 425d099
-- 
Jan Kratochvil 425d099
2.7.4
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
http://sourceware.org/ml/gdb-patches/2016-10/msg00613.html
Jan Kratochvil 29d49d9
Subject: [testsuite patch] Fix gcc_compiled for gcc 6 & 7
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
--IS0zKkzwUGydFO0o
Jan Kratochvil 29d49d9
Content-Type: text/plain; charset=us-ascii
Jan Kratochvil 29d49d9
Content-Disposition: inline
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
Hi,
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
OK for check-in?
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
Jan
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
--IS0zKkzwUGydFO0o
Jan Kratochvil 29d49d9
Content-Type: text/plain; charset=us-ascii
Jan Kratochvil 29d49d9
Content-Disposition: inline; filename=1
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
gdb/testsuite/ChangeLog
Jan Kratochvil 29d49d9
2016-10-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
	* lib/gdb.exp (get_compiler_info): Generalize gcc_compile regexp.
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
Jan Kratochvil 29d49d9
index 378eea0..7d9b198 100644
Jan Kratochvil 29d49d9
--- a/gdb/testsuite/lib/gdb.exp
Jan Kratochvil 29d49d9
+++ b/gdb/testsuite/lib/gdb.exp
Jan Kratochvil 29d49d9
@@ -3290,12 +3290,8 @@ proc get_compiler_info {{arg ""}} {
Jan Kratochvil 29d49d9
     }
Jan Kratochvil 29d49d9
 
Jan Kratochvil 29d49d9
     # Set the legacy symbols.
Jan Kratochvil 29d49d9
-    set gcc_compiled     0
Jan Kratochvil 29d49d9
-    if { [regexp "^gcc-1-" "$compiler_info" ] } { set gcc_compiled 1 }
Jan Kratochvil 29d49d9
-    if { [regexp "^gcc-2-" "$compiler_info" ] } { set gcc_compiled 2 }
Jan Kratochvil 29d49d9
-    if { [regexp "^gcc-3-" "$compiler_info" ] } { set gcc_compiled 3 }
Jan Kratochvil 29d49d9
-    if { [regexp "^gcc-4-" "$compiler_info" ] } { set gcc_compiled 4 }
Jan Kratochvil 29d49d9
-    if { [regexp "^gcc-5-" "$compiler_info" ] } { set gcc_compiled 5 }
Jan Kratochvil 29d49d9
+    set gcc_compiled 0
Jan Kratochvil 29d49d9
+    regexp "^gcc-(\[0-9\]+)-" "$compiler_info" matchall gcc_compiled
Jan Kratochvil 29d49d9
 
Jan Kratochvil 29d49d9
     # Log what happened.
Jan Kratochvil 29d49d9
     verbose -log "get_compiler_info: $compiler_info"
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
--IS0zKkzwUGydFO0o--
Jan Kratochvil 29d49d9
Jan Kratochvil a06a12e
Jan Kratochvil a06a12e
Jan Kratochvil a06a12e
https://bugzilla.redhat.com/show_bug.cgi?id=1411094
Jan Kratochvil a06a12e
http://sourceware.org/ml/gdb-patches/2016-11/msg00076.html
Jan Kratochvil a06a12e
Subject: Re: [RFA 1/2] Fix some error-handling bugs in python frame filters
Jan Kratochvil a06a12e
Jan Kratochvil a06a12e
>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
Jan Kratochvil a06a12e
Jan Kratochvil a06a12e
Tom> I've included a test case for the first issue.
Jan Kratochvil a06a12e
Jan Kratochvil a06a12e
I did a -m32 build here and have fixed up the test case.
Jan Kratochvil a06a12e
Here's the new patch.  This is ready to review now.
Jan Kratochvil a06a12e
Jan Kratochvil a06a12e
Tom
Jan Kratochvil a06a12e
Jan Kratochvil a06a12e
commit 981628a4af5f82a12351b9764437927d3a8c8169
Jan Kratochvil a06a12e
Author: Tom Tromey <tom@tromey.com>
Jan Kratochvil a06a12e
Date:   Mon Oct 31 11:10:35 2016 -0600
Jan Kratochvil a06a12e
Jan Kratochvil a06a12e
    Fix some error-handling bugs in python frame filters
Jan Kratochvil a06a12e
    
Jan Kratochvil a06a12e
    While writing a Python frame filter, I found a few bugs in the current
Jan Kratochvil a06a12e
    frame filter code.  In particular:
Jan Kratochvil a06a12e
    
Jan Kratochvil a06a12e
    * One spot converts a Python long to a CORE_ADDR using PyLong_AsLong.
Jan Kratochvil a06a12e
      However, this can fail on overflow.  I changed this to use
Jan Kratochvil a06a12e
      get_addr_from_python.
Jan Kratochvil a06a12e
    
Jan Kratochvil a06a12e
    * Another spot is doing the same but with PyLong_AsUnsignedLongLong; I
Jan Kratochvil a06a12e
      changed this as well just for consistency.
Jan Kratochvil a06a12e
    
Jan Kratochvil a06a12e
    * Converting line numbers can print "-1" if conversion from long
Jan Kratochvil a06a12e
      fails.  This isn't fatal but just a bit ugly.
Jan Kratochvil a06a12e
    
Jan Kratochvil a06a12e
    I've included a test case for the first issue.  The line number one
Jan Kratochvil a06a12e
    didn't seem important enough to bother with.
Jan Kratochvil a06a12e
    
Jan Kratochvil a06a12e
    2016-10-31  Tom Tromey  <tom@tromey.com>
Jan Kratochvil a06a12e
    
Jan Kratochvil a06a12e
    	* python/py-framefilter.c (py_print_frame): Use
Jan Kratochvil a06a12e
    	get_addr_from_python.  Check for errors when getting line number.
Jan Kratochvil a06a12e
    
Jan Kratochvil a06a12e
    2016-10-31  Tom Tromey  <tom@tromey.com>
Jan Kratochvil a06a12e
    
Jan Kratochvil a06a12e
    	* gdb.python/py-framefilter.py (ElidingFrameDecorator.address):
Jan Kratochvil a06a12e
    	New method.
Jan Kratochvil a06a12e
Jan Kratochvil a06a12e
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
Jan Kratochvil a06a12e
index 1fd85ce..98fcd21 100644
Jan Kratochvil a06a12e
### a/gdb/ChangeLog
Jan Kratochvil a06a12e
### b/gdb/ChangeLog
Jan Kratochvil a06a12e
## -1,3 +1,8 @@
Jan Kratochvil a06a12e
+2016-10-31  Tom Tromey  <tom@tromey.com>
Jan Kratochvil a06a12e
+
Jan Kratochvil a06a12e
+	* python/py-framefilter.c (py_print_frame): Use
Jan Kratochvil a06a12e
+	get_addr_from_python.  Check for errors when getting line number.
Jan Kratochvil a06a12e
+
Jan Kratochvil a06a12e
 2016-11-03  Yao Qi  <yao.qi@linaro.org>
Jan Kratochvil a06a12e
 
Jan Kratochvil a06a12e
 	* Makefile.in (.y.c): Replace YY_NULL with YY_NULLPTR.
Jan Kratochvil a06a12e
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
Jan Kratochvil a06a12e
index 6692ac5..4c7757c 100644
Jan Kratochvil a06a12e
--- a/gdb/python/py-framefilter.c
Jan Kratochvil a06a12e
+++ b/gdb/python/py-framefilter.c
Jan Kratochvil a06a12e
@@ -1116,7 +1116,13 @@ py_print_frame (PyObject *filter, int flags,
Jan Kratochvil a06a12e
 
Jan Kratochvil a06a12e
 	  if (paddr != Py_None)
Jan Kratochvil a06a12e
 	    {
Jan Kratochvil a06a12e
-	      address = PyLong_AsLong (paddr);
Jan Kratochvil a06a12e
+	      if (get_addr_from_python (paddr, &address) < 0)
Jan Kratochvil a06a12e
+		{
Jan Kratochvil a06a12e
+		  Py_DECREF (paddr);
Jan Kratochvil a06a12e
+		  do_cleanups (cleanup_stack);
Jan Kratochvil a06a12e
+		  return EXT_LANG_BT_ERROR;
Jan Kratochvil a06a12e
+		}
Jan Kratochvil a06a12e
+
Jan Kratochvil a06a12e
 	      has_addr = 1;
Jan Kratochvil a06a12e
 	    }
Jan Kratochvil a06a12e
 	  Py_DECREF (paddr);
Jan Kratochvil a06a12e
@@ -1213,10 +1219,10 @@ py_print_frame (PyObject *filter, int flags,
Jan Kratochvil a06a12e
 	    }
Jan Kratochvil a06a12e
 	  else if (PyLong_Check (py_func))
Jan Kratochvil a06a12e
 	    {
Jan Kratochvil a06a12e
-	      CORE_ADDR addr = PyLong_AsUnsignedLongLong (py_func);
Jan Kratochvil a06a12e
+	      CORE_ADDR addr;
Jan Kratochvil a06a12e
 	      struct bound_minimal_symbol msymbol;
Jan Kratochvil a06a12e
 
Jan Kratochvil a06a12e
-	      if (PyErr_Occurred ())
Jan Kratochvil a06a12e
+	      if (get_addr_from_python (py_func, &addr) < 0)
Jan Kratochvil a06a12e
 		{
Jan Kratochvil a06a12e
 		  do_cleanups (cleanup_stack);
Jan Kratochvil a06a12e
 		  return EXT_LANG_BT_ERROR;
Jan Kratochvil a06a12e
@@ -1340,6 +1346,12 @@ py_print_frame (PyObject *filter, int flags,
Jan Kratochvil a06a12e
 	  if (py_line != Py_None)
Jan Kratochvil a06a12e
 	    {
Jan Kratochvil a06a12e
 	      line = PyLong_AsLong (py_line);
Jan Kratochvil a06a12e
+	      if (PyErr_Occurred ())
Jan Kratochvil a06a12e
+		{
Jan Kratochvil a06a12e
+		  do_cleanups (cleanup_stack);
Jan Kratochvil a06a12e
+		  return EXT_LANG_BT_ERROR;
Jan Kratochvil a06a12e
+		}
Jan Kratochvil a06a12e
+
Jan Kratochvil a06a12e
 	      TRY
Jan Kratochvil a06a12e
 		{
Jan Kratochvil a06a12e
 		  ui_out_text (out, ":");
Jan Kratochvil a06a12e
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
Jan Kratochvil a06a12e
index 52038e3..d8466f1 100644
Jan Kratochvil a06a12e
### a/gdb/testsuite/ChangeLog
Jan Kratochvil a06a12e
### b/gdb/testsuite/ChangeLog
Jan Kratochvil a06a12e
## -1,3 +1,8 @@
Jan Kratochvil a06a12e
+2016-10-31  Tom Tromey  <tom@tromey.com>
Jan Kratochvil a06a12e
+
Jan Kratochvil a06a12e
+	* gdb.python/py-framefilter.py (ElidingFrameDecorator.address):
Jan Kratochvil a06a12e
+	New method.
Jan Kratochvil a06a12e
+
Jan Kratochvil a06a12e
 2016-10-28  Pedro Alves  <palves@redhat.com>
Jan Kratochvil a06a12e
 
Jan Kratochvil a06a12e
 	* gdb.base/maint.exp <maint info line-table w/o a file name>: Use
Jan Kratochvil a06a12e
diff --git a/gdb/testsuite/gdb.python/py-framefilter.py b/gdb/testsuite/gdb.python/py-framefilter.py
Jan Kratochvil a06a12e
index 8fdff84..2580911 100644
Jan Kratochvil a06a12e
--- a/gdb/testsuite/gdb.python/py-framefilter.py
Jan Kratochvil a06a12e
+++ b/gdb/testsuite/gdb.python/py-framefilter.py
Jan Kratochvil a06a12e
@@ -92,6 +92,12 @@ class ElidingFrameDecorator(FrameDecorator):
Jan Kratochvil a06a12e
     def elided(self):
Jan Kratochvil a06a12e
         return iter(self.elided_frames)
Jan Kratochvil a06a12e
 
Jan Kratochvil a06a12e
+    def address (self):
Jan Kratochvil a06a12e
+        # Regression test for an overflow in the python layer.
Jan Kratochvil a06a12e
+        bitsize = 8 * gdb.lookup_type('void').pointer().sizeof
Jan Kratochvil a06a12e
+        mask = (1 << bitsize) - 1
Jan Kratochvil a06a12e
+        return 0xffffffffffffffff & mask
Jan Kratochvil a06a12e
+
Jan Kratochvil a06a12e
 class ElidingIterator:
Jan Kratochvil a06a12e
     def __init__(self, ii):
Jan Kratochvil a06a12e
         self.input_iterator = ii
Jan Kratochvil a06a12e