From: "gprocida+abigail at google dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/26591] detect pathologically redundant types in abixml
Date: Fri, 05 Mar 2021 16:58:56 +0000 [thread overview]
Message-ID: <bug-26591-9487-6UgrVLbnGs@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26591-9487@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=26591
--- Comment #3 from Giuliano Procida <gprocida+abigail at google dot com> ---
This is a small but probably not minimal example to illustrate one issue
clearly.
If the use of a class member type (I've tried with both typedefs and classes)
appears before the class containing that type, then `abidw` ends up emitting
various types twice.
$ head -100 h.h a.cc b.cc
==> h.h <==
struct A {
typedef int T1;
typedef int T2;
};
==> a.cc <==
#include "h.h"
A::T1 Afun(A) { return 0; }
==> b.cc <==
#include "h.h"
struct B {
typedef A::T2 T;
};
B::T Bfun(B) { return 0; }
$ g++ -Wall -Wextra -g -c a.cc
$ g++ -Wall -Wextra -g -c b.cc
$ g++ -Wall -Wextra -g --shared a.o b.o -o ab.so
$ g++ -Wall -Wextra -g --shared b.o a.o -o ba.so
$ build/tools/abidw ab.so | fgrep -v '<subrange ' | sed -rn "s;.*
id='([^']*)'.*;\1;p" | sort | uniq -c | sed 's;^ *;;' | grep -vw "^1"
$ build/tools/abidw ba.so | fgrep -v '<subrange ' | sed -rn "s;.*
id='([^']*)'.*;\1;p" | sort | uniq -c | sed 's;^ *;;' | grep -vw "^1"
2 type-id-1
2 type-id-2
2 type-id-3
2 type-id-4
$ build/tools/abidw a.o | grep typedef-decl
<typedef-decl name='T1' type-id='type-id-1' filepath='.../h.h' line='2'
column='1' id='type-id-3'/>
$ build/tools/abidw b.o | grep typedef-decl
<typedef-decl name='T' type-id='type-id-4' filepath='.../b.cc' line='4'
column='1' id='type-id-3'/>
<typedef-decl name='T2' type-id='type-id-1' filepath='.../h.h' line='3'
column='1' id='type-id-4'/>
--
You are receiving this mail because:
You are on the CC list for the bug.
next prev parent reply other threads:[~2021-03-05 16:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-09 15:18 [Bug default/26591] New: " dodji at redhat dot com
2020-09-09 15:18 ` [Bug default/26591] " dodji at redhat dot com
2020-09-10 13:56 ` dodji at redhat dot com
2021-03-02 15:31 ` gprocida+abigail at google dot com
2021-03-05 16:58 ` gprocida+abigail at google dot com [this message]
2021-03-05 17:09 ` gprocida+abigail at google dot com
2021-03-05 17:15 ` gprocida+abigail at google dot com
2021-03-20 10:32 ` gprocida+abigail at google dot com
2021-03-31 16:40 ` gprocida+abigail at google dot com
2021-04-06 20:56 ` gprocida+abigail at google dot com
2021-04-06 21:24 ` gprocida+abigail at google dot com
2021-08-12 22:09 ` gprocida at google dot com
2021-12-01 10:19 ` maennich at android dot com
2021-12-03 9:38 ` mark at klomp dot org
2021-12-03 10:25 ` gprocida at google dot com
2022-07-08 11:13 ` gprocida at google dot com
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=bug-26591-9487-6UgrVLbnGs@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.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).