David Malcolm dmalcolm@redhat.com writes:
To get a backtrace from the plugin, you need to locate the invocation line for the gcc harness, then add "-v" to the options to see the invocation of the c compiler ("cc1"). You should then be able to run it under gdb like this:
$ gdb --args FULL ARGS OF cc1 INVOCATION (gdb) run
Here is what I get (does it help?):
$ LD_PRELOAD=/lib/libpthread.so.0 gdb --args /usr/libexec/gcc/i686-pc-linux-gnu/4.6.1/cc1 -quiet -I /usr/include/python2.7 -iplugindir=/usr/lib/gcc/i686-pc-linux-gnu/4.6.1/plugin tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U/input.c -D_FORTIFY_SOURCE=2 -iplugindir=/usr/lib/gcc/i686-pc-linux-gnu/4.6.1/plugin -quiet -dumpbase input.c -mtune=generic -march=i686 -auxbase-strip tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U/output.o -version -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U/script.py -o /tmp/ccWOUJE3.s GNU gdb (Gentoo 7.2 p1) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu". For bug reporting instructions, please see: http://bugs.gentoo.org/... Reading symbols from /usr/libexec/gcc/i686-pc-linux-gnu/4.6.1/cc1...(no debugging symbols found)...done. (gdb) run Starting program: /usr/libexec/gcc/i686-pc-linux-gnu/4.6.1/cc1 -quiet -I /usr/include/python2.7 -iplugindir=/usr/lib/gcc/i686-pc-linux-gnu/4.6.1/plugin tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U/input.c -D_FORTIFY_SOURCE=2 -iplugindir=/usr/lib/gcc/i686-pc-linux-gnu/4.6.1/plugin -quiet -dumpbase input.c -mtune=generic -march=i686 -auxbase-strip tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U/output.o -version -fplugin=/home/denys/src/my-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U/script.py -o /tmp/ccWOUJE3.s [Thread debugging using libthread_db enabled] GNU C (Gentoo 4.6.1 p1.0, pie-0.4.5) version 4.6.1 (i686-pc-linux-gnu) compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1-p4, MPC version 0.9 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Versions of loaded plugins: python: Unknown version. GNU C (Gentoo 4.6.1 p1.0, pie-0.4.5) version 4.6.1 (i686-pc-linux-gnu) compiled by GNU C version 4.6.1, GMP version 5.0.2, MPFR version 3.0.1-p4, MPC version 0.9 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Versions of loaded plugins: python: Unknown version. Compiler executable checksum: ecffa214b63698a3e0a522cca777cd13
Program received signal SIGSEGV, Segmentation fault. 0x0848457a in lookup_attribute () (gdb) bt #0 0x0848457a in lookup_attribute () #1 0x08489141 in build_pointer_type_for_mode () #2 0x08489273 in build_pointer_type () #3 0xb79ed91f in gcc_TypeDecl_get_pointer (self=0xb7537670, closure=0x0) at autogenerated-tree.c:3963 #4 0xb787203d in ?? () from /usr/lib/libpython2.7.so.1.0 (gdb) f 3 #3 0xb79ed91f in gcc_TypeDecl_get_pointer (self=0xb7537670, closure=0x0) at autogenerated-tree.c:3963 3963 return gcc_python_make_wrapper_tree(build_pointer_type(self->t)); (gdb) list 3958 }; 3959 3960 static PyObject * 3961 gcc_TypeDecl_get_pointer(PyGccTree *self, void *closure) 3962 { 3963 return gcc_python_make_wrapper_tree(build_pointer_type(self->t)); 3964 } 3965 3966 static PyGetSetDef gcc_TypeDecl_getset_table[] = { 3967 {"pointer", (gdb)
--Denys