From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2061 invoked by alias); 23 Nov 2010 21:31:49 -0000 Received: (qmail 2052 invoked by uid 22791); 23 Nov 2010 21:31:48 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from imr4.ericy.com (HELO imr4.ericy.com) (198.24.6.8) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 23 Nov 2010 21:31:32 +0000 Received: from eusaamw0711.eamcs.ericsson.se ([147.117.20.178]) by imr4.ericy.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id oANLvqSJ005207 for ; Tue, 23 Nov 2010 15:57:53 -0600 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.63]) by eusaamw0711.eamcs.ericsson.se ([147.117.20.178]) with mapi; Tue, 23 Nov 2010 16:31:24 -0500 From: Marc Khouzam To: "'gdb@sourceware.org'" Date: Tue, 23 Nov 2010 21:31:00 -0000 Subject: How do I patch my binary Message-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00089.txt.bz2 Hi, There is doc section "Patching Programs". This got me hoping I could someh= ow=20 patch my binary while I was debugging. My hope was that I could modify the source code (outside of GDB), recompile= =20 the binary and have GDB load and use the new binary, without having to rest= art=20 the program. I couldn't get this to work (using 'set write on' and reloadi= ng the new binary). When the doc says "Patching" does it mean I actually have to modify the mem= ory where the code is written, using GDB commands? Or can I do it high-level like I originally hoped. Thanks Marc =20