[1/3] Compile gdb.perf/skip-prologue.c with and without debug info

Message ID 1481036629-21542-2-git-send-email-yao.qi@linaro.org
State New, archived
Headers

Commit Message

Yao Qi Dec. 6, 2016, 3:03 p.m. UTC
  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-06  Yao Qi  <yao.qi@linaro.org>

	* gdb.perf/skip-prologue.exp: Add parameter COMPILE.
---
 gdb/testsuite/gdb.perf/skip-prologue.exp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
  

Comments

Luis Machado Dec. 7, 2016, 6:24 p.m. UTC | #1
On 12/06/2016 09:03 AM, Yao Qi wrote:
> 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-06  Yao Qi  <yao.qi@linaro.org>
>
> 	* gdb.perf/skip-prologue.exp: Add parameter COMPILE.
> ---
>  gdb/testsuite/gdb.perf/skip-prologue.exp | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/testsuite/gdb.perf/skip-prologue.exp b/gdb/testsuite/gdb.perf/skip-prologue.exp
> index 2c4aad4..a24fd73 100644
> --- a/gdb/testsuite/gdb.perf/skip-prologue.exp
> +++ b/gdb/testsuite/gdb.perf/skip-prologue.exp
> @@ -37,7 +37,13 @@ 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] != "" } {


Maybe add an untested call here saying "failed to compile"? Just a nit.
  

Patch

diff --git a/gdb/testsuite/gdb.perf/skip-prologue.exp b/gdb/testsuite/gdb.perf/skip-prologue.exp
index 2c4aad4..a24fd73 100644
--- a/gdb/testsuite/gdb.perf/skip-prologue.exp
+++ b/gdb/testsuite/gdb.perf/skip-prologue.exp
@@ -37,7 +37,13 @@  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] != "" } {
 	return -1
     }