Writing memory with GDB.

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.

Reply to
Joseph Casey
Loading thread data ...

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.
Reply to
Hans-Bernhard Broeker

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.