[01/16] Eliminate literal line numbers in so-impl-ld.exp

Message ID 1414598446-13831-1-git-send-email-arnez@linux.vnet.ibm.com
State New, archived
Headers

Commit Message

Andreas Arnez Oct. 29, 2014, 4 p.m. UTC
  Remove literal line numbers from the regexps in so-impl-ld.exp.  Add
appropriate eye-catchers to solib1.c and refer to those instead.

gdb/testsuite/ChangeLog:

	* gdb.base/solib1.c: Add eye-catchers.
	* gdb.base/so-impl-ld.exp: Match against eye-catchers instead of
	literal line numbers.
---
 gdb/testsuite/gdb.base/so-impl-ld.exp | 4 ++--
 gdb/testsuite/gdb.base/solib1.c       | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
  

Comments

Sergio Durigan Junior Oct. 29, 2014, 4:22 p.m. UTC | #1
On Wednesday, October 29 2014, Andreas Arnez wrote:

> Remove literal line numbers from the regexps in so-impl-ld.exp.  Add
> appropriate eye-catchers to solib1.c and refer to those instead.

Hey Andreas,

Thanks a lot for doing this, much appreciated.

> gdb/testsuite/ChangeLog:
>
> 	* gdb.base/solib1.c: Add eye-catchers.
> 	* gdb.base/so-impl-ld.exp: Match against eye-catchers instead of
> 	literal line numbers.
> ---
>  gdb/testsuite/gdb.base/so-impl-ld.exp | 4 ++--
>  gdb/testsuite/gdb.base/solib1.c       | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp
> index 073c3df..03d10a5 100644
> --- a/gdb/testsuite/gdb.base/so-impl-ld.exp
> +++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
> @@ -61,12 +61,12 @@ gdb_test "next" "21\[ \t\]*result = solib_main .result.;" \
>  
>  # Verify that we can step into the second shlib call.
>  #
> -gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:17.*" \
> +gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:.* HERE .*" \
>      "step into solib call"

Can't you use ${decimal} here, instead of expecting anything?

>  # Verify that we can step within the shlib call.
>  #
> -gdb_test "next" "18\[ \t\]*\}" "step in solib call"
> +gdb_test "next" "\[0-9\]+\[ \t\]*\}.* STEP .*" "step in solib call"

Same here: ${decimal} is made to replace this \[0-9\]+.

>  
>  # Verify that we can step out of the shlib call, and back out into
>  # the caller.
> diff --git a/gdb/testsuite/gdb.base/solib1.c b/gdb/testsuite/gdb.base/solib1.c
> index 2e51750..224a93d 100644
> --- a/gdb/testsuite/gdb.base/solib1.c
> +++ b/gdb/testsuite/gdb.base/solib1.c
> @@ -14,5 +14,5 @@ int  solib_main (arg)
>  #endif
>  #endif
>  {
> -  return arg*arg;
> -}
> +  return arg*arg;		/* HERE */
> +}				/* STEP */
> -- 
> 1.8.4.2

Otherwise, it looks good to me (not an approval).
  
Yao Qi Nov. 13, 2014, 1:15 p.m. UTC | #2
Andreas Arnez <arnez@linux.vnet.ibm.com> writes:

> gdb/testsuite/ChangeLog:
>
> 	* gdb.base/solib1.c: Add eye-catchers.
> 	* gdb.base/so-impl-ld.exp: Match against eye-catchers instead of
> 	literal line numbers.

It looks good to me.
  

Patch

diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp
index 073c3df..03d10a5 100644
--- a/gdb/testsuite/gdb.base/so-impl-ld.exp
+++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
@@ -61,12 +61,12 @@  gdb_test "next" "21\[ \t\]*result = solib_main .result.;" \
 
 # Verify that we can step into the second shlib call.
 #
-gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:17.*" \
+gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:.* HERE .*" \
     "step into solib call"
 
 # Verify that we can step within the shlib call.
 #
-gdb_test "next" "18\[ \t\]*\}" "step in solib call"
+gdb_test "next" "\[0-9\]+\[ \t\]*\}.* STEP .*" "step in solib call"
 
 # Verify that we can step out of the shlib call, and back out into
 # the caller.
diff --git a/gdb/testsuite/gdb.base/solib1.c b/gdb/testsuite/gdb.base/solib1.c
index 2e51750..224a93d 100644
--- a/gdb/testsuite/gdb.base/solib1.c
+++ b/gdb/testsuite/gdb.base/solib1.c
@@ -14,5 +14,5 @@  int  solib_main (arg)
 #endif
 #endif
 {
-  return arg*arg;
-}
+  return arg*arg;		/* HERE */
+}				/* STEP */