From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24916 invoked by alias); 26 Nov 2003 14:56:21 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 24863 invoked from network); 26 Nov 2003 14:56:18 -0000 Received: from unknown (HELO localhost.redhat.com) (65.49.0.121) by sources.redhat.com with SMTP; 26 Nov 2003 14:56:18 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 2A98E2B8F; Wed, 26 Nov 2003 09:56:09 -0500 (EST) Message-ID: <3FC4BF09.3000708@gnu.org> Date: Wed, 26 Nov 2003 14:56:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Batchelor Cc: GDB Newsgroup Subject: Re: Adding-new-target difficulties References: <1069856145.1130.292.camel@And.Linux> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-11/txt/msg00256.txt.bz2 > Hello, > > [Note: I'm adding support for ARMs RealView ICE to GDB] > > I'm trying to add a new target to GDB, but I'm not sure whether > following the procedure in the user guide is going to give me what I > want. Is there a more straightforward way? > > I need a new target which allows me to communicate via tcp/ip but allows > me to change the Remote Serial Protocol to RV-MSG (RealView Protocol). > The different protocol affects everything device; connect/disconnection, > code loading, breakpoints, etc. (GDB's remote serial protocol?) It sounds like you're trying to on-the-fly replace one target stack (gdb's remote) with a second (your protocol)? Could you hack your new target (that used serial for tcp communication) fudge enough GDB remote protocol commands to trigger the mode switch? > Where exactly does GDB spit stuff out for a TCP/IP connection? I've > been looking at remote.c and serial.c which seems to have functions > related to it and another that looks promising is ser-tcp.c. Could I > simply add a switch to the command 'target remote host?' Or add a case > clause that detects if the hostname is 'RV-ICE' or something? I could > perhaps then branch off to my code, calling GDB functions as and when? Normally new remote targets are added as new commands vis: target remote target m32r target pmon target ... this occures because the target*.c file has registered itself (see the _initialize function). When the user enters "target ..." the corresponding ..._target_open being called. After that it is a case of working through each of the vectors implementing those that are needed. For the transport, yes serial.[hc] is used. You may also want to look at the async code - it lets you implement things in a more event driven style. Andrew