From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25306 invoked by alias); 25 Nov 2010 14:16:53 -0000 Received: (qmail 25195 invoked by uid 22791); 25 Nov 2010 14:16:51 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from imr3.ericy.com (HELO imr3.ericy.com) (198.24.6.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 25 Nov 2010 14:16:44 +0000 Received: from eusaamw0707.eamcs.ericsson.se ([147.117.20.32]) by imr3.ericy.com (8.13.8/8.13.8) with ESMTP id oAPEGFJw015710 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 25 Nov 2010 08:16:16 -0600 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.63]) by eusaamw0707.eamcs.ericsson.se ([147.117.20.32]) with mapi; Thu, 25 Nov 2010 09:16:15 -0500 From: Marc Khouzam To: "'Jan Kratochvil'" CC: "'Baurzhan Ismagulov'" , "'gdb@sourceware.org'" Date: Thu, 25 Nov 2010 14:16:00 -0000 Subject: RE: How do I patch my binary Message-ID: References: <20101123215005.GG5574@radix50.net> ,<20101125105140.GA2367@host0.dyn.jankratochvil.net> In-Reply-To: <20101125105140.GA2367@host0.dyn.jankratochvil.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/msg00099.txt.bz2 On Thu, 25 Nov 2010, Jan Kratochvil wrote: > On Wed, 24 Nov 2010 16:00:39 +0100, Marc Khouzam wrote: > > 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 Jav= a? >=20 > http://www.opensource.apple.com/tarballs/gdb/gdb-1472.tar.gz > /* APPLE LOCAL fix-and-continue */ > src/gdb/fix-and-continue.c >=20 > Howdy from Apple; Fix and Continue implemented Yet Again > http://sourceware.org/ml/gdb/2003-06/msg00500.html This is awesome! Thanks Jan! >From the email description, this seems to be exactly what I was looking fo= r. It allows the user to recompile a program, as any other compilation is done= ,=20 and ask GDB to patch it in. The email mentions that this feature works with the IDE. But it also gave me the impression that you could edit with emacs/vi, recompile with GCC from a shell, and then give GDB the 'fix and continue' command. To me, that fits very well with GDB and would have not outside dependencies. (Of course, I would add this support in Eclipse, but that is not a requirem= ent for GDB). =46rom the email: "Fix and continue is a feature implemented by many other debuggers: [...] Sun Workshop, SGI ProDev WorkShop, Microsoft's Visual Studio, HP's wdb, and Sun's Hotspot Java VM all provide this feature in one way or = another" I don't know enough about GDB to be able to port the feature myself. I wonder if anyone else in the community would be interested in=20 porting this feature? I think this would be a really nice addition to FSF GDB. Here is the XCode doc about Fix and Continue which explains it nicely for a= user: http://developer.apple.com/library/mac/#documentation/DeveloperTools/Concep= tual/XcodeDebugging/230-Modifying_Running_Code/modifying_running_code.html Thanks marc