public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Dodji Seketeli <dodji@seketeli.org>
Cc: libabigail@sourceware.org
Subject: Re: Surprising behavior of suppress_type drop = yes
Date: Wed, 08 Apr 2020 16:32:53 +0200	[thread overview]
Message-ID: <52c5ab9801899f080f4e7838ded9ea64f78317c9.camel@klomp.org> (raw)
In-Reply-To: <86pnckpmc6.fsf@seketeli.org>

[-- Attachment #1: Type: text/plain, Size: 2062 bytes --]

Hi Dodji,

On Mon, 2020-04-06 at 19:15 +0200, Dodji Seketeli wrote:
> > Note how abidiff treats the function return type and parameters changed
> > from void * to Foo * as disappearing.
> > 
> > Is there another way to achieve what I want/need?
> 
> I think there is a non-documented way to do this, yes.  It hasn't been
> yet documented because nobody expressed the need for it yet.
> 
> Basically you want to do this:
> 
> [suppress_type]
>   label = "Artificial·private·types·suppression·specification"

Assuming those fancy dots are actually spaces.

>   source_location_not_in = list.h, of.h, public.h, headers.h
>   drop = yes
> 
> The 'label' property there is important and it needs to have that exact
> string value.
> 
> Libabigail generates this kind of suppression specifications internally
> to handle types that it considers to be private types, namely, types
> that are defined in files specified by --headers-dir{1,2}.
> 
> So I guess you can use that undocumented feature for now.

It doesn't seem to change anything for my example.
I assume it does for you? Can you attach the xml abi file it is
supposed to generate? Mine still looks like the attached with missing
return types and arguments where there should be pointers to Foo. Maybe
my suppression file still isn't correct? I attached both.

> > Or can we have a "drop mode" that treats handles to dropped types a
> > simple void pointers instead?
> 
> I think what you'd need, really, is a combination of:
> 
>     1/ a new --header-files{1,2} option
>     2/ an "opaque = yes" attribute in the suppression specification.
> 
> I think either 1/ or 2/ should work, but it'd be nice to have both.
> 
> If you think that suggession holds water, then we should probably
> file a
> bug to add this new feature.

Why not fix the default?

I am trying to figure out why the command line option is different from
the suppress_type default way of handling drop. And when that default
way of working is actually useful?

Thanks,

Mark

[-- Attachment #2: libfoo.abi --]
[-- Type: text/plain, Size: 2305 bytes --]

<abi-corpus architecture='elf-amd-x86_64'>
  <elf-needed>
    <dependency name='libc.so.6'/>
  </elf-needed>
  <elf-function-symbols>
    <elf-symbol name='_fini' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
    <elf-symbol name='_init' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
    <elf-symbol name='create_foo' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
    <elf-symbol name='destroy_foo' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
    <elf-symbol name='get_foo' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
    <elf-symbol name='set_foo' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
  </elf-function-symbols>
  <abi-instr version='1.0' address-size='64' path='foo.c' language='LANG_C99'>
    <type-decl name='int' size-in-bits='32' id='type-id-1'/>
    <type-decl name='void' id='type-id-2'/>
    <function-decl name='get_foo' mangled-name='get_foo' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='get_foo'>
      <return type-id='type-id-1'/>
    </function-decl>
    <function-decl name='set_foo' mangled-name='set_foo' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='set_foo'>
      <parameter type-id='type-id-1' name='num'/>
      <return type-id='type-id-2'/>
    </function-decl>
    <function-decl name='destroy_foo' mangled-name='destroy_foo' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='destroy_foo'>
      <return type-id='type-id-2'/>
    </function-decl>
    <function-decl name='create_foo' mangled-name='create_foo' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='create_foo'>
      <return type-id='type-id-2'/>
    </function-decl>
    <function-decl name='free' mangled-name='free' visibility='default' binding='global' size-in-bits='64'>
      <return type-id='type-id-2'/>
    </function-decl>
    <function-decl name='malloc' mangled-name='malloc' visibility='default' binding='global' size-in-bits='64'>
      <return type-id='type-id-2'/>
    </function-decl>
  </abi-instr>
</abi-corpus>

[-- Attachment #3: libfoo.supp --]
[-- Type: text/plain, Size: 125 bytes --]

[suppress_type]
  label = "Artificial private types suppression specification"
  source_location_not_in = foo.h
  drop = yes

  reply	other threads:[~2020-04-08 14:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-05 14:38 Mark Wielaard
2020-04-06 17:15 ` Dodji Seketeli
2020-04-08 14:32   ` Mark Wielaard [this message]
2020-04-09 13:52     ` Dodji Seketeli
2020-04-12  1:44       ` Mark Wielaard
2020-04-12  1:47         ` [PATCH 1/2] Add --header-file option to add individual public header files Mark Wielaard
2020-04-12  1:47           ` [PATCH 2/2] Add --drop-private-types to abidw Mark Wielaard
2020-04-14 15:37             ` Dodji Seketeli
2020-04-14 15:19           ` [PATCH 1/2] Add --header-file option to add individual public header files Dodji Seketeli

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=52c5ab9801899f080f4e7838ded9ea64f78317c9.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=dodji@seketeli.org \
    --cc=libabigail@sourceware.org \
    /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).