From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106561 invoked by alias); 12 Feb 2016 01:49:27 -0000 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 Received: (qmail 106224 invoked by uid 89); 12 Feb 2016 01:49:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=inferiors, HContent-Transfer-Encoding:8bit X-HELO: xyzzy.0x04.net Received: from xyzzy.0x04.net (HELO xyzzy.0x04.net) (109.74.193.254) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Feb 2016 01:49:23 +0000 Received: from hogfather.0x04.net (89-65-66-135.dynamic.chello.pl [89.65.66.135]) by xyzzy.0x04.net (Postfix) with ESMTPS id 6ADBF3FE6A; Fri, 12 Feb 2016 02:50:11 +0100 (CET) Received: from [192.168.13.108] (89-65-66-135.dynamic.chello.pl [89.65.66.135]) by hogfather.0x04.net (Postfix) with ESMTPSA id 2473A58008C; Fri, 12 Feb 2016 02:49:21 +0100 (CET) Subject: Re: [PATCH 0/4] Save target description in tfile. To: Yao Qi References: <1454773157-31569-1-git-send-email-koriakin@0x04.net> <86ziv7no7i.fsf@gmail.com> Cc: gdb-patches@sourceware.org From: =?UTF-8?Q?Marcin_Ko=c5=9bcielnicki?= Message-ID: <56BD3A20.5070409@0x04.net> Date: Fri, 12 Feb 2016 01:49:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <86ziv7no7i.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00395.txt.bz2 On 11/02/16 18:36, Yao Qi wrote: > Marcin Kościelnicki writes: > >> 1. target.xml is read from the target. >> 2. Includes are processed, resulting in a single in-memory XML file >> containing all the data. >> 3. The resulting file is stored in tfile header by prefixing every line >> with "tdesc ". We may insert a spurious newline at the end of file >> with this encoding, but that won't matter for XML. >> 4. When tfile is read, the XML is stored in an allocated buffer, and >> xfer for TARGET_OBJECT_AVAILABLE_FEATURES is implemented, reading >> from it. >> 5. target_find_description is called to force reading it. > > The target description is a global state in trace file, so it doesn't > work tracepoints have different target descriptions, for example in > multi-inferior case, one is x86 and the other one is x86_64 (and arm vs > aarch64 too), and we have tracepoints set in two processes. > > I know tracepoint doesn't support multi-inferior/multi-process, but we > may support that in the future. Since we are changing tracepoint file > format, we'd better think about this a little bit. Can we save multiple > target descriptions in trace file, and associate the tracepoints to the > right target description in trace file? > Well, that'd require rethinking the whole format - there's already the 'R' line, which is also global and specifies register packet size, which is probably different for every target (it's effectively a very poor kind of tdesc). There's also no way of assigning the tracepoints to inferiors, or for that matter to say what executable is running in what inferior (target tfile just picks the current one loaded in gdb). In effect, we'd have to prefix every single line with the inferior id (or otherwise include it), and the result is probably no better than just bundling several tfile files eg. in a zip (I don't think we have support for merging trace buffers from several sources anyhow).