Re: New parameter in GCC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>:
> 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
>



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux