Thanks for the info Dave. I downloaded the tar ball but facing issues
while building it:

prompt:>~/shared_scripts/bin/gcc-py-plugin/gcc-python-plugin-6f960cf 1020> make
python generate-config-h.py -o autogenerated-config.h --gcc=gcc
Traceback (most recent call last):
  File "generate-config-h.py", line 21, in <module>
    from configbuilder import ConfigBuilder
  File 
"/x/home/satprasad/shared_scripts/bin/gcc-py-plugin/gcc-python-plugin-6f960cf/configbuilder.py",
line 20, in <module>
    from subprocess import Popen, PIPE, check_output
ImportError: cannot import name check_output
make: *** [autogenerated-config.h] Error 1
hyper66:~/shared_scripts/bin/gcc-py-plugin/gcc-python-plugin-6f960cf 1021>

I am not that familiar with Python - can you please help me out?

Also please let me know some references on how to write a new PASS
within GCC codebase?

Regards,
Prakash


On Fri, Feb 10, 2012 at 7:58 AM, David Malcolm <dmalc...@redhat.com> wrote:
> On Thu, 2012-02-09 at 15:52 -0800, Satya Prakash Prasad wrote:
>> Hi All,
>>
>> I am a new joinee to this group and a C/C++ developer for around 2
>> yrs. What interest me most is gcc / gcov combination output. It list
>> the code execution details.
>>
>> Is there a possibility that gcc build binaries can print file
>> name:line number <code> of the code it is executing at run time.
>> Something like gcov produces after code execution but has to be in
>> order of execution to benefit projects build from more than one source
>> code unit. So can the gcov part be built by default and results be
>> available at runtime in sequence of execution.
>>
>> Does this requires modification of gcc code - any pointers would help me a 
>> lot?
>
> If I'm understanding you correctly, this seems like a nice feature to
> have for people learning to program in C/C++, but an unacceptably high
> speed cost for most other uses.  For example, it's nice to be able to
> watch the order in which constructors and destructors get invoked when
> learning C++.
>
> A GCC plugin is probably the most appropriate way to implement this: you
> could write a new pass that walks the gimple statements, and injects new
> print statements to add the diagnostics that you want.
>
> I would shamelessly promote my python plugin at this point [1] :) which
> in theory would make doing this perhaps a 20-30 line python script, but
> it doesn't yet support modifying gcc's internal representation, merely
> reading it - but that could change.
>
> Hope this is helpful
> Dave
>
> [1] https://fedorahosted.org/gcc-python-plugin/
>

Reply via email to