Writing memory with GDB.

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Greetings.
Can I write memory locations with GDB? I have been looking through
Debugging With GDB and a few tutorials but can't find anything - only
how to read memory and write to variables. I am using GDB 5.1.1 for TI
MSP430 in text mode but I expect the commands would be the same as for
native debugging.
Help appreciated.
Joseph Casey.


Re: Writing memory with GDB.
Quoted text here. Click to load it

I'm pretty sure you can.  Even if it doesn't have a special command for
that, something like

    set *((unsigned char *) 0x1234567) = 50

at the command line should always work.

Quoted text here. Click to load it

To some extent, that's understandable --- GDB is a source-level
debugger, mainly.  I.e. if some piece of memory isn't available as
some variable, then you shouldn't need to fiddle with it, because the
program has no (allowed) way of accessing that memory.

--
Hans-Bernhard Broeker ( snipped-for-privacy@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Site Timeline