From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21615 invoked by alias); 7 Mar 2008 13:56:52 -0000 Received: (qmail 21602 invoked by uid 22791); 7 Mar 2008 13:56:51 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 07 Mar 2008 13:56:28 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id D155E983A0; Fri, 7 Mar 2008 13:56:26 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id BC88398149; Fri, 7 Mar 2008 13:56:26 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JXd3g-0003ak-Iw; Fri, 07 Mar 2008 08:56:24 -0500 Date: Fri, 07 Mar 2008 18:19:00 -0000 From: Daniel Jacobowitz To: bjgnu@sunnorth.com.cn Cc: gdb@sourceware.org Subject: Re: mem command and set command Message-ID: <20080307135624.GA13487@caradoc.them.org> Mail-Followup-To: bjgnu@sunnorth.com.cn, gdb@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-12-11) 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-03/txt/msg00088.txt.bz2 On Fri, Mar 07, 2008 at 04:55:53PM +0800, bjgnu@sunnorth.com.cn wrote: > hello all, > > Executing the following GDB commands: > > mem 0x0 0x100 16 > set *0x0=0x12345678 > > I found the 3rd parameter of write_memory (CORE_ADDR memaddr, const > bfd_byte *myaddr, int len) is always 4. > I think the length should be 2 because "mem 0x0 0x100 16" has set memory > width to 16. > Does "mem" command affect write memory operation? No. The width appears to be unused. I just use set {short} 0 = 0x1234 when I want to generate a 16-bit write. -- Daniel Jacobowitz CodeSourcery