From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19498 invoked by alias); 6 Aug 2008 08:15:58 -0000 Received: (qmail 19487 invoked by uid 22791); 6 Aug 2008 08:15:58 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.25) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 06 Aug 2008 08:15:06 +0000 Received: from kahikatea.snap.net.nz (218.30.255.123.static.snap.net.nz [123.255.30.218]) by viper.snap.net.nz (Postfix) with ESMTP id 2E43F3DA478; Wed, 6 Aug 2008 20:15:03 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 2E2828FC6D; Wed, 6 Aug 2008 20:14:59 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18585.23939.96967.991555@kahikatea.snap.net.nz> Date: Wed, 06 Aug 2008 08:15:00 -0000 To: =?iso-8859-1?q?Andr=E9_P=F6nitz?= Cc: gdb@sourceware.org Subject: Re: Manipulating memory In-Reply-To: <200808060838.41498.apoenitz@trolltech.com> References: <200808060838.41498.apoenitz@trolltech.com> X-Mailer: VM 7.19 under Emacs 22.2.50.3 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/msg00094.txt.bz2 > > I have read the GDB manual, and I could not find a way to manipulate a > > memory, for example: set values at given address. I only found a way > > to view it using '-data-read-memory' command, > > is this true or did I miss something? > > I'd be glad if someone had a real solution for that task, too. > > So far I used something along the lines of > > call sprintf(address, "%d %s ..", token, ... ) > > to write something to target memory, but I am looking for an alternative > too, as this gets mis-parsed in some cases. > > Maybe > > restore filename [binary] bias start end > > as described in section 8.16 of the manual would help, but that seems to > require the contents to be put in a file first. Not really convenient either. GDB has an undocumented MI command called -data-write-memory. I've not used it though, and don't know if it works or does what you want. -- Nick http://www.inet.net.nz/~nickrob