This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC Plugins - CC1 - Multiple processes on PLUGIN_FINISH_TYPE
- From: Brett Foster <fosterb at edgeandvertex dot org>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 24 Apr 2012 22:37:58 -0700
- Subject: GCC Plugins - CC1 - Multiple processes on PLUGIN_FINISH_TYPE
Hi all,
I've been working on a plugin that processes some data. My plugin
grabs some data from the tree. I'm trying to understand a certain
"weird" behaviour I am seeing. And yeah, I'm new to the mailing list
and gcc's innards! Be forgiving! :) I appreciate the help!
When I add:
register_callback (BaseName, PLUGIN_FINISH_TYPE, CinsGcc_CB_Type, NULL);
The plugin appears to be loaded by a 2nd process, initialized, and
provided with what appears to be much the same data (at least from my
view). Other plugin events do not appear to cause this behaviour.
The command line is..,
gcc -fplugin=./out/cins.so -c -o ./out/tests/test_0.o test/test_0.c \
-fplugin-arg-cins-error=./out/tests/test_0.o_err.txt \
-fplugin-arg-cins-output=./out/tests/test_0.o_out.txt
The extended log file written to disk says:
(0000001E:000031D1) INFO
src/plugin/gcc_core.c:00000092 plugin_init CINS
silencing console now.
The console says:
<CINS INFO:0000001E:000031CD> CINS silencing console now.
000031D1 and 000031CD are different PIDs.
0000001E is the identifier indicating the log count (i.e. there were
0x1E prints that came before)
As well, __progname == 'cc1'.
gcc -v:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6.1/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.1-9ubuntu3'
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin
--enable-objc-gc --enable-targets=all --disable-werror
--with-arch-32=i686 --with-tune=generic --enable-checking=release
--build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)