How do I patch my binary

Marc Khouzam
2010-11-23T21:31:49Z

Hi,

There is doc section "Patching Programs". This got me hoping I could somehow
patch my binary while I was debugging.

My hope was that I could modify the source code (outside of GDB), recompile
the binary and have GDB load and use the new binary, without having to restart
the program. I couldn't get this to work (using 'set write on' and reloading
the new binary).

When the doc says "Patching" does it mean I actually have to modify the memory
where the code is written, using GDB commands? Or can I do it high-level
like I originally hoped.

Thanks

Marc