From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5212 invoked by alias); 30 Apr 2010 22:35:54 -0000 Received: (qmail 5202 invoked by uid 22791); 30 Apr 2010 22:35:53 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Apr 2010 22:35:48 +0000 Received: (qmail 3531 invoked from network); 30 Apr 2010 22:35:46 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 30 Apr 2010 22:35:46 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFC] New targets remote-rx and extended-remote-rx Date: Fri, 30 Apr 2010 22:35:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) Cc: Kevin Buettner References: <20100430144218.182aa18b@redhat.com> In-Reply-To: <20100430144218.182aa18b@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201004302335.44097.pedro@codesourcery.com> 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: 2010-04/txt/msg01024.txt.bz2 On Friday 30 April 2010 22:42:18, Kevin Buettner wrote: > The patch below adds two new targets, remote-rx and > extended-remote-rx, which provide a serial debug interface to > platforms using the Renesas RX architecture. The interface is > identical to that defined by remote.c except that memory transfer > operations are redefined to do byte swapping under certain conditions. > > The new file, remote-rx.c, inherits operations defined in remote.c. > It overrides several of those operations in order to provide support > for some of the idiosyncracies of the RX architecture. The long comment > near the beginning of remote-rx.c explains the motivation for this > patch and these new targets. I'm not convinced this inheritance is a good idea. Why not handle this in the regular remote target instead? Adding new targets is evil. :-) That is, say, with a gdbarch flag telling the remote.c target to handle this when needed. (or a qSupported feature, or a new feature in the xml target description if it is expected that stubs might handle this themselves somehow) This would remove the burden from the user/frontend, of knowing upfront the idiosyncracies of this architecture, and having to remember to connect with a special target. Or, even, imagine that at some point you will have a native gdb running on such architecture. This raises the question of whether it would make more sense to make the common memory reading code handle this independent of target_ops instead. On first sight, it seems to. I'm not sure I grasped it enough to understand if this could benefit from a TARGET_OBJECT_MEMORY_CODE vs TARGET_OBJECT_MEMORY_DATA request distinction, instead of just calling everything TARGET_OBJECT_MEMORY_CODE? That is switch the swapping decision to the transfer intent, not to where the code is in memory. For example, what should happen if I build a buffer of executable code in memory at runtime, and I want to disassemble it with GDB? I'll build the memory buffer, with a layout as the compiler puts things in .text, but the code will not be in .text, yet, don't I want for GDB to read it in execute order, not memory order? Lastly, is there any relation between the new address_range structure, and struct addrmap? -- Pedro Alves