From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13780 invoked by alias); 10 Mar 2008 14:29:30 -0000 Received: (qmail 13769 invoked by uid 22791); 10 Mar 2008 14:29:29 -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; Mon, 10 Mar 2008 14:29:12 +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 KAA13506; Mon, 10 Mar 2008 10:10:41 -0400 Received: from [10.42.100.129] (dhcp-100-129 [10.42.100.129]) by smtp.ott.qnx.com (8.8.8/8.6.12) with ESMTP id JAA27581; Mon, 10 Mar 2008 09:29:05 -0500 Message-ID: <47D545B1.2000609@qnx.com> Date: Mon, 10 Mar 2008 14:29: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> <47D32B57.5020203@qnx.com> <200803101111.13222.vladimir@codesourcery.com> In-Reply-To: <200803101111.13222.vladimir@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit 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/msg00098.txt.bz2 Vladimir Prus wrote: > The GDB output you have provided above actually includes thread id, so what problem > does CDT have with figuring thread? In fact, CDT4's RxThread.java has the following: > > // We were stopped for some unknown reason, for example > // GDB for temporary breakpoints will not send the > // "reason" ??? still fire a stopped event. > if (list.isEmpty()) { > if (session.getMIInferior().isRunning()) { > session.getMIInferior().setSuspended(); > MIEvent event = new MIStoppedEvent(session, rr); > session.fireEvent(event); > } > } > >> 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). > > So, could it be a CDT issue, after all? I believe the problem is that all threads will be reported as suspended, but there is no distinction between the thread that hit the breakpoint and other threads suspended due to stop. Normally, ide will show something like (Breakpoint-hit) beside "Suspended" next to thread number that hit the breakpoint. But I will double check with people working on CDT. > >> @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. > > Independent of actually CDT issue, I still think accurately reporting stop reason > would be good. Can we probably look at breakpoints 'disp' field and either > print "Breakpoint" or "Temporary breakpoint", and likewise either "breakpoint-hit" or > "temporary-breakpoint-hit", in breakpoint.c:print_it_typical? I made the changes, it is not a problem. I have, however, made two versions. The first as suggested by Vladimir, the second slightly different but with the same goal. ------------- version 1 ------------------- CLI: (gdb) tbreak main Temporary breakpoint 1 at 0x80483a0: file ./main.c, line 15. (gdb) r Starting program: /space/src/testcases/sigsegv/main Temporary breakpoint 1, main () at ./main.c:15 15 foo (p); MI: (gdb) -break-insert -t main ^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x080483a0",func="main",file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15",times="0"} (gdb) -exec-run ^running (gdb) *stopped,reason="temporary-breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080483a0",func="main",args=[],file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15"} --------------------------------------------- But now that I am sifting through testcases to replace all "Breakpoint..." with "Temporary breakpoint..." I am thinking: we need to communicate to the user that the breakpoint is of temporary nature, but should not introduce new "look" or type for the temporary breakpoint. The same applies for the reason, it should still be "breakpoint-hit". This is particularly true for MI. How about this output: -------------------- version 2 ----------------------- CLI: (gdb) tbreak main Breakpoint (temp.) 1 at 0x80483a0: file ./main.c, line 15. (gdb) r Starting program: /space/src/testcases/sigsegv/main Breakpoint (temp.) 1, main () at ./main.c:15 15 foo (p); MI: (gdb) -break-insert -t main ^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x080483a0",func="main",file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15",times="0"} (gdb) -exec-run ^running (gdb) *stopped,reason="breakpoint-hit",disp="del",bkptno="1",thread-id="0",frame={addr="0x080483a0",func="main",args=[],file="./main.c",fullname="/space/src/testcases/sigsegv/main.c",line="15"} --------------------------------------------------------- I think the second version would introduce less impact to existing frontends while clarifying the output in a more consistent way. Thoughts?