This is the mail archive of the
mailing list for the GDB project.
How do I patch my binary
- From: Marc Khouzam <marc dot khouzam at ericsson dot com>
- To: "'gdb at sourceware dot org'" <gdb at sourceware dot org>
- Date: Tue, 23 Nov 2010 16:31:22 -0500
- Subject: How do I patch my binary
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.