public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: jose.marchesi@oracle.com (Jose E. Marchesi)
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] testsuite: adjust line number in commands.exp
Date: Mon, 07 Oct 2013 17:19:00 -0000	[thread overview]
Message-ID: <87zjqlknes.fsf@oracle.com> (raw)
In-Reply-To: <5252DE0D.4060106@redhat.com> (Pedro Alves's message of "Mon, 07	Oct 2013 17:15:09 +0100")


    > 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  */

  reply	other threads:[~2013-10-07 17:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-07 14:55 Jose E. Marchesi
2013-10-07 16:15 ` Pedro Alves
2013-10-07 17:19   ` Jose E. Marchesi [this message]
2013-10-08 16:13     ` Pedro Alves
2013-10-21 12:43       ` Jose E. Marchesi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zjqlknes.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).