From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31119 invoked by alias); 31 Aug 2008 15:39:30 -0000 Received: (qmail 31110 invoked by uid 22791); 31 Aug 2008 15:39:29 -0000 X-Spam-Check-By: sourceware.org Received: from snape.ecoscentric.com (HELO snape.ecoscentric.com) (212.13.207.199) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 31 Aug 2008 15:38:35 +0000 Received: from localhost (snape.ecoscentric.com [127.0.0.1]) by snape.ecoscentric.com (Postfix) with ESMTP id 4CFB3DC8074; Sun, 31 Aug 2008 16:38:32 +0100 (BST) Received: from snape.ecoscentric.com ([127.0.0.1]) by localhost (snape.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KyH5Z5iYh5dg; Sun, 31 Aug 2008 16:38:28 +0100 (BST) Received: from delenn.bartv.net (snape.vpn.ecoscentric.com [192.168.146.13]) by snape.ecoscentric.com (Postfix) with ESMTP id 12A03DC8070; Sun, 31 Aug 2008 16:38:28 +0100 (BST) Date: Sun, 31 Aug 2008 15:39:00 -0000 Message-Id: From: Bart Veer To: Stan Shebs CC: gdb-patches@sourceware.org In-reply-to: <48BAAC44.4000002@codesourcery.com> (message from Stan Shebs on Sun, 31 Aug 2008 07:35:48 -0700) Subject: Re: add file I/O support when debugging an embedded target via jtag References: <48BAAC44.4000002@codesourcery.com> 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: 2008-08/txt/msg00671.txt.bz2 >>>>> "Stan" == Stan Shebs writes: Stan> Bart Veer wrote: >> Following on from >> http://sourceware.org/ml/gdb-patches/2008-08/msg00315.html, I have not >> heard anything about the code in the last two weeks. Do you know if >> anybody is looking at it? Also, if there is a likelihood that the >> patch will be accepted then I should probably get started on the >> assignment paperwork. Stan> To be honest, I looked at it but didn't understand why all Stan> this stuff seemed necessary. If this is not for the remote Stan> protocol, then what is it for? A target supported by GDB, or Stan> something else? The rationale was given in http://sourceware.org/ml/gdb/2008-07/msg00045.html The remote protocol file I/O extensions work fine when gdb interacts with target-side stub code over a serial line or ethernet, since target-side code can send the requests to gdb. Now consider a typical setup involving jtag. gdb does not access the jtag unit directly. Instead it uses the remote protocol to interact with a server of some kind over TCP, and the server controls the jtag unit. Examples of this include OpenOCD, m68k-elf-sprite, nios2-gdb-server, ... Some are open source, others are proprietary. Target-side code has no portable way of requesting that the jtag server sends a file I/O request to gdb. Some of these servers may implement their own file I/O mechanisms, but that does not give a portable solution. The purpose of the patch is to provide portable support for file I/O independent from the jtag server being used. In fact it should also work with targets that do not involve the remote protocol, e.g. simulators, although I confess I have not tried that. Stan> The addition of another stratum raises alarm bells with me, Stan> because the stratums are not as orthogonal as they should Stan> be, and I wouldn't be surprised if other configurations were Stan> broken by this. I did not see any alternative. The h/w debug file I/O code has to sit at a higher stratum than process_stratum (e.g. remote_ops) since it has to override that stratum's resume/wait/load operations. It should also sit at a level lower than thread_stratum. The file I/O support is independent from the specific embedded OS or run-time being used, but thread support for each OS will not be quite so portable. I did consider putting the code into remote.c and thus explicitly tying it to the remote protocol and remote_ops, but that would make it impossible to use the functionality with e.g. a simulator. For existing configurations there really should not be any change in behaviour since there won't be any target ops at process_override_stratum. The numerical value associated with thread_stratum will have incremented by one, but I would hope that there is no code anywhere assuming that thread_stratum==4. Stan> Also, how will everybody regression-test this (read: "make Stan> check") to know that other changes haven't broken this code? A fair point. I am not really familiar with the capabilities of the gdb testsuite, but the obvious problem here is on the target-side. In due course the h/w debug file I/O support may be integrated to a greater or lesser extent into various embedded OS's, so you cannot just take the example code in doc/hwdebug-example.c and turn it into a testcase: you would have both the OS and the testcase trying to define _gdb_hwdebug_breakpoint. Bart