From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19091 invoked by alias); 17 Oct 2014 17:38:52 -0000 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 Received: (qmail 19081 invoked by uid 89); 17 Oct 2014 17:38:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 17 Oct 2014 17:38:50 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9HHckdA014502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Oct 2014 13:38:47 -0400 Received: from localhost.localdomain (ovpn-112-31.ams2.redhat.com [10.36.112.31]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9HHcioa015494; Fri, 17 Oct 2014 13:38:45 -0400 Message-ID: <54415424.6090107@redhat.com> Date: Fri, 17 Oct 2014 17:38:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Doug Evans , Daniel Gutson CC: gdb Subject: Re: Breakpoint commands compiler References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00080.txt.bz2 On 17/10/14 17:57, Doug Evans wrote: > On Fri, Oct 17, 2014 at 8:42 AM, Daniel Gutson > wrote: >> Hi, >> >> gdb is sometimes used for changing the runtime behavior of a program. >> That is, suppose there is a program that has a bug, >> it is spotted with gdb, then I create a set of non-stopping breakpoints that >> "fix" the runtime behavior by altering memory and registers. >> It does work, but it's slow. >> >> I was thinking to start a project to add a "breakpoint commands compiler" >> to gdb, which basically generates C code from the breakpoint commands >> (one function per breakpoint), >> which in turns calls a C API (similar to the python api), invokes the compiler >> (user-specified), loads it as a shared object, and finally replaces the commands >> of the breakpoints by calls to the compiled breakpoint-functions. >> >> Any comment/suggestion? Would this be accepted within gdb? > > Hi. > > For reference sake a patch has been submitted by Red Hat to add a > "compile" command. > [The patch is still being reviewed, it hasn't been committed yet.] > It doesn't compile gdb commands, but allows one to add compiled code > to the inferior in the debugging session. > Just as an an add-on, we've begun detailing the internals of the compile command here: https://sourceware.org/gdb/wiki/GCCCompileAndExecute That page is draft and is not complete yet. It should be complete soon. A minor status update. I will be checking the GCC patches in next week (we have permission there). And then we will be pursuing/re-pinging the GDB patches right after. Cheers Phil