New parameter in GCC

Ian Lance Taylor iant@google.com
Sun Aug 21 14:10:00 GMT 2011


Harry Trinta <harrytpc@gmail.com> writes:

> Can someone help me? :(

We have tried to help you.  You don't want to hear our answer.  I don't
know what sort of answer you want to hear.  Sorry.

Ian


> 2011/8/18 Harry Trinta <harrytpc@gmail.com>:
>> Dear,
>>
>> I apologize for the delay in response. I had some setbacks.
>>
>> I can not use the -D option. I'll try to explain my problem in more detail.
>>
>> I am preparing the GCC - gcov to be used in structural testing of
>> embedded systems. These systems do not have file systems, ie, can not
>> generate the gcda.
>>
>> My solution is as follows:
>> Instead of recording information in gcda coverage, I send them via a
>> socket to a remote host. This host receives the information and
>> generates the GCDA.
>>
>> The-D option is not interesting to me because the user (tester) needs
>> to change the source code of your program to use my new feature
>> (sockets).
>> And my idea is that the use of this feature is "transparent" to the
>> user, ie, the user compiles the program with only one more option,
>> without having to change your source.
>>
>> Thanks,
>> Harry
>>
>>
>> 2011/8/9 Andi Hellmund <andi@mail.lxgcc.net>:
>>> Hi Harry,
>>>
>>>>> ../../../gcc-4.6.0/libgcc/../gcc/gcov-io.c: 38:31: error:
>>>>> 'GCOV_IP_ADDRESS' undeclared here (not in a function)
>>>
>>>>> # if IN_LIBGCOV
>>>>> const char * gcov_ip_address = GCOV_IP_ADDRESS;
>>>>> # endif
>>>
>>> gcov-io.c is part of the compiler, but not part of your program. When you specific the -DGCOV_IP_ADDRESS=aa.bb.cc.dd macro, this macro is available within your program, but not within GCC. So, this macro is not available once you build libgcov. And BTW, you don't want to rebuild libgcov for each new IP adress, do you? :-)
>>>
>>> The way Ian described the solution is - if I understood it correctly - that your program has to define the symbol 'gcov_ip_address' so that libgcov is then able to read the IP address from this symbol.
>>>
>>> So, the code snippet:
>>>
>>> const char * gcov_ip_address = GCOV_IP_ADDRESS;
>>>
>>> must be part of your program. In libgcov source code, you would then have to add the following declaration:
>>>
>>> extern const char *gcov_ip_address;
>>>
>>> and then use use 'gcov_ip_address' from within the libgcov code.
>>>
>>> I hope this makes things clearer ...
>>>
>>> Andi
>>>
>>



More information about the Gcc-help mailing list