From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6567 invoked by alias); 10 Feb 2012 16:28:40 -0000 Received: (qmail 6557 invoked by uid 22791); 10 Feb 2012 16:28:38 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_CP,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; Fri, 10 Feb 2012 16:28:23 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1AGSKqi030202 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 10 Feb 2012 11:28:20 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1AGSJAC005423; Fri, 10 Feb 2012 11:28:19 -0500 Message-ID: <4F3545A2.9020901@redhat.com> Date: Fri, 10 Feb 2012 16:28:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [patch 5/8] Doc for agent References: <4F1D55D7.7030506@codesourcery.com> <4F1D678B.2040705@codesourcery.com> <4F34248A.8070706@redhat.com> <4F351BC1.9080601@codesourcery.com> <4F353146.3020504@redhat.com> <4F354343.3060302@codesourcery.com> In-Reply-To: <4F354343.3060302@codesourcery.com> Content-Type: text/plain; charset=UTF-8 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-02/txt/msg00204.txt.bz2 On 02/10/2012 04:18 PM, Yao Qi wrote: > The reasons for this kind of design are, > > #1. agent, inferior and debugger (GDB or GDBserver) are running > on the same machine, so protocol doesn't to have to handle machine > difference, such as endianess, word size, etc. Binary copy should > work fine. Nope, that's not true at all. Several architectures can run in different modes (x86 32-bit/64-bit; arm/thumbx big/little/mixed; mips; ppc, etc.). Several architectures have more than one ABI. We can have e.g., a 64-bit gdbserver controlling a 32-bit process on x86. You can have a gdbserver controlling an inferior that's running a different endianness on some machines. The current IPA has the limitation that fast tracepoints only work if the inferior has the same arch/abi as gdbserver. If we're adding a new IPC, and an IPA v2, let's not repeat the mistake. > #2. avoid to transform data twice. When data is ready, say > tracepoint, it is efficient to copy data directly, rather than > transforming to some format, and agent will transform it back later. Traceframe data is a different matter. We can open a shared memory channel for those, for example. Note traceframes have a fixed and defined format (so we have the tfile target). > #3. be efficient. binary presentation is quite compact, and > memcpy-like operation is efficient as well. It also doesn't work. See above. > #4. as close to raw data as possible. agent is running in the > same process with inferior, and the same machine with debugger. The > process of protocol is like copying parameter from one process to > another. We don't have to transform the format of raw data. The command channel is not the fast path. You don't need, and shouldn't be micro-optimizing it. > It is a piece of new work, I am open to comments. -- Pedro Alves