From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31067 invoked by alias); 7 Apr 2010 13:47:32 -0000 Received: (qmail 31057 invoked by uid 22791); 7 Apr 2010 13:47:31 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Apr 2010 13:47:26 +0000 Received: (qmail 30346 invoked from network); 7 Apr 2010 13:47:24 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 7 Apr 2010 13:47:24 -0000 From: Pedro Alves To: Stan Shebs Subject: Re: tracing broken if target doesn't do disconnected tracing Date: Wed, 07 Apr 2010 13:47:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <201004050101.02067.pedro@codesourcery.com> <201004071240.36873.pedro@codesourcery.com> <4BBC8981.4050900@codesourcery.com> In-Reply-To: <4BBC8981.4050900@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201004071447.22727.pedro@codesourcery.com> 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: 2010-04/txt/msg00128.txt.bz2 On Wednesday 07 April 2010 14:32:49, Stan Shebs wrote: > Pedro Alves wrote: > > The support for the feature is reported by qSupported, hence it's > > certainly target-wide noawadays. It may or not be desirable to > > be able to select which processes keep tracing on disconnect, so > > a per-status state flag for that also sounds acceptable --- it > > could represent whether tracing will continue for a given process > > after disconnection. The flag (trace_status->disconnected_tracing) > > being 0 doesn't mean the target doesn't support disconnected > > tracing, so there's still no way for the common code to know it. > > > > In a way, what the user wants to know is what qSupported reports, > dressed up in a reasonable fashion. Our traditional expectation has > been the user knows already, because, well, it's the user's program and > the user's hardware. But as the target gets more elaborate - and > tracepoint support is certainly a quantum jump in that direction :-) - > that assumption breaks down. In that vein, you may recall that one of > our upcoming enhancements is to attach an arbitrary text string to a > trace run, with the intended purpose of including things like a name and > phone number, so that someone else connecting to the target can have a > way to find out about the trace run, and know whether it's OK to mess > with it. I missed your point here. My point was that supporting disconnect tracing or not seems to want to be target-wide feature, and that hence, it should probably me exposed to common code as a target method (e.g., target_supports_disconnected_tracing). This, independent of a given process/trace status saying that tracing will continue on detach for a given run. So, common code could do things like: if (current_trace_status ()->running && !current_trace_status ()->disconnected_tracing && target_supports_disconnected_tracing ()) { int cont = query (_("Trace is running. Continue tracing after foo?"))); send_disconnected_tracing_value (cont); } and also in common code: static void set_disconnected_tracing (char *args, int from_tty, struct cmd_list_element *c) { if (target_supports_disconnected_tracing () && disconnected_tracing) send_disconnected_tracing_value (disconnected_tracing); else if (disconnected_tracing) { error/warn ("Target doesn't do disconnected tracing"); } } Instead of hacking it in remote.c, way late. -- Pedro Alves