From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4220 invoked by alias); 9 Mar 2008 00:12:53 -0000 Received: (qmail 4192 invoked by uid 22791); 9 Mar 2008 00:12:41 -0000 X-Spam-Check-By: sourceware.org Received: from qnxmail.qnx.com (HELO qnxmail.qnx.com) (209.226.137.76) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 09 Mar 2008 00:12:17 +0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.42.96.5]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id SAA32126; Sat, 8 Mar 2008 18:54:00 -0500 Received: from [192.168.20.204] (pptp_vpn-20-204 [192.168.20.204]) by smtp.ott.qnx.com (8.8.8/8.6.12) with ESMTP id TAA20662; Sat, 8 Mar 2008 19:12:09 -0500 Message-ID: <47D32B57.5020203@qnx.com> Date: Sun, 09 Mar 2008 00:12:00 -0000 From: Aleksandar Ristovski User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Vladimir Prus CC: gdb-patches@sources.redhat.com, nickrob@snap.net.nz Subject: Re: [patch] fix for PR2424 References: <47CED9FB.7090904@qnx.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------080208020005010008010504" 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: 2008-03/txt/msg00076.txt.bz2 This is a multi-part message in MIME format. --------------080208020005010008010504 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1395 Vladimir Prus wrote: > FWIW, you don't say what function in mi-support.exp is changed, > and it would be better if your patch was generated with -u (unified diff, > 3 lines of context) -- the current one has no context at all, so I > can only guess which function that is. Please find attached new diffs. > > Speaking of the problem itself -- in PR2424 you say: > > When inferior stops at temporary breakpoint, message is: > *stopped,thread-id="0",....... > without mentioning "reason=breakpoint-hit" > This causes issues for multithreaded programs. > > What issues does it cause for MT programs? When inferior hits a temporary breakpoint, due to breakpoint removal the reason for stop is "lost in translation". This leaves user guessing what the reason for stop was. This is applicable to both single and multi threaded inferiors, but gets more annoying when multiple threads exist since then client program (in my case IDE - CDT) can not figure out which thread caused the stop in addition to not knowing the reason (I am not working on CDT but I was explained that missing "reason" is to blame, and after the patch I proposed I was told things now work as expected). @Nick: I think the breakpoint should be reported. The fact that it is temporary doesn't make it much different than a regular breakpoint... but maybe I'm missing something. --------------080208020005010008010504 Content-Type: text/plain; name="PR2424test.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="PR2424test.diff" Content-length: 896 Index: gdb/testsuite/lib/mi-support.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v retrieving revision 1.51 diff -u -p -r1.51 mi-support.exp --- gdb/testsuite/lib/mi-support.exp 29 Jan 2008 19:36:58 -0000 1.51 +++ gdb/testsuite/lib/mi-support.exp 9 Mar 2008 00:03:39 -0000 @@ -890,7 +890,7 @@ proc mi_runto_helper {func run_or_contin } gdb_expect { - -re ".*000\\*stopped,thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { + -re ".*000\\*stopped,reason=.*thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { pass "$test" return 0 } --------------080208020005010008010504 Content-Type: text/plain; name="PR2424infrun.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="PR2424infrun.c.diff" Content-length: 1007 Index: gdb/infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.266 diff -u -p -r1.266 infrun.c --- gdb/infrun.c 29 Jan 2008 22:47:19 -0000 1.266 +++ gdb/infrun.c 9 Mar 2008 00:04:36 -0000 @@ -3151,11 +3151,6 @@ Further execution is probably impossible } } - /* Delete the breakpoint we stopped at, if it wants to be deleted. - Delete any breakpoint that is to be deleted at the next stop. */ - - breakpoint_auto_delete (stop_bpstat); - /* If an auto-display called a function and that got a signal, delete that auto-display to avoid an infinite recursion. */ @@ -3292,6 +3287,9 @@ Further execution is probably impossible } done: + /* Delete the breakpoint we stopped at, if it wants to be deleted. + Delete any breakpoint that is to be deleted at the next stop. */ + breakpoint_auto_delete (stop_bpstat); annotate_stopped (); observer_notify_normal_stop (stop_bpstat); } --------------080208020005010008010504--