From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21640 invoked by alias); 5 Aug 2008 19:12:44 -0000 Received: (qmail 21632 invoked by uid 22791); 5 Aug 2008 19:12:43 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 05 Aug 2008 19:12:09 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 7F8122A96AB; Tue, 5 Aug 2008 15:12:07 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id M-+la7iwhNS1; Tue, 5 Aug 2008 15:12:07 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 4731F2A96A9; Tue, 5 Aug 2008 15:12:07 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id C65C6E7ACD; Tue, 5 Aug 2008 21:12:04 +0200 (CEST) Date: Tue, 05 Aug 2008 19:12:00 -0000 From: Joel Brobecker To: Eran Ifrah Cc: gdb@sourceware.org Subject: Re: Manipulating memory Message-ID: <20080805191204.GB4323@adacore.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i 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/msg00077.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? To view memory at a given address, I usually use the "x" command. To write memory, I use "set {TYPE}ADDRESS := VALUE" (or something like that, I'm completely jetlagged right now). For instance, to set a byte at 0xdeadbeef to 0x48, I would do: (gdb) set {char} 0xdeadbeef = 0x48 (This assume that the current language is C) -- Joel