public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: adjust line number in commands.exp
@ 2013-10-07 14:55 Jose E. Marchesi
  2013-10-07 16:15 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Jose E. Marchesi @ 2013-10-07 14:55 UTC (permalink / raw)
  To: gdb-patches


Tested in both sparc64-*-linux-gnu and x86_64-*-linux-gnu.

2013-10-07  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* gdb.base/commands.exp (watchpoint_command_test): Adjust line
	number in run.c with the end of scope of the block containing
	local_var.


Index: testsuite/gdb.base/commands.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/commands.exp,v
retrieving revision 1.52
diff -u -r1.52 commands.exp
--- testsuite/gdb.base/commands.exp	27 Jun 2013 18:49:03 -0000	1.52
+++ testsuite/gdb.base/commands.exp	7 Oct 2013 14:50:22 -0000
@@ -315,7 +315,7 @@
 	    # scope.
 	    fail $test
 	}
-	-re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:(53|77).*$gdb_prompt $" {
+	-re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:(53|78).*$gdb_prompt $" {
 	    pass $test
 	}
    }

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] testsuite: adjust line number in commands.exp
  2013-10-07 14:55 [PATCH] testsuite: adjust line number in commands.exp Jose E. Marchesi
@ 2013-10-07 16:15 ` Pedro Alves
  2013-10-07 17:19   ` Jose E. Marchesi
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2013-10-07 16:15 UTC (permalink / raw)
  To: Jose E. Marchesi; +Cc: gdb-patches

On 10/07/2013 03:57 PM, Jose E. Marchesi wrote:
> 
> Tested in both sparc64-*-linux-gnu and x86_64-*-linux-gnu.
> 
> 2013-10-07  Jose E. Marchesi  <jose.marchesi@oracle.com>
> 
> 	* gdb.base/commands.exp (watchpoint_command_test): Adjust line
> 	number in run.c with the end of scope of the block containing
> 	local_var.

This is PR 15986.  Could you make this use gdb_get_line_number?

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] testsuite: adjust line number in commands.exp
  2013-10-07 16:15 ` Pedro Alves
@ 2013-10-07 17:19   ` Jose E. Marchesi
  2013-10-08 16:13     ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Jose E. Marchesi @ 2013-10-07 17:19 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches


    > Tested in both sparc64-*-linux-gnu and x86_64-*-linux-gnu.
    > 
    > 2013-10-07  Jose E. Marchesi  <jose.marchesi@oracle.com>
    > 
    > 	* gdb.base/commands.exp (watchpoint_command_test): Adjust line
    > 	number in run.c with the end of scope of the block containing
    > 	local_var.
    
    This is PR 15986.  Could you make this use gdb_get_line_number?

Something like this?  For future patches I will search the bugzilla
first :)

2013-10-07  Jose E. Marchesi  <jose.marchesi@oracle.com>

	PR gdb/15986    
	* gdb.base/run.c (main): gdb_get_line_number tag added for
	commands.exp.
	(factorial): Likewise.

	* gdb.base/commands.exp (watchpoint_command_test): Use
	gdb_get_line_number in order to determine the locations in run.c
	where local_var is detected to go out of scope.


Index: testsuite/gdb.base/commands.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/commands.exp,v
retrieving revision 1.52
diff -u -r1.52 commands.exp
--- testsuite/gdb.base/commands.exp	27 Jun 2013 18:49:03 -0000	1.52
+++ testsuite/gdb.base/commands.exp	7 Oct 2013 17:13:47 -0000
@@ -308,6 +308,8 @@
 	"end commands on watch"
 
     set test "continue with watch"
+    set lno_1 [gdb_get_line_number "commands.exp: hw local_var out of scope" "run.c"]
+    set lno_2 [gdb_get_line_number "commands.exp: local_var out of scope"    "run.c"]
     gdb_test_multiple "continue" "$test" {
 	-re "No symbol \"value\" in current context.\r\n$gdb_prompt $" {
 	    # Happens if GDB actually runs the watchpoints commands,
@@ -315,7 +317,7 @@
 	    # scope.
 	    fail $test
 	}
-	-re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:(53|77).*$gdb_prompt $" {
+	-re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:($lno_1|$lno_2).*$gdb_prompt $" {
 	    pass $test
 	}
    }
Index: testsuite/gdb.base/run.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/run.c,v
retrieving revision 1.2
diff -u -r1.2 run.c
--- testsuite/gdb.base/run.c	13 Dec 2011 17:22:08 -0000	1.2
+++ testsuite/gdb.base/run.c	7 Oct 2013 17:13:47 -0000
@@ -50,7 +50,7 @@
 #endif
 {
 #ifdef FAKEARGV
-    printf ("%d\n", factorial (1));
+    printf ("%d\n", factorial (1)); /* commands.exp: hw local_var out of scope */
 #else    
     if (argc != 2) {
 	printf ("usage:  factorial <number>\n");
@@ -75,4 +75,4 @@
     }
     local_var = value;
     return (value);
-}
+} /* commands.exp: local_var out of scope  */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] testsuite: adjust line number in commands.exp
  2013-10-07 17:19   ` Jose E. Marchesi
@ 2013-10-08 16:13     ` Pedro Alves
  2013-10-21 12:43       ` Jose E. Marchesi
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2013-10-08 16:13 UTC (permalink / raw)
  To: Jose E. Marchesi; +Cc: gdb-patches

On 10/07/2013 06:20 PM, Jose E. Marchesi wrote:
> 
>     > Tested in both sparc64-*-linux-gnu and x86_64-*-linux-gnu.
>     > 
>     > 2013-10-07  Jose E. Marchesi  <jose.marchesi@oracle.com>
>     > 
>     > 	* gdb.base/commands.exp (watchpoint_command_test): Adjust line
>     > 	number in run.c with the end of scope of the block containing
>     > 	local_var.
>     
>     This is PR 15986.  Could you make this use gdb_get_line_number?
> 
> Something like this?  

Yes.  This is OK, thanks.

For future patches I will search the bugzilla first :)

:-)

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] testsuite: adjust line number in commands.exp
  2013-10-08 16:13     ` Pedro Alves
@ 2013-10-21 12:43       ` Jose E. Marchesi
  0 siblings, 0 replies; 5+ messages in thread
From: Jose E. Marchesi @ 2013-10-21 12:43 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches


    On 10/07/2013 06:20 PM, Jose E. Marchesi wrote:
    > 
    >     > Tested in both sparc64-*-linux-gnu and x86_64-*-linux-gnu.
    >     > 
    >     > 2013-10-07  Jose E. Marchesi  <jose.marchesi@oracle.com>
    >     > 
    >     > 	* gdb.base/commands.exp (watchpoint_command_test): Adjust line
    >     > 	number in run.c with the end of scope of the block containing
    >     > 	local_var.
    >     
    >     This is PR 15986.  Could you make this use gdb_get_line_number?
    > 
    > Something like this?  
    
    Yes.  This is OK, thanks.
    
Committed as posted in
http://sourceware.org/ml/gdb-patches/2013-10/msg00193.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-21 12:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-07 14:55 [PATCH] testsuite: adjust line number in commands.exp Jose E. Marchesi
2013-10-07 16:15 ` Pedro Alves
2013-10-07 17:19   ` Jose E. Marchesi
2013-10-08 16:13     ` Pedro Alves
2013-10-21 12:43       ` Jose E. Marchesi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).