Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: gdb-patches ml <gdb-patches@sourceware.org>
Subject: [patch][branch] Fix saving -location watchpoints.
Date: Fri, 08 Apr 2011 20:47:00 -0000	[thread overview]
Message-ID: <1302295653.2074.15.camel@hactar> (raw)

Hi,

watch_command_1 sets b->exp_string to "-location: foobar". When saving
breakpoints to a file, save_breakpoints will use b->exp_string to
construct a command line for recreating the watchpoint, and comes up
with the invalid command "watch -location: foobar". This patch simply
removes the colon from exp_string.

No regressions on i386-linux. Ok for HEAD and the branch?
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


2011-04-08  Thiago Jung Bauermann  <bauerman@br.ibm.com>

gdb/
	* breakpoint.c (watch_command_1): Remove colon from exp_string.

gdb/testsuite/
	* gdb.base/watchpoint.exp (test_inaccessible_watchpoint): Don't
	expect a colon in watch -location output.

Index: gdb.git/gdb/breakpoint.c
===================================================================
--- gdb.git.orig/gdb/breakpoint.c	2011-04-08 16:09:31.000000000 -0300
+++ gdb.git/gdb/breakpoint.c	2011-04-08 16:23:24.000000000 -0300
@@ -9019,7 +9019,7 @@ watch_command_1 (char *arg, int accessfl
 					  core_addr_to_string (addr));
       xfree (name);
 
-      b->exp_string = xstrprintf ("-location: %.*s",
+      b->exp_string = xstrprintf ("-location %.*s",
 				  (int) (exp_end - exp_start), exp_start);
 
       /* The above expression is in C.  */
Index: gdb.git/gdb/testsuite/gdb.base/watchpoint.exp
===================================================================
--- gdb.git.orig/gdb/testsuite/gdb.base/watchpoint.exp	2011-04-08 16:45:08.000000000 -0300
+++ gdb.git/gdb/testsuite/gdb.base/watchpoint.exp	2011-04-08 16:45:11.000000000 -0300
@@ -685,7 +685,7 @@ proc test_inaccessible_watchpoint {} {
 
 	# The same, but using -location through an indirection.
 	gdb_test "watch -location *global_ptr" \
-	    "$watchpoint_msg \[0-9\]+: \-location: \\*global_ptr"
+	    "$watchpoint_msg \[0-9\]+: \-location \\*global_ptr"
 	delete_breakpoints
 
 	# This step requires two HW watchpoints.  Since some platforms only



             reply	other threads:[~2011-04-08 20:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-08 20:47 Thiago Jung Bauermann [this message]
2011-04-12 11:06 ` Pedro Alves
2011-04-13 18:34   ` Thiago Jung Bauermann
2011-04-14 11:52     ` Joel Brobecker
2011-04-15  4:20       ` Thiago Jung Bauermann

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=1302295653.2074.15.camel@hactar \
    --to=bauerman@br.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /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