This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Breakpoint commands compiler
- From: Phil Muldoon <pmuldoon at redhat dot com>
- To: Doug Evans <xdje42 at gmail dot com>, Daniel Gutson <daniel dot gutson at tallertechnologies dot com>
- Cc: gdb <gdb at sourceware dot org>
- Date: Fri, 17 Oct 2014 18:38:44 +0100
- Subject: Re: Breakpoint commands compiler
- Authentication-results: sourceware.org; auth=none
- References: <CAF5HaEVWapj-ZVTshW7aGdjFhmMohZqw9dCezwTrxH__FSEkLg at mail dot gmail dot com> <CAP9bCMQbQbvkHnoDY6oJbMOMVLZSJoxoyJ3DaGahtm_xyqjoJQ at mail dot gmail dot com>
On 17/10/14 17:57, Doug Evans wrote:
> On Fri, Oct 17, 2014 at 8:42 AM, Daniel Gutson
> <daniel.gutson@tallertechnologies.com> 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