From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29214 invoked by alias); 8 Apr 2011 20:47:44 -0000 Received: (qmail 29203 invoked by uid 22791); 8 Apr 2011 20:47:43 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e7.ny.us.ibm.com (HELO e7.ny.us.ibm.com) (32.97.182.137) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Apr 2011 20:47:39 +0000 Received: from d01dlp02.pok.ibm.com (d01dlp02.pok.ibm.com [9.56.224.85]) by e7.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p38KPpAK018204 for ; Fri, 8 Apr 2011 16:25:51 -0400 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 863376E8039 for ; Fri, 8 Apr 2011 16:47:38 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p38Klbnt2732106 for ; Fri, 8 Apr 2011 16:47:37 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p38Klb8U021542 for ; Fri, 8 Apr 2011 17:47:37 -0300 Received: from [9.12.224.19] ([9.12.224.19]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p38Klaec021514 for ; Fri, 8 Apr 2011 17:47:36 -0300 Subject: [patch][branch] Fix saving -location watchpoints. From: Thiago Jung Bauermann To: gdb-patches ml Content-Type: text/plain; charset="UTF-8" Date: Fri, 08 Apr 2011 20:47:00 -0000 Message-ID: <1302295653.2074.15.camel@hactar> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Content-Scanned: Fidelis XPS MAILER X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-04/txt/msg00130.txt.bz2 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 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