From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18592 invoked by alias); 8 Oct 2003 17:55:05 -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 18556 invoked from network); 8 Oct 2003 17:55:03 -0000 Received: from unknown (HELO zenia.home) (12.223.225.216) by sources.redhat.com with SMTP; 8 Oct 2003 17:55:03 -0000 Received: by zenia.home (Postfix, from userid 5433) id B71B920766; Wed, 8 Oct 2003 12:53:37 -0500 (EST) To: Andrew Batchelor Cc: GDB Newsgroup Subject: Re: GDB --> Parallel Port --> Target?? References: <1065520908.1048.276.camel@And.Linux> <1065620784.1045.330.camel@And.Linux> From: Jim Blandy Date: Wed, 08 Oct 2003 17:55:00 -0000 In-Reply-To: <1065620784.1045.330.camel@And.Linux> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-10/txt/msg00139.txt.bz2 Andrew Batchelor writes: > Can I check the flow of things? > > 1) Create new serial_ops structure pointing to initialise functions, > etc. > 2) Then call this serial_add_interface to register the new structure. > > 3) Add a new case to serial_open in serial.c for argument parsing to > 'target remote'. Yep, that's right. > I may need to do some protocol conversion from the Remote Serial > Protocol to something else. What kind of agent do you have running on the system being debugged that will be speaking the protocol with GDB? GDB's protocol looks really hairy, but there are actually only five or six operations you must implement --- the rest are optional. Those are: - read registers - write registers - read memory - write memory - continue, and tell me why you stopped - single-step (if GDB doesn't do software single-stepping for your architecture, but I'm not completely clear on this) You can add more and get better behavior, more features, etc. But the above are all you need for almost everything --- breakpoints, backtraces, expression evaluation, and so on. It's been implemented many times over, and some implementations are quite small and simple. See the files called *-stub.c in the GDB source tree. Some of them are out-of-date, and none of them are really tested or supported, but they'll give you the right idea.