From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30533 invoked by alias); 10 Feb 2012 16:18:43 -0000 Received: (qmail 30500 invoked by uid 22791); 10 Feb 2012 16:18:38 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,TW_CP X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Feb 2012 16:18:23 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1RvtB0-0004Vv-3D from Yao_Qi@mentor.com ; Fri, 10 Feb 2012 08:18:22 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 10 Feb 2012 08:18:09 -0800 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Fri, 10 Feb 2012 08:18:20 -0800 Message-ID: <4F354343.3060302@codesourcery.com> Date: Fri, 10 Feb 2012 16:18:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:9.0) Gecko/20111220 Thunderbird/9.0 MIME-Version: 1.0 To: Pedro Alves CC: 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> In-Reply-To: <4F353146.3020504@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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: 2012-02/txt/msg00203.txt.bz2 On 02/10/2012 11:01 PM, Pedro Alves wrote: > Re. "control agent by commands". So you're planning on making the agent speak > some other command set other than RSP? I'd think that making it talk exactly > RSP would be the best, since #1, you need some kind of command set anyway; > #2, the agent should be able to support debugging (stepping, breakpoints, > etc.) without gdbserver involved, and for that you'd want to support > the RSP anyway so that GDB can connect. Unless you're coming up with some > new rpc/marshaling protocol that's clearly superior to RSP? [I planed to discuss on the choice on protocols when this series go in, because this series of patches just set up a communication channel, but protocol is not involved this patch series.] The protocol between agent and GDB/GDBserver is different from RSP. This protocol is composed by a set of commands. In each command, there is an opcode (in ascii) and oprand (in binary). When sending a command, we serialize parameters into command buffer, and in agent side, we de-serialize parameters out of command buffer. The process of serialize/de-serialize is quite specific to each command. Taking command `installing tracepoint' for example, the parameter is an instance of tracepoint. We copy the instance of tracepoint, along with objects it references to, to command buffer, and in agent, we build tracepoint instance from command buffer. It is similar to RPC call. 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. #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. #3. be efficient. binary presentation is quite compact, and memcpy-like operation is efficient as well. #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. It is a piece of new work, I am open to comments. -- Yao (齐尧)