On 02/15/13 08:08, Jakub Jelinek wrote:
On Thu, Feb 14, 2013 at 05:48:57AM -0700, Jeff Law wrote:
I think two tests should be sufficient. First, compile a simple
program with -g and verify it generates dwarf2 debug records.
Second verify that there aren't any -g<foo> options, unless <foo> is
dwarf2.
I'm actually on PTO today/tomorrow, so I won't be able to look
further at this until Monday.
If someone wants to run with it, my recommendation would be Steven's
warning patch, moved to the location Jakub suggests so that users
know stabs+PCH is going away plus a hack to the testsuite suite
similar to what I outlined above plus something to either suppress
creation of the pch or suppress reading the PCH in the presence of
non-dwarf debug output.
Here is what seems to work for me.
Tested with
make check -j4 -k
RUNTESTFLAGS='--target_board=unix\{-m32,-m32/-gstabs,-m64,-m64/-gstabs\}
pch.exp'
on x86_64-linux, both with gcc just with this patch and also
this patch + changed PREFERRED_DEBUGGING_TYPE to DBX_DEBUG.
No FAILs at all, tests that wouldn't work because either -gstabs is forced
in the flags from target board or tests that would be compiled with -g
when stabs is the default are UNSUPPORTED.
2013-02-15 Jakub Jelinek <ja...@redhat.com>
Steven Bosscher <ste...@gcc.gnu.org>
PR pch/54117
* c-opts.c (c_common_post_options): If debug info is enabled
and non-dwarf*, refuse to load PCH files and when writing PCH
file warn.
* lib/dg-pch.exp (pch-init, pch-finish,
check_effective_target_pch_supported_debug): New procs.
(dg-flags-pch): If $pch_unsupported, make tests UNSUPPORTED.
Likewise if $pch_unsupported_debug and $flags include -g.
Skip FAILs about missing *.gch file if $pch_unsupported_debug
and dg-require-effective-target pch_unsupported_debug.
* g++.dg/pch/pch.exp: Call pch-init and pch-finish.
* objc.dg/pch/pch.exp: Likewise.
* gcc.dg/pch/pch.exp: Likewise.
* gcc.dg/pch/valid-1.c: Add dg-require-effective-target
pch_unsupported_debug.
* gcc.dg/pch/valid-1.hs: Likewise.
* gcc.dg/pch/valid-1b.c: Likewise.
* gcc.dg/pch/valid-1b.hs: Likewise.
This is good. Please install.
jeff