This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: #line directives in generated files to aid debugging


The generator programs (e.g. build/genattrtab) output #line directives
before code which has been copied from the machine description files, so the
debugger will show you the correct file. But this then causes trouble when
single stepping through code which wasn't included from the .md files.
Gen_foobar() code made from an RTL template is one example. So I thought I'd
just add #line directives to restore the file name and line number after the
included parts. This works fine except when the resulting file is large.
Then this happens during stage 2:

build/genattrtab ../../../cvssrc/gcc/gcc/config/i386/i386.md \
  insn-conditions.md \
  | awk '/^LINE$/ { print "#line", FNR + 1, "\"'/mnt/sysfs/rask/cvsbuild/gcc-i686/gcc'/insn-'attrtab'.c\""; next; } { print; }' \
  > tmp-attrtab.c
/bin/sh ../../../cvssrc/gcc/gcc/../move-if-change tmp-attrtab.c insn-attrtab.c
echo timestamp > s-attrtab
/mnt/sysfs/rask/cvsbuild/gcc-i686/./prev-gcc/xgcc -B/mnt/sysfs/rask/cvsbuild/gcc-i686/./prev-gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -c   -O2 -g -fomit-frame-pointer -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute -Werror -fno-common   -DHAVE_CONFIG_H -I. -I. -I../../../cvssrc/gcc/gcc -I../../../cvssrc/gcc/gcc/. -I../../../cvssrc/gcc/gcc/../include -I../../../cvssrc/gcc/gcc/../libcpp/include  -I../../../cvssrc/gcc/gcc/../libdecnumber -I../libdecnumber    insn-attrtab.c -o insn-attrtab.o
../../../cvssrc/gcc/gcc/config/i386/i386.md:1501:7: error: line number out of range
../../../cvssrc/gcc/gcc/config/i386/i386.md:1501:7: error: line number out of range
[cut]

The problem is that line numbers larger than 32767 are only supported with
C99 or better, which we don't request from gcc. Because of -pedantic, GCC
complains. Suggestions are welcome.

i386.md is more than 20000 lines long, btw.

-- 
Rask Ingemann Lambertsen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]