From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13149 invoked by alias); 7 Oct 2003 16:28:24 -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 13142 invoked from network); 7 Oct 2003 16:28:24 -0000 Received: from unknown (HELO zenia.home) (12.223.225.216) by sources.redhat.com with SMTP; 7 Oct 2003 16:28:24 -0000 Received: by zenia.home (Postfix, from userid 5433) id 3EC0B20766; Tue, 7 Oct 2003 11:27:07 -0500 (EST) To: Andrew Batchelor Cc: gdb@sources.redhat.com Subject: Re: GDB --> Parallel Port --> Target?? References: <1065520908.1048.276.camel@And.Linux> From: Jim Blandy Date: Tue, 07 Oct 2003 16:28:00 -0000 In-Reply-To: <1065520908.1048.276.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/msg00120.txt.bz2 Andrew Batchelor writes: > Hello, > > I was wondering how straightforward it would be to write an extension > for GDB to use the parallel port to connect to a target instead of the > serial port? (Changing only a few files? Many files? Which ones?, > etc.) > > Now I'm not really very familiar with GDB and before I jump in at the > deep end, I was wondering if any of you guys could give me any pointers? > At the moment I'm just having a read through the User Manual and the > Internals Manual and looking at some of the C files that look like they > might be of some help - can any of you guys point me in the right > direction? > > Any help or advice you could offer would be much appreciated. Have you tried simply doing "target remote /dev/lpt"? It's worth a shot. If it turns out that doesn't work because the parallel device needs special handling, that can be done pretty easily. Someone asked about this regarding USB recently: http://sources.redhat.com/ml/insight/2003-q4/msg00016.html Oddly enough, it seems like someone was thinking about this at some point. In serial.c: struct serial * serial_open (const char *name) { struct serial *scb; struct serial_ops *ops; const char *open_name = name; for (scb = scb_base; scb; scb = scb->next) if (scb->name && strcmp (scb->name, name) == 0) { scb->refcnt++; return scb; } if (strcmp (name, "pc") == 0) ops = serial_interface_lookup ("pc"); else if (strchr (name, ':')) ops = serial_interface_lookup ("tcp"); else if (strncmp (name, "lpt", 3) == 0) ops = serial_interface_lookup ("parallel"); else if (strncmp (name, "|", 1) == 0) { ops = serial_interface_lookup ("pipe"); open_name = name + 1; /* discard ``|'' */ } else ops = serial_interface_lookup ("hardwire"); But this is just parsing what comes after "target remote". So "target remote lpt" would try to find a serial interface named "parallel". But there is no code I could find that registered an interface by that name, so the open would fail.