By default, GDB opens the file containing your program's executable code (or the corefile) read-only. This prevents accidental alterations to machine code; but it also prevents you from intentionally patching your program's binary.
If you'd like to be able to patch the binary, you can specify that
explicitly with the
set write command. For example, you might
want to turn on internal debugging flags, or even to make emergency
set write on
set write off
core-filecommand) after changing
set write, for your new setting to take effect.
Go to the first, previous, next, last section, table of contents.