From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31172 invoked by alias); 1 Mar 2012 18:26:59 -0000 Received: (qmail 31107 invoked by uid 22791); 1 Mar 2012 18:26:58 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Mar 2012 18:26:41 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q21IQViU027543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Mar 2012 13:26:37 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q21HXjbo024589; Thu, 1 Mar 2012 12:33:46 -0500 Message-ID: <4F4FB2F9.80200@redhat.com> Date: Thu, 01 Mar 2012 18:26:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 MIME-Version: 1.0 To: Hui Zhu CC: Pedro Alves , gdb-patches@sourceware.org, Yao Qi Subject: Re: Fix error when gdb connect to a stub that tracepoint is running[1/2] Add a flag initialized to struct trace_status References: <4F4F8BE2.7030503@mentor.com> In-Reply-To: <4F4F8BE2.7030503@mentor.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2012-03/txt/msg00026.txt.bz2 Hi Hui, Yao. Sorry for the delay. I'm looking at this now. On 03/01/2012 02:46 PM, Hui Zhu wrote: > Hi Pedro, > > After discussion with Yao in irc, our thought is if we want handle it in update_global_location_list, there will a lot of part need to be change, because there are a lot of call level. For example: > #0 remote_download_tracepoint (loc=0x35040b0) at ../../src/gdb/remote.c:9982 > #1 0x00000000006727c1 in download_tracepoint_locations () at ../../src/gdb/breakpoint.c:10670 > #2 0x0000000000673111 in update_global_location_list (should_insert=1) at ../../src/gdb/breakpoint.c:11021 > #3 0x0000000000663752 in create_overlay_event_breakpoint () at ../../src/gdb/breakpoint.c:2322 > #4 0x0000000000675c9f in breakpoint_re_set () at ../../src/gdb/breakpoint.c:12621 > #5 0x00000000007efe65 in solib_add (pattern=0x0, from_tty=1, target=0x1d1e860, readsyms=1) > at ../../src/gdb/solib.c:928 > #6 0x000000000057b452 in enable_break (info=0x3307890, from_tty=1) at ../../src/gdb/solib-svr4.c:1624 > #7 0x000000000057c428 in svr4_solib_create_inferior_hook (from_tty=1) at ../../src/gdb/solib-svr4.c:2234 > #8 0x00000000007f04a9 in solib_create_inferior_hook (from_tty=1) at ../../src/gdb/solib.c:1172 > #9 0x00000000006cc8e5 in post_create_inferior (target=0x1d1e860, from_tty=1) at ../../src/gdb/infcmd.c:431 > #10 0x00000000006d479d in start_remote (from_tty=1) at ../../src/gdb/infrun.c:2309 > #11 0x00000000005d80c9 in remote_start_remote (from_tty=1, target=0x1cefce0, extended_p=0) > at ../../src/gdb/remote.c:3367 > > The idea of this patch is let remote_get_trace_status doesn't try to access to target status before remote_start_remote call remote_get_trace_status. Then when GDB call download_tracepoint_locations try to download tracepoint before call remote_get_trace_status, it will got !ts->running_known in remote_can_download_tracepoint. Then GDB will not download tracepoint before remote_start_remote call remote_get_trace_status. > > BTW, to handle this issue we need patch in > http://sourceware.org/ml/gdb-patches/2012-01/msg01008.html too. > I think this is close, but still not quite right. This isn't fundamentally about the remote side's trace status; so having remote_get_trace_status return something different while going through initialization feels wrong. Let me try tweaking this a bit. I'll also hack a bit on patch 2/2. > Thanks, > Hui > > 2012-02-27 Hui Zhu > Yao Qi > > * remote.c (remote_start_remote): ts->initialized to false in the > begin of this function and set it to true before > call remote_get_trace_status. > (remote_get_trace_status): Return directly if ts->initialized is false. > tracepoint.c(tfile_open): Set ts->initialized to true. > tracepoint.h(trace_status): Add initialized. -- Pedro Alves