Writing memory with GDB.

Feb 12, 2005 1 Replies

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.



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.

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 (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required