public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Cary Coutant <ccoutant@google.com>
To: gcc-patches@gcc.gnu.org, jason@redhat.com
Subject: Re: [patch] Fix problems with -fdebug-types-section and local types
Date: Wed, 08 Aug 2012 18:30:00 -0000	[thread overview]
Message-ID: <CAHACq4oez-LEQ5Rn=CAZXKu-3G4cztmriWbBQ-ZBsC8YfT+HEw@mail.gmail.com> (raw)
In-Reply-To: <20120808012132.58C6AE0822@ccoutant.mtv.corp.google.com>

> Index: gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-nested.C
> ===================================================================
> --- gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-nested.C   (revision 0)
> +++ gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-nested.C   (revision 0)
> @@ -0,0 +1,55 @@
> +// { dg-do compile }
> +// { dg-options "--std=c++11 -dA -gdwarf-4 -fdebug-types-section -fno-merge-debug-strings" }
> +
> +// Check that -fdebug-types-sections does not copy a full referenced type
> +// into a type unit.
> +
> +// Checks that at least one type unit is generated.
> +//
> +// { dg-final { scan-assembler "DIE \\(.*\\) DW_TAG_type_unit" } }
> +//
> +// Check that func is declared exactly twice in the debug info:
> +// once in the type unit for struct D, and once in the compile unit.
> +//
> +// { dg-final { scan-assembler-times "\\.ascii \"func\\\\0\"\[^\n\]*DW_AT_name" 2 } }
> +//
> +// Check to make sure that no type unit contains a DIE with DW_AT_low_pc
> +// or DW_AT_ranges.  These patterns assume that the compile unit is always
> +// emitted after all type units.
> +//
> +// { dg-final { scan-assembler-not "\\.quad.*DW_AT_low_pc.*DIE \\(.*\\) DW_TAG_compile_unit" } }
> +// { dg-final { scan-assembler-not "\\.quad.*DW_AT_ranges.*DIE \\(.*\\) DW_TAG_compile_unit" } }

I found a minor problem with the regexps above -- I was using ".*" in
a few places where I should have been using "\[^\n\]*". Fixed as
follows:

+// { dg-final { scan-assembler "DIE \\(\[^\n\]*\\) DW_TAG_type_unit" } }

+// { dg-final { scan-assembler-times "\\.ascii
\"func\\\\0\"\[^\n\]*DW_AT_name" 2 } }

+// { dg-final { scan-assembler-not "\\.quad\[^\n\]*DW_AT_low_pc.*DIE
\\(\[^\n\]*\\) DW_TAG_compile_unit" } }
+// { dg-final { scan-assembler-not "\\.quad\[^\n\]*DW_AT_ranges.*DIE
\\(\[^\n\]*\\) DW_TAG_compile_unit" } }

(Sorry, these will probably get split into two lines by gmail, but
they're each a single line in the actual patch.)

-cary

  reply	other threads:[~2012-08-08 18:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08  1:21 Cary Coutant
2012-08-08 18:30 ` Cary Coutant [this message]
2012-08-13 20:13   ` Cary Coutant
2012-08-20 20:31     ` Cary Coutant
2012-08-29 18:55       ` Cary Coutant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHACq4oez-LEQ5Rn=CAZXKu-3G4cztmriWbBQ-ZBsC8YfT+HEw@mail.gmail.com' \
    --to=ccoutant@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).