From: Paul Pluzhnikov <ppluzhnikov@google.com>
To: loody <miloody@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: how to r/w memory
Date: Tue, 16 Jun 2009 06:53:00 -0000 [thread overview]
Message-ID: <8ac60eac0906152353v7464a233ja58bf6d5280449e7@mail.gmail.com> (raw)
In-Reply-To: <3a665c760906152247r1625a2ban876c8c55ab52d4e2@mail.gmail.com>
On Mon, Jun 15, 2009 at 10:47 PM, loody<miloody@gmail.com> wrote:
> From the gdb document, we can use "x/nfu address" to read memory, but
> how we can write it?
I usually do:
(gdb) set *(int *)0x80000000 = 0
If GDB knows has debug info associated with the memory location,
(gdb) print var = 2
or
(gdb) set var = 3
also work for me.
If GDB knows the symbol, but doesn't have debug info for it, you'll have
to do cast again:
(gdb) set *(int *)&var = 4
Cheers,
--
Paul Pluzhnikov
next prev parent reply other threads:[~2009-06-16 6:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-16 5:47 loody
2009-06-16 6:53 ` Paul Pluzhnikov [this message]
2009-06-16 7:32 ` Alfred M. Szmidt
2009-06-16 7:40 ` André Pönitz
2009-06-16 11:25 ` loody
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8ac60eac0906152353v7464a233ja58bf6d5280449e7@mail.gmail.com \
--to=ppluzhnikov@google.com \
--cc=gdb@sourceware.org \
--cc=miloody@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox