From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30630 invoked by alias); 22 Aug 2008 13:17:45 -0000 Received: (qmail 30471 invoked by uid 22791); 22 Aug 2008 13:17:31 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.170) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 22 Aug 2008 13:16:52 +0000 Received: by ug-out-1314.google.com with SMTP id o4so125811uge.39 for ; Fri, 22 Aug 2008 06:16:48 -0700 (PDT) Received: by 10.67.119.8 with SMTP id w8mr2578279ugm.20.1219411008607; Fri, 22 Aug 2008 06:16:48 -0700 (PDT) Received: by 10.67.117.5 with HTTP; Fri, 22 Aug 2008 06:16:48 -0700 (PDT) Message-ID: <1021db0c0808220616x1c967d1eh4b46027c6021052f@mail.gmail.com> Date: Fri, 22 Aug 2008 14:34:00 -0000 From: "Robin den Hertog" To: gdb@sourceware.org, drow@false.org Subject: Re: byte word and int(32) safe memory access? In-Reply-To: <20080822112353.GA9175@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1021db0c0808220135s7ff206fexbc0e410889414558@mail.gmail.com> <20080822112353.GA9175@caradoc.them.org> X-Google-Sender-Auth: 3681764a8bfe97fd X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00251.txt.bz2 On Fri, Aug 22, 2008 at 1:23 PM, Daniel Jacobowitz wrote: > On Fri, Aug 22, 2008 at 10:35:20AM +0200, Robin den Hertog wrote: >> hey, >> >> I would like to be able to send bytes words and int's that are >> read/written as such to my embedded target. >> (some fpga's and other peripheral hardware need their registers to be >> read/written in one action). >> the protocol doesn't support this, what is more the way the `m' packet >> is defined it is unsure how it will handle the read at all. > > What problem, exactly, are you solving here? In practice, if you tell > GDB to read an int it will read an int; if you tell it to read a byte > it will read a byte. It's only when accessing multi-word structures > that you get a problem. And in those cases it's sometimes possible to > teach the stub to handle it transparently. > > -- > Daniel Jacobowitz > CodeSourcery i want to use gdb server to debug my device drivers and the ability to send read/write commands from a script environment running on the host executed (preferably by gdb) on the target. I am using memory mapped devices. the documentation and code of gdb lead me to believe the only time you read memory larger than a byte at once is for speed optimization. but you're saying that is i request an address with the length at 2 bytes it will always be read in ONE read action ($m40,2#xx)? or does it depend on the address size? "even if addr is word-aligned and length is a multiple of the word size, the stub is free to use byte accesses" I figured that meant even $m00004040,4#xx and any length above that (but still dividable by 4) you would still be unsure how it is read. changing the stub could still mean that as soon as you connect a different fpga (to the same cpu) you have to rewrite your stub ?. -- Never fear, for I is here!