From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18492 invoked by alias); 24 Nov 2010 15:01:14 -0000 Received: (qmail 18452 invoked by uid 22791); 24 Nov 2010 15:01:13 -0000 X-SWARE-Spam-Status: No, hits=-1.5 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; Wed, 24 Nov 2010 15:01:04 +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 oAOFRFJD004003; Wed, 24 Nov 2010 09:27:18 -0600 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.63]) by eusaamw0711.eamcs.ericsson.se ([147.117.20.178]) with mapi; Wed, 24 Nov 2010 10:00:42 -0500 From: Marc Khouzam To: "'Baurzhan Ismagulov'" , "'gdb@sourceware.org'" Date: Wed, 24 Nov 2010 15:01:00 -0000 Subject: RE: How do I patch my binary Message-ID: References: <20101123215005.GG5574@radix50.net> In-Reply-To: <20101123215005.GG5574@radix50.net> 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/msg00095.txt.bz2 > -----Original Message----- > From: gdb-owner@sourceware.org=20 > [mailto:gdb-owner@sourceware.org] On Behalf Of Baurzhan Ismagulov > Sent: Tuesday, November 23, 2010 4:50 PM > To: gdb@sourceware.org > Subject: Re: How do I patch my binary >=20 > On Tue, Nov 23, 2010 at 04:31:22PM -0500, Marc Khouzam wrote: > > My hope was that I could modify the source code (outside of=20 > GDB), recompile=20 > > the binary and have GDB load and use the new binary,=20 > without having to restart=20 > > the program. I couldn't get this to work (using 'set write=20 > on' and reloading > > the new binary). >=20 > I don't think you can. >=20 > Which platform? Linux x86. I'm trying to do with C/C++ the hot-swap that Java allows. So, if GDB can't do it on its own, can we involve the compiler/linker to make this happen? Is there more complexity with C/C++ than with Java? The section below of the doc talks about patching, but doesn't describe a way to actually do it :-) http://sourceware.org/gdb/current/onlinedocs/gdb/Patching.html#Patching Thanks Marc