On 29/10/14 10:53, Paolo Bonzini wrote:
>
>
> On 10/29/2014 11:51 AM, Jakub Jelinek wrote:
>> On Wed, Oct 29, 2014 at 11:37:42AM +0100, Paolo Bonzini wrote:
>>>
>>>
>>> On 10/29/2014 11:28 AM, Jakub Jelinek wrote:
>>>> If this passes bootstrap/regtest, is it ok for trunk (should fix
>>>> two bootstrap issues)?  Is the
>>>> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02936.html
>>>> patch ok too (that one already tested; another bootstrap issue)?
>>>
>>> Both seem okay, though I'd have to look at the whole thread to
>>> understand what libcc1 is. :)
>>
>> It is a library for communication between the debugger and
>> a GCC plugin (and the plugin itself).  So, the library is
>> dlopened into GDB and the plugin that links against that library
>> is dlopened by GCC when GDB asks the library it dlopened to
>> run the compiler with the plugin.
>>

Adding on to what Jakub said, it allows GDB access to GCC's parser.
There are a number of reasons why, but right now that means we can
compile code snippets in GDB (without the source of the current
inferior), allow access to symbols of that inferior in that source
snippet, etc.  We then inject and execute it.

We are currently writing a wiki article about it.  Not required reading
or anything, but more information for the curious.

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

(That is a work in progress).  There is also a video of a presentation
I did at Cauldron somewhere.

Cheers

Phil

Reply via email to