]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Compile gdb.perf/skip-prologue.c with and without debug info
authorYao Qi <yao.qi@linaro.org>
Fri, 9 Dec 2016 09:51:20 +0000 (09:51 +0000)
committerYao Qi <yao.qi@linaro.org>
Fri, 9 Dec 2016 09:51:20 +0000 (09:51 +0000)
gdb.perf/skip-prologue.exp is intended to measure the performance of
skipping prologue with prologue analysis by setting breakpoints.
However, if program is compiled with debug info, GDB is smart to
skip prologue by line table from debug info, so prologue analysis
is not exercised at all.

This patch adds a parameter COMPILE to specify compiling with
debug information, otherwise, it is compiled without debug
information.

gdb/testsuite:

2016-12-09  Yao Qi  <yao.qi@linaro.org>

* gdb.perf/skip-prologue.exp: Add parameter COMPILE.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.perf/skip-prologue.exp

index e63f2b79e6d3e015ded499d1147780f3101a3198..d905df3b268cc1ad78d89157c479136122697442 100644 (file)
@@ -1,3 +1,7 @@
+2016-12-09  Yao Qi  <yao.qi@linaro.org>
+
+       * gdb.perf/skip-prologue.exp: Add parameter COMPILE.
+
 2016-12-02  Luis Machado  <lgustavo@codesourcery.com>
 
        * gdb.base/maint.exp: Use gdb_test instead of gdb_test_multiple when
index 2c4aad47aa38d353b1657402c8f1e6bf711ee02c..f31f697fa89f3e86340bc50c9d12f52064577c31 100644 (file)
@@ -37,7 +37,14 @@ if ![info exists SKIP_PROLOGUE_COUNT] {
 PerfTest::assemble {
     global srcdir subdir srcfile binfile
 
-    if { [gdb_compile "$srcdir/$subdir/$srcfile" ${binfile} executable {debug}] != "" } {
+    if [info exists COMPILE] {
+       set opts {debug}
+    } else {
+       set opts {nodebug}
+    }
+
+    if { [gdb_compile "$srcdir/$subdir/$srcfile" ${binfile} executable $opts] != "" } {
+       untested "failed to compile"
        return -1
     }