gdb/gdb-upstream.patch
2016-10-07 23:19:55 +02:00

115 lines
4.0 KiB
Diff

commit 2c29df25b7c2ff006b45afd80ee6dd734ebbd47c
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Sun Sep 11 16:53:09 2016 -0400
Fix false FAIL on gdb.base/stap-probe.exp, due to ICF optimization
GCC 6's ICF optimization pass is making the declaration of 'm1' and
'm2', on gdb.base/stap-probe.c, to be unified. However, this leads to
only one instance of the probe 'two' being created, which causes a
failure on the testsuite (which expects a multi-location breakpoint to
be inserted on the probe).
This patch fixes this failure by declaring a dummy variable on 'm1',
and using it as an argument to m1's version of probe 'two'. Since we
do not care about the contents of the functions nor about the
arguments of each probe 'two', this is OK.
gdb/testsuite/ChangeLog:
2016-09-11 Sergio Durigan Junior <sergiodj@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/stap-probe.c (m1): New variable 'dummy', necessary to
make m1's definition to be different from m2's. Use 'dummy' as an
argument for probe 'two'.
### a/gdb/testsuite/ChangeLog
### b/gdb/testsuite/ChangeLog
## -1,3 +1,10 @@
+2016-09-11 Sergio Durigan Junior <sergiodj@redhat.com>
+ Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.base/stap-probe.c (m1): New variable 'dummy', necessary to
+ make m1's definition to be different from m2's. Use 'dummy' as an
+ argument for probe 'two'.
+
2016-09-10 Jon Beniston <jon@beniston.com>
* lib/mi-support.exp (mi_gdb_target_load): Use target_sim_options
--- a/gdb/testsuite/gdb.base/stap-probe.c
+++ b/gdb/testsuite/gdb.base/stap-probe.c
@@ -53,8 +53,13 @@ struct funcs
static void
m1 (void)
{
+ /* m1 and m2 are equivalent, but because of some compiler
+ optimizations we have to make each of them unique. This is why
+ we have this dummy variable here. */
+ volatile int dummy = 0;
+
if (TEST2)
- STAP_PROBE (test, two);
+ STAP_PROBE1 (test, two, dummy);
}
static void
commit f389f6fef76d7cf8e8beb7061edff2155c284898
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Wed Oct 5 21:56:46 2016 +0200
testsuite: Fix recent GCC FAIL: gdb.arch/i386-signal.exp
gcc-6.2.1-2.fc24.x86_64
(gdb) backtrace 10^M
(gdb) FAIL: gdb.arch/i386-signal.exp: backtrace 10
(gdb) disas/s
Dump of assembler code for function main:
.../gdb/testsuite/gdb.arch/i386-signal.c:
30 {
0x000000000040057f <+0>: push %rbp
0x0000000000400580 <+1>: mov %rsp,%rbp
31 setup ();
0x0000000000400583 <+4>: callq 0x400590 <setup>
=> 0x0000000000400588 <+9>: mov $0x0,%eax
32 }
0x000000000040058d <+14>: pop %rbp
0x000000000040058e <+15>: retq
End of assembler dump.
The .exp patch is an obvious typo fix I think. The regex was written to
accept "ADDR in main" and I find it OK as checking .debug_line validity is not
the purpose of this testfile.
gcc-4.8.5-11.el7.x86_64 did not put the 'mov $0x0,%eax' instruction there at
all so there was no problem with .debug_line.
gdb/testsuite/ChangeLog
2016-10-05 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/i386-signal.exp (backtrace 10): Fix #2 typo.
### a/gdb/testsuite/ChangeLog
### b/gdb/testsuite/ChangeLog
## -1,3 +1,7 @@
+2016-10-05 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.arch/i386-signal.exp (backtrace 10): Fix #2 typo.
+
2016-10-05 Yao Qi <yao.qi@linaro.org>
* lib/gdb.exp (support_complex_tests): Return zero if
--- a/gdb/testsuite/gdb.arch/i386-signal.exp
+++ b/gdb/testsuite/gdb.arch/i386-signal.exp
@@ -35,6 +35,6 @@ gdb_load ${binfile}
runto func
gdb_test "backtrace 10" \
- "#0 ($hex in )?func.*\r\n#1 <signal handler called>\r\n#2 ($hex in)?main.*"
+ "#0 ($hex in )?func.*\r\n#1 <signal handler called>\r\n#2 ($hex in )?main.*"
gdb_test "finish" "Run till exit from \#0 func.*<signal handler called>"