From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23312 invoked by alias); 29 Nov 2012 15:51:16 -0000 Received: (qmail 23235 invoked by uid 22791); 29 Nov 2012 15:51:13 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Nov 2012 15:51:08 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Te6OJ-0005zz-Ge from Yao_Qi@mentor.com ; Thu, 29 Nov 2012 07:51:07 -0800 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 29 Nov 2012 07:51:07 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Thu, 29 Nov 2012 07:51:06 -0800 Message-ID: <50B78451.5000903@codesourcery.com> Date: Thu, 29 Nov 2012 15:51:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Jon Beniston CC: Subject: Re: Memory-mapped peripheral registers, remote protocol and memory maps References: <004701cdcd9d$e487ff90$ad97feb0$@beniston.com> <50B727B8.7040103@codesourcery.com> <005301cdce23$e1b0f3e0$a512dba0$@beniston.com> In-Reply-To: <005301cdce23$e1b0f3e0$a512dba0$@beniston.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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: 2012-11/txt/msg00095.txt.bz2 On 11/29/2012 07:22 PM, Jon Beniston wrote: > In some cases, there might be a large variety of inter-mixed > 8/16/32-bit registers, which you might not have the space to cater > for in a small stub. Can we be sure that GDB will only generate a 'm > 0x0x00d000 4' packet? It would be tricky for a stub to deal with a The following command 'p' will only generate 'm' packet with the right size. (gdb) p *(unsigned int *) 0x8048608 Sending packet: $m8048608,4#3f...Packet received: 5589e583 (gdb) p *(char *) 0x8048608 Sending packet: $m8048608,1#3c...Packet received: 55 I admit they are tricky. > packet of a larger size (say if the register area is opened in a > memory viewer). Also, it would be nice to prevent reads from certain > addresses, in case they have side effects (i.e FIFOs, etc). > Something similar was done in codesourcery (by other people) to handle memory-mapped register and side effect of reading registers (we call it read sensitiveness, IIRC). The target description mechanism (http://sourceware.org/gdb/current/onlinedocs/gdb/Target-Descriptions.html) was enhanced, in which the name, width, mapped address and read sensitiveness of each register is described. With these knowledge, GDB can take care of memory-mapped register. However, these patches didn't go to upstream. -- Yao (齐尧)