public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix for PR15117
@ 2013-07-30 16:55 ali_anwar
  2013-07-30 18:56 ` Keith Seitz
  0 siblings, 1 reply; 10+ messages in thread
From: ali_anwar @ 2013-07-30 16:55 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 128 bytes --]

Hi,

Attached patch fixes PR15117. I did regression testing be executing 
gdb.base/* tests.

Kindly review it.

Regards,
-Ali



[-- Attachment #2: PR15117.patch --]
[-- Type: text/x-patch, Size: 2705 bytes --]

Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.15798
diff -u -r1.15798 ChangeLog
--- gdb/ChangeLog	15 Jul 2013 11:14:32 -0000	1.15798
+++ gdb/ChangeLog	30 Jul 2013 16:35:10 -0000
@@ -1,3 +1,9 @@
+2013-07-30 Ali Anwar  <ali_anwar@codesourcery.com>
+
+	PR breakpoints/15117
+	* linespec.c (linespec_parse_basic): Check for convenience
+	variable or history value while parsing.
+
 2013-07-15  Ali Anwar  <ali_anwar@codesourcery.com>
 
 	PR threads/13217
Index: gdb/linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.185
diff -u -r1.185 linespec.c
--- gdb/linespec.c	30 May 2013 16:57:38 -0000	1.185
+++ gdb/linespec.c	30 Jul 2013 16:33:43 -0000
@@ -1660,6 +1660,17 @@
 	  symbols = NULL;
 	  discard_cleanups (cleanup);
 	}
+      else if (token.type == LSTOKEN_STRING && *LS_TOKEN_STOKEN (token).ptr == '$')
+	{
+	  char *var;
+
+	  /* User specified a convenience variable or history value.  */
+	  var = copy_token_string (token);
+	  cleanup = make_cleanup (xfree, var);
+	  PARSER_RESULT (parser)->line_offset
+	    = linespec_parse_variable (PARSER_STATE (parser), var);
+	  do_cleanups (cleanup);
+	}
       else
 	{
 	  /* The name is also not a label.  Abort parsing.  Do not throw
Index: gdb/testsuite/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v
retrieving revision 1.3727
diff -u -r1.3727 ChangeLog
--- gdb/testsuite/ChangeLog	10 Jul 2013 00:10:36 -0000	1.3727
+++ gdb/testsuite/ChangeLog	30 Jul 2013 16:29:01 -0000
@@ -1,3 +1,7 @@
+2013-07-30  Ali Anwar  <alianwar@codesourcery.com>
+
+	* gdb.base/break.exp: Test break via convenience variable.
+
 2013-07-09  Joel Brobecker  <brobecker@adacore.com>
Index: gdb/testsuite/gdb.base/break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v
retrieving revision 1.58
diff -u -r1.58 break.exp
--- gdb/testsuite/gdb.base/break.exp	7 Jun 2013 17:31:07 -0000	1.58
+++ gdb/testsuite/gdb.base/break.exp	30 Jul 2013 16:29:01 -0000
@@ -957,6 +957,18 @@
     }
 }
 
+#
+# test break via convenience variable
+#
+send_gdb "set \$l = 92\n"
+gdb_expect {
+     -re ".*$gdb_prompt $"       { pass "Set convenience variable" }
+    timeout                 { fail "Set convenience variable (timeout)" }
+}
+
+gdb_test "break $srcfile:\$l" \
+    "Breakpoint.*at.* file .*$srcfile, line 92." \
+    "breakpoint convenience variable"
 
 # Reset the default arguments for VxWorks
 if [istarget "*-*-vxworks*"] {

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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-30 16:55 [PATCH] Fix for PR15117 ali_anwar
2013-07-30 18:56 ` Keith Seitz
2013-08-02 12:14   ` ali_anwar
2013-08-02 17:49     ` Keith Seitz
2013-08-06 19:51       ` ali_anwar
2013-08-07  5:42       ` ali_anwar
2013-08-07 20:01         ` Tom Tromey
2013-08-08 14:56           ` Pedro Alves
2013-08-08 20:05             ` Tom Tromey
2013-08-12 12:12           ` ali_anwar

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).