Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Steele Scott <toojays@toojays.net>
To: gdb-patches@sources.redhat.com
Cc: Tom Tromey <tromey@redhat.com>
Subject: Re: [patch] PR symtab/13277: Resolving opaque structures in ICC generated binaries.
Date: Sun, 20 May 2012 12:34:00 -0000	[thread overview]
Message-ID: <4FB8E4BD.6000501@toojays.net> (raw)
In-Reply-To: <20120518144642.GA19690@host2.jankratochvil.net>

Jan,

Thank you for continuing to work with me on this.

On 19/05/12 00:16, Jan Kratochvil wrote:
> Hi John,
>
> On Mon, 14 May 2012 15:51:20 +0200, John Steele Scott wrote:
>> Are the existing tests already known to work with ICC?
> I do not remember trying it.  I assume many tests will FAIL.  But we do not
> want to diff gcc results vs. icc results but only icc results before the patch
> vs. icc results after the patch.

I bit the bullet and installed icc on my local machine. It's quite painful due to (I think) a round-trip to the licensing server for each compilation unit. Anyway, I was able to run the testsuite. I run "make check" with  RUNTESTFLAGS="CC_FOR_TARGET=icc CFLAGS_FOR_TARGET='-debug extended' CXX_FOR_TARGET=icpc CXXFLAGS_FOR_TARGET='-debug extended'".

I saw later your wiki page at http://sourceware.org/gdb/wiki/Running%20the%20test%20suite%20with%20a%20non-GCC%20compiler. It seems icc does now understand --print-multi-lib.

> With my icc test there is difference between the types for v and w:
> 	struct s;
> 	extern struct s v;
> 	struct w {} w;
>
> DW_AT_producer    : Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 12.1.4.319 Build 20120410 Fixes SameLinkageName MemberPointers
>
>  <1><ed>: Abbrev Number: 4 (DW_TAG_variable)
>     <f2>   DW_AT_name        : v
>     <f4>   DW_AT_type        : <0xfa>
> [shortened]
>  <1><fa>: Abbrev Number: 5 (DW_TAG_structure_type)
>     <fb>   DW_AT_decl_line   : 1
>     <fc>   DW_AT_decl_column : 8
>     <fd>   DW_AT_decl_file   : 1
>     <fe>   DW_AT_accessibility: 1       (public)
>     <ff>   DW_AT_byte_size   : 0
>     <100>   DW_AT_name        : s
>  <1><102>: Abbrev Number: 6 (DW_TAG_variable)
>     <107>   DW_AT_name        : w
>     <109>   DW_AT_type        : <0x118>
> [shortened]
>  <1><118>: Abbrev Number: 5 (DW_TAG_structure_type)
>     <119>   DW_AT_decl_line   : 4
>     <11a>   DW_AT_decl_column : 8
>     <11b>   DW_AT_decl_file   : 1
>     <11c>   DW_AT_accessibility: 1      (public)
>     <11d>   DW_AT_byte_size   : 0
>     <11e>   DW_AT_name        : w
>
> This means icc does must not use TYPE_STUB_SUPPORTED.  Just one needs to fix
> producer_is_icc so that it gets processed only once and cached via
> 'checked_producer' as otherwise it may needlessly slow down reading DWARF.

If I understand you correctly, the problem with my previous approach is that it essentially ignores empty structs. And indeed now that I run the testsuite with ICC, it shows failures in gdb.base/nofield.exp. The approach you suggested passes that test.

However, this brings us back to the problem I wrote about last October (see http://article.gmane.org/gmane.comp.gdb.patches/69651): the zero-size structures are cluttering up the psymbols and basic_lookup_transparent_type will only do one psymbol->symbol expansion per call. For a frequently referenced opaque type in a non-trivial program, initially "ptype" will show it as "no data fields". But if I repeatedly invoke ptype, eventually it resolves the type correctly. Of course this does not happen with my trivial testcase, and I'm unsure how I would expand that to expose this issue.

Can you suggest a way to fix this, without ignoring zero-size structs?

If I have to chose between showing empty structs, and correctly resolving non-empty structs, I would prefer to resolve the non-empty ones, they are much more interesting. :)

On the question of caching the producer info in the dwarf2_cu; I propose to extract out the second half of producer_is_gxx_lt_4_6 into a new check_producer function which will set cu->producer_is_gxx_lt_4_6 and cu->producer_is_icc as appropriate (and then set cu->checked_producer). producer_is_gxx_lt_4_6 and producer_is_icc will call check_producer if cu->checked_producer is not set. Sound okay?

Thanks,

John


  parent reply	other threads:[~2012-05-20 12:34 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-16  8:03 John Steele Scott
2011-10-19  9:01 ` Jan Kratochvil
2011-10-19 13:54   ` Jan Kratochvil
2011-10-23 18:29     ` John Steele Scott
2011-10-24  0:13       ` Joel Brobecker
2011-10-27 19:57       ` Tom Tromey
2011-10-23 10:26   ` John Steele Scott
2011-10-26 23:09     ` Jan Kratochvil
2011-11-13 11:38       ` [patch] PR symtab/13277: Resolving opaque structures in ICC generated binaries. (testcase) John Steele Scott
2011-11-15 17:04         ` Tom Tromey
2012-05-05  2:40           ` John Steele Scott
2012-05-05 15:16             ` Joel Brobecker
2012-05-05 15:36               ` Jan Kratochvil
2012-05-12  9:00               ` John Steele Scott
2012-05-12 18:38                 ` Jan Kratochvil
2012-05-12 19:09                   ` Joel Brobecker
2012-05-21 12:05                   ` John Steele Scott
2012-05-21 12:08                     ` John Steele Scott
2012-05-24 23:06                       ` [commit] " Jan Kratochvil
2012-05-21 12:17                     ` Jan Kratochvil
2011-11-13 12:13       ` [patch] PR symtab/13277: Resolving opaque structures in ICC generated binaries John Steele Scott
2011-11-15 17:19         ` Tom Tromey
2011-11-15 23:58           ` Jan Kratochvil
2012-05-05  2:32           ` John Steele Scott
2012-05-12 18:37             ` Jan Kratochvil
2012-05-14 13:55               ` John Steele Scott
     [not found]                 ` <20120518144642.GA19690@host2.jankratochvil.net>
2012-05-20 12:34                   ` John Steele Scott [this message]
     [not found]                     ` <20120520130919.GA6990@host2.jankratochvil.net>
2012-05-20 13:17                       ` Jan Kratochvil
2012-05-20 13:44                         ` John Steele Scott
2012-05-23 23:29                         ` John Steele Scott
2012-05-24 15:16                           ` Pedro Alves
2012-05-24 22:13                           ` [commit] " Jan Kratochvil
2012-05-24 23:05                             ` John Steele Scott
2012-05-24 22:16                         ` [commit TYPE_OPAQUE] " Jan Kratochvil
2012-05-21  0:12                     ` Doug Evans
2012-05-20 13:17                   ` Jan Kratochvil
  -- strict thread matches above, loose matches on Subject: below --
2011-10-16  7:58 John Steele Scott

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=4FB8E4BD.6000501@toojays.net \
    --to=toojays@toojays.net \
    --cc=gdb-patches@sources.redhat.com \
    --cc=tromey@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