From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28239 invoked by alias); 26 Sep 2005 06:13:37 -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 28199 invoked by uid 22791); 26 Sep 2005 06:13:31 -0000 Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 26 Sep 2005 06:13:31 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EJmDS-0003UU-HZ for gdb@sources.redhat.com; Mon, 26 Sep 2005 08:11:54 +0200 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 26 Sep 2005 08:11:54 +0200 Received: from ghost by zigzag.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 26 Sep 2005 08:11:54 +0200 To: gdb@sources.redhat.com From: Vladimir Prus Subject: RE: Targets with non-byte-addressable memory Date: Mon, 26 Sep 2005 06:13:00 -0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.8.2 X-SW-Source: 2005-09/txt/msg00187.txt.bz2 Dave Korn wrote: >> Does anybody has experience of porting gdb to a target where memory is >> not byte-addressable. That is, if you read 0x80000007 you get 4 bytes and >> if you read 0x80000008 you get another 4 bytes. >> >> The source has TARGET_CHAR_BIT macro, but no target under "config" makes >> use of them which makes me suspect that setting it won't do any good. > > Changing TARGET_CHAR_BIT is the wrong way to go. Basically, IIUIC, you > shouldn't need to do anything at all for native debugging, and for remote > debugging, you'll have to take care of it in the stub/server. Hi Dave, in my case it's remote debugging. Unfortunately, I don't know what stub/server can do. Just a couple of cases. 1. When printing memory, say "x/2w 0x80000007", gdb first sends "fetch 4 bytes at 0x80000007" request and then sends "fetch 4 bytes at 0x8000000b" request. The address in second request should be 0x80000008 and I don't see any way how server can affect this. It's asked for 4 bytes, it returns 4 bytes and that's all. 2. Likewise, when printing arrays, gdb increments address by size of array element in bytes, not in words. Again, server returns exactly what's asked for. I've temporary "fixed" those problems by sticking "/4" in code but that's no good. (And note that I had to change two different code parts to handles case 1 and case 2). Maybe, there's some way that stub/server can handle this that I don't know? Or there's some other configuration variable? And what does TARGET_CHAR_BIT do? Thanks, Volodya