public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Re: C injection GDB project
       [not found] ` <54DB37D0.1010108@redhat.com>
@ 2015-02-11 12:13   ` Phil Muldoon
  2015-02-11 13:53     ` Pedro Alves
       [not found]     ` <94F6E835-DD06-4956-BFDF-6B0503CDAE64@gmail.com>
  0 siblings, 2 replies; 3+ messages in thread
From: Phil Muldoon @ 2015-02-11 12:13 UTC (permalink / raw)
  To: Pedro Alves, Jose E. Marchesi, gdb

On 11/02/15 11:06, Pedro Alves wrote:
> On 02/11/2015 11:02 AM, Jose E. Marchesi wrote:
>>
>>  I would like to work in the C injection GDB project.

Hi

I CC'd the GDB mailing list and trimmed some of the post. I hope you
do not mind. Pedro asked me to reply to you on this interest.

You've picked an excellent time to show interest! Phase one is
complete and we are just about starting phase two. What is phase two?
C++!

The current status of the project is that the C parts of the injection
process have been checked into both GCC and GDB. The GCC parts will be
released in GCC 5. The GDB parts in the next GDB release.

A brief overview of the mechanics and methods of the project can be
found here:

https://sourceware.org/gdb/wiki/GCCCompileAndExecute#preview

There is also a talk given in the 2014 GNU Cauldron. You can find it
here:

https://www.youtube.com/watch?v=YQATnypexbY

All discussion related to the project should be on gdb@sourceware.org
and all patches to gdb-patches@sourceware.org

For historical review, the GDB parts of the project can be found here:

https://github.com/tromey/gdb/commits/gdbjit/gd

And the GCC bits here:

https://github.com/tromey/gcc/tree/submit/compile

Note both of those branches are now defunct. All the code contained in
them is checked in to the relevant upstream projects. I provide them
purely for archaeological purposes.

The people who work mostly on this project are: me, Jan Kratochvil
<jan.kratochvil@redhat.com> and Tom Tromey. Tom previously lead the
effort, but has now moved on to other fun stuff. There have been many
others who contributed in one way or another, not least of all
the reviewers. Alas, they are too numerous to list here.

A TODO (in summary):

- Write the C++ plug-in for GCC. Re-architect and reuse the C plug-in
  code wherever possible.

- Teach GDB to tell GCC about C++ types.

Those two will take a lot of time. We have not started yet.

Eventually we want to provide:

- compile print
- compile printf
- compile cond (or some other interface for conditional breakpoints)
- Maybe a fix-and-continue interface
- Maybe intelligently design a way GDB can use GCC for parsing
  expressions in some case.

Beyond C++ we have no plans for other languages, but will happily and
gladly support those authors who wish to add one.

Let me know how I can help you.

Cheers

Phil

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: C injection GDB project
  2015-02-11 12:13   ` C injection GDB project Phil Muldoon
@ 2015-02-11 13:53     ` Pedro Alves
       [not found]     ` <94F6E835-DD06-4956-BFDF-6B0503CDAE64@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2015-02-11 13:53 UTC (permalink / raw)
  To: Phil Muldoon, Jose E. Marchesi, gdb

On 02/11/2015 12:13 PM, Phil Muldoon wrote:
> On 11/02/15 11:06, Pedro Alves wrote:
>> On 02/11/2015 11:02 AM, Jose E. Marchesi wrote:
>>>
>>>  I would like to work in the C injection GDB project.
> 
> Hi
> 
> I CC'd the GDB mailing list and trimmed some of the post. I hope you
> do not mind. Pedro asked me to reply to you on this interest.
> 
> You've picked an excellent time to show interest! Phase one is
> complete and we are just about starting phase two. What is phase two?
> C++!
> 
> The current status of the project is that the C parts of the injection
> process have been checked into both GCC and GDB. The GCC parts will be
> released in GCC 5. The GDB parts in the next GDB release.
> 
> A brief overview of the mechanics and methods of the project can be
> found here:
> 
> https://sourceware.org/gdb/wiki/GCCCompileAndExecute#preview
> 
> There is also a talk given in the 2014 GNU Cauldron. You can find it
> here:
> 
> https://www.youtube.com/watch?v=YQATnypexbY
> 
> All discussion related to the project should be on gdb@sourceware.org
> and all patches to gdb-patches@sourceware.org
> 
> For historical review, the GDB parts of the project can be found here:
> 
> https://github.com/tromey/gdb/commits/gdbjit/gd
> 
> And the GCC bits here:
> 
> https://github.com/tromey/gcc/tree/submit/compile
> 
> Note both of those branches are now defunct. All the code contained in
> them is checked in to the relevant upstream projects. I provide them
> purely for archaeological purposes.
> 
> The people who work mostly on this project are: me, Jan Kratochvil
> <jan.kratochvil@redhat.com> and Tom Tromey. Tom previously lead the
> effort, but has now moved on to other fun stuff. There have been many
> others who contributed in one way or another, not least of all
> the reviewers. Alas, they are too numerous to list here.
> 
> A TODO (in summary):
> 
> - Write the C++ plug-in for GCC. Re-architect and reuse the C plug-in
>   code wherever possible.
> 
> - Teach GDB to tell GCC about C++ types.
> 
> Those two will take a lot of time. We have not started yet.
> 
> Eventually we want to provide:
> 
> - compile print
> - compile printf
> - compile cond (or some other interface for conditional breakpoints)
> - Maybe a fix-and-continue interface
> - Maybe intelligently design a way GDB can use GCC for parsing
>   expressions in some case.

In addition (or maybe in expansion of that last point):

  - Fully replace GDB's C and C++ parsers by calling into GCC/G++'s
    parsers.  IOW, make "(gdb) print EXPR" (and wherever else an EXPR
    is evaluated) use gcc's frontend to parse EXPR.  That can of course
    be phased in, with e.g. a new "print -inject" switch to force it, and
    a new global setting the user can use to select the mechanism GDB should
    use to evaluate the expression.

  - Related, to fully replace GDB's own built in parsers, we'll need to
    be able to evaluate expressions using GCC's frontends, but without
    injecting code in the inferior and calling it.  Function calls can
    potentially corrupt more an already corrupt inferior, so best
    avoid that by default, and there's also debugging core dumps, which
    obviously can't execute code.  My idea for that would be to make
    the GCC frontend stop compilation at the gimple level, and then
    add a gimple interpreter (gimple == gcc's IR) to the gcc plugin, which
    would callback into GDB whenever it needed to read memory or registers
    out of the inferior.  I'd be thrilled if someone picked up this project!

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: C injection GDB project
       [not found]     ` <94F6E835-DD06-4956-BFDF-6B0503CDAE64@gmail.com>
@ 2015-02-11 14:42       ` Phil Muldoon
  0 siblings, 0 replies; 3+ messages in thread
From: Phil Muldoon @ 2015-02-11 14:42 UTC (permalink / raw)
  To: Simone Baratta, Pedro Alves, Jose E. Marchesi, gdb

On 11/02/15 13:23, Simone Baratta wrote:
> Good morning to all;
> Maybe this could be a project for the 2015 gsoc? Projects applications have begun in these days.
>
> I would be interested too in participating in the code injection project; I have quite a strong confidence with C, C++ and gdb, although not with the advanced features of the latter.
>
> Also, I will have to start my master thesis project in the next months, could this be interesting for you? It would give me the possibility to work on it full time for some months.
>
> Thanks in advance,
> --
I have no objection. All help is appreciated. But...

I thought that GSoC project had to refer to a concrete and coherent
functional part of a project. Or a feature. I would really advise
against doing things like the C++ GCC plug-in as a GSoC project that
has an expectation of being finished at the end. It is a fierce
complex part of the project.

That being said if it can be sub-divided into some part that is
acceptable to those moderators of the project, I say sure, go ahead.

Cheers

Phil

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-11 14:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <877fvopv7x.fsf@gnu.org>
     [not found] ` <54DB37D0.1010108@redhat.com>
2015-02-11 12:13   ` C injection GDB project Phil Muldoon
2015-02-11 13:53     ` Pedro Alves
     [not found]     ` <94F6E835-DD06-4956-BFDF-6B0503CDAE64@gmail.com>
2015-02-11 14:42       ` Phil Muldoon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).